mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 06:06:17 +02:00
* Do not generate code for types that are used in a ignored definiton
This commit is contained in:
parent
2a9eccec65
commit
70b2f29b92
@ -2022,6 +2022,8 @@ var
|
|||||||
FD: TIDLFunctionDefinition;
|
FD: TIDLFunctionDefinition;
|
||||||
begin
|
begin
|
||||||
if D=nil then exit;
|
if D=nil then exit;
|
||||||
|
if not ConvertDef(D) then
|
||||||
|
exit;
|
||||||
//writeln('TBaseWebIDLToPas.ResolveTypeDef START ',D.Name,':',D.ClassName,' at ',GetDefPos(D),' D=',hexstr(ptruint(D),sizeof(ptruint)*2));
|
//writeln('TBaseWebIDLToPas.ResolveTypeDef START ',D.Name,':',D.ClassName,' at ',GetDefPos(D),' D=',hexstr(ptruint(D),sizeof(ptruint)*2));
|
||||||
if D Is TIDLInterfaceDefinition then
|
if D Is TIDLInterfaceDefinition then
|
||||||
ResolveTypeDefs(TIDLInterfaceDefinition(D).Members)
|
ResolveTypeDefs(TIDLInterfaceDefinition(D).Members)
|
||||||
|
@ -61,6 +61,7 @@ type
|
|||||||
procedure TestWJ_IntfFunction_SequenceResult;
|
procedure TestWJ_IntfFunction_SequenceResult;
|
||||||
procedure TestWJ_IntfFunction_GlobalSequenceResult;
|
procedure TestWJ_IntfFunction_GlobalSequenceResult;
|
||||||
procedure TestWJ_IntfFunction_ChromeOnly;
|
procedure TestWJ_IntfFunction_ChromeOnly;
|
||||||
|
procedure TestWJ_IntfFunction_ChromeOnlyNewObject;
|
||||||
// Namespace attribute
|
// Namespace attribute
|
||||||
procedure TestWJ_NamespaceAttribute_Boolean;
|
procedure TestWJ_NamespaceAttribute_Boolean;
|
||||||
// maplike
|
// maplike
|
||||||
@ -1306,6 +1307,46 @@ begin
|
|||||||
]);
|
]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestWebIDL2WasmJob.TestWJ_IntfFunction_ChromeOnlyNewObject;
|
||||||
|
begin
|
||||||
|
|
||||||
|
TestWebIDL([
|
||||||
|
'interface Attr {',
|
||||||
|
' [ChromeOnly, NewObject] ',
|
||||||
|
' ConsoleInstance createInstance(optional ConsoleInstanceOptions options = {});',
|
||||||
|
'};'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'Type',
|
||||||
|
' // Forward class definitions',
|
||||||
|
' IJSAttr = interface;',
|
||||||
|
' TJSAttr = class;',
|
||||||
|
' { --------------------------------------------------------------------',
|
||||||
|
' TJSAttr',
|
||||||
|
' --------------------------------------------------------------------}',
|
||||||
|
'',
|
||||||
|
' IJSAttr = interface(IJSObject)',
|
||||||
|
' [''{AA94F48A-9540-32B7-B05B-E99EB8B2AF2A}'']',
|
||||||
|
' end;',
|
||||||
|
'',
|
||||||
|
' TJSAttr = class(TJSObject,IJSAttr)',
|
||||||
|
' Private',
|
||||||
|
' Public',
|
||||||
|
' class function Cast(const Intf: IJSObject): IJSAttr;',
|
||||||
|
' end;',
|
||||||
|
'',
|
||||||
|
'implementation',
|
||||||
|
'',
|
||||||
|
'class function TJSAttr.Cast(const Intf: IJSObject): IJSAttr;',
|
||||||
|
'begin',
|
||||||
|
' Result:=TJSAttr.JOBCast(Intf);',
|
||||||
|
'end;',
|
||||||
|
'',
|
||||||
|
'end.',
|
||||||
|
''
|
||||||
|
]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TTestWebIDL2WasmJob.TestWJ_NamespaceAttribute_Boolean;
|
procedure TTestWebIDL2WasmJob.TestWJ_NamespaceAttribute_Boolean;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user