mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-17 00:20:46 +01:00
* INdicate required dictionary fields
This commit is contained in:
parent
f35a565f4e
commit
04a9cc3ed9
@ -701,7 +701,7 @@ end;
|
|||||||
|
|
||||||
function TWebIDLToPasWasmJob.WriteDictionaryField(aDict: TIDLDictionaryDefinition; aField: TIDLDictionaryMemberDefinition): Boolean;
|
function TWebIDLToPasWasmJob.WriteDictionaryField(aDict: TIDLDictionaryDefinition; aField: TIDLDictionaryMemberDefinition): Boolean;
|
||||||
var
|
var
|
||||||
N, TN: TIDLString;
|
aDef, N, TN: TIDLString;
|
||||||
begin
|
begin
|
||||||
if (aDict=Nil) then ; // Silence compiler warning
|
if (aDict=Nil) then ; // Silence compiler warning
|
||||||
Result:=True;
|
Result:=True;
|
||||||
@ -709,7 +709,10 @@ begin
|
|||||||
TN:=GetPasName(aField.MemberType);
|
TN:=GetPasName(aField.MemberType);
|
||||||
if SameText(N,TN) then
|
if SameText(N,TN) then
|
||||||
N:='_'+N;
|
N:='_'+N;
|
||||||
AddLn(N+': '+TN+';');
|
aDef:=N+': '+TN+';';
|
||||||
|
if aField.IsRequired then
|
||||||
|
aDef:=aDef+' // required';
|
||||||
|
AddLn(aDef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWebIDLToPasWasmJob.WriteForwardClassDef(D: TIDLStructuredDefinition
|
function TWebIDLToPasWasmJob.WriteForwardClassDef(D: TIDLStructuredDefinition
|
||||||
@ -1890,6 +1893,9 @@ begin
|
|||||||
Code:=Code+';';
|
Code:=Code+';';
|
||||||
if aType is TIDLFunctionDefinition then
|
if aType is TIDLFunctionDefinition then
|
||||||
Code:='// '+Code;
|
Code:='// '+Code;
|
||||||
|
if (aProp is TIDLDictionaryMemberDefinition) then
|
||||||
|
if TIDLDictionaryMemberDefinition(aProp).IsRequired then
|
||||||
|
Code:=Code+' // required';
|
||||||
AddLn(Code);
|
AddLn(Code);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user