<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208066] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208066">208066</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-10-28 13:53:03 -0700 (Fri, 28 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WebIDL] Update parser and code generators to only access type information through the type property
https://bugs.webkit.org/show_bug.cgi?id=164141
Reviewed by Anders Carlsson.
Source/WebCore:
Update IDLParser structs:
- domSignature: Rename idlType to type. Specify that type is a domType.
- domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
- domFunction: Specify that signature is a domSignature.
- domAttribute: Remove unused type. Specify that signature is a domSignature.
- domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
- domConstant: Specify that type is a domType.
- domEnum: Specify that type is a domType.
- domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
- Typedef: Rename idlType to type and specify that it is a domType.
* bindings/scripts/IDLParser.pm:
Remove redundant properties and specify type info in structs where possible.
* bindings/scripts/CodeGenerator.pm:
(IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
(GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/CodeGeneratorJS.pm:
(IsNullableType): Deleted.
(StripNullable): Deleted.
Remove unused functions.
Update to always access type information through type accessors. Remove use of removed
properties.
* bindings/scripts/generate-bindings.pl:
Update to always access type information through type accessors. Remove use of removed
properties.
Tools:
* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
Update to always access type information through type accessors. Remove use of removed
properties.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsgeneratebindingspl">trunk/Source/WebCore/bindings/scripts/generate-bindings.pl</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm">trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Source/WebCore/ChangeLog        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-10-28 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Update parser and code generators to only access type information through the type property
+ https://bugs.webkit.org/show_bug.cgi?id=164141
+
+ Reviewed by Anders Carlsson.
+
+ Update IDLParser structs:
+ - domSignature: Rename idlType to type. Specify that type is a domType.
+ - domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
+ - domFunction: Specify that signature is a domSignature.
+ - domAttribute: Remove unused type. Specify that signature is a domSignature.
+ - domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
+ - domConstant: Specify that type is a domType.
+ - domEnum: Specify that type is a domType.
+ - domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
+ - Typedef: Rename idlType to type and specify that it is a domType.
+
+ * bindings/scripts/IDLParser.pm:
+ Remove redundant properties and specify type info in structs where possible.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
+ (IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
+ (GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
+ (GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
+
+ Update to always access type information through type accessors. Remove use of removed
+ properties.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (IsNullableType): Deleted.
+ (StripNullable): Deleted.
+ Remove unused functions.
+
+ Update to always access type information through type accessors. Remove use of removed
+ properties.
+
+ * bindings/scripts/generate-bindings.pl:
+ Update to always access type information through type accessors. Remove use of removed
+ properties.
+
</ins><span class="cx"> 2016-10-28 Dave Hyatt <hyatt@apple.com>
</span><span class="cx">
</span><span class="cx"> [CSS Parser] Support bopomofo Ruby
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -180,13 +180,13 @@
</span><span class="cx">
</span><span class="cx"> foreach my $dictionary (@{$useDocument->dictionaries}) {
</span><span class="cx"> if ($dictionary->extendedAttributes->{"ImplementedAs"}) {
</span><del>- $dictionaryTypeImplementationNameOverrides{$dictionary->name} = $dictionary->extendedAttributes->{"ImplementedAs"};
</del><ins>+ $dictionaryTypeImplementationNameOverrides{$dictionary->type->name} = $dictionary->extendedAttributes->{"ImplementedAs"};
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> foreach my $enumeration (@{$useDocument->enumerations}) {
</span><span class="cx"> if ($enumeration->extendedAttributes->{"ImplementedAs"}) {
</span><del>- $enumTypeImplementationNameOverrides{$enumeration->name} = $enumeration->extendedAttributes->{"ImplementedAs"};
</del><ins>+ $enumTypeImplementationNameOverrides{$enumeration->type->name} = $enumeration->extendedAttributes->{"ImplementedAs"};
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> unless (defined($codeGenerator)) {
</span><span class="cx"> my $interfaces = $useDocument->interfaces;
</span><span class="cx"> foreach my $interface (@$interfaces) {
</span><del>- print "Skipping $useGenerator code generation for IDL interface \"" . $interface->name . "\".\n" if $verbose;
</del><ins>+ print "Skipping $useGenerator code generation for IDL interface \"" . $interface->type->name . "\".\n" if $verbose;
</ins><span class="cx"> }
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx"> die "Multiple interfaces per document are not supported" if @$interfaces > 1;
</span><span class="cx">
</span><span class="cx"> my $interface = @$interfaces[0];
</span><del>- print "Generating $useGenerator bindings code for IDL interface \"" . $interface->name . "\"...\n" if $verbose;
</del><ins>+ print "Generating $useGenerator bindings code for IDL interface \"" . $interface->type->name . "\"...\n" if $verbose;
</ins><span class="cx"> $codeGenerator->GenerateInterface($interface, $defines, $useDocument->enumerations, $useDocument->dictionaries);
</span><span class="cx"> $codeGenerator->WriteData($interface, $useOutputDir, $useOutputHeadersDir);
</span><span class="cx"> return;
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> die "Multiple standalone dictionaries per document are not supported" if @$dictionaries > 1;
</span><span class="cx">
</span><span class="cx"> my $dictionary = @$dictionaries[0];
</span><del>- print "Generating $useGenerator bindings code for IDL dictionary \"" . $dictionary->name . "\"...\n" if $verbose;
</del><ins>+ print "Generating $useGenerator bindings code for IDL dictionary \"" . $dictionary->type->name . "\"...\n" if $verbose;
</ins><span class="cx"> $codeGenerator->GenerateDictionary($dictionary, $useDocument->enumerations);
</span><span class="cx"> $codeGenerator->WriteData($dictionary, $useOutputDir, $useOutputHeadersDir);
</span><span class="cx"> return;
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> die "Multiple standalone enumerations per document are not supported" if @$enumerations > 1;
</span><span class="cx">
</span><span class="cx"> my $enumeration = @$enumerations[0];
</span><del>- print "Generating $useGenerator bindings code for IDL enumeration \"" . $enumeration->name . "\"...\n" if $verbose;
</del><ins>+ print "Generating $useGenerator bindings code for IDL enumeration \"" . $enumeration->type->name . "\"...\n" if $verbose;
</ins><span class="cx"> $codeGenerator->GenerateEnumeration($enumeration);
</span><span class="cx"> $codeGenerator->WriteData($enumeration, $useOutputDir, $useOutputHeadersDir);
</span><span class="cx"> return;
</span><span class="lines">@@ -352,7 +352,7 @@
</span><span class="cx">
</span><span class="cx"> # Step #1: Find the IDL file associated with 'interface'
</span><span class="cx"> my $filename = $object->IDLFileForInterface($interfaceName)
</span><del>- or assert("Could NOT find IDL file for interface \"$interfaceName\", reachable from \"" . $outerInterface->name . "\"!\n");
</del><ins>+ or assert("Could NOT find IDL file for interface \"$interfaceName\", reachable from \"" . $outerInterface->type->name . "\"!\n");
</ins><span class="cx">
</span><span class="cx"> print " | |> Parsing parent IDL \"$filename\" for interface \"$interfaceName\"\n" if $verbose;
</span><span class="cx">
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx"> my $document = $parser->Parse($filename, $defines, $preprocessor);
</span><span class="cx">
</span><span class="cx"> foreach my $interface (@{$document->interfaces}) {
</span><del>- if ($interface->name eq $interfaceName) {
</del><ins>+ if ($interface->type->name eq $interfaceName) {
</ins><span class="cx"> $cachedInterfaces->{$interfaceName} = $interface;
</span><span class="cx"> return $interface;
</span><span class="cx"> }
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx"> die "GetEnumByName() was called with an undefined enumeration name" unless defined($name);
</span><span class="cx">
</span><span class="cx"> for my $enumeration (@{$useDocument->enumerations}) {
</span><del>- return $enumeration if $enumeration->name eq $name;
</del><ins>+ return $enumeration if $enumeration->type->name eq $name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return $cachedExternalEnumerations->{$name} if exists($cachedExternalEnumerations->{$name});
</span><span class="lines">@@ -493,11 +493,11 @@
</span><span class="cx"> my $document = $parser->Parse($filename, $defines, $preprocessor);
</span><span class="cx">
</span><span class="cx"> foreach my $enumeration (@{$document->enumerations}) {
</span><del>- next unless $enumeration->name eq $name;
</del><ins>+ next unless $enumeration->type->name eq $name;
</ins><span class="cx">
</span><span class="cx"> $cachedExternalEnumerations->{$name} = $enumeration;
</span><span class="cx"> my $implementedAs = $enumeration->extendedAttributes->{ImplementedAs};
</span><del>- $enumTypeImplementationNameOverrides{$enumeration->name} = $implementedAs if $implementedAs;
</del><ins>+ $enumTypeImplementationNameOverrides{$enumeration->type->name} = $implementedAs if $implementedAs;
</ins><span class="cx"> return $enumeration;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx"> die "GetDictionaryByType() was called with an undefined dictionary name" unless defined($name);
</span><span class="cx">
</span><span class="cx"> for my $dictionary (@{$useDocument->dictionaries}) {
</span><del>- return $dictionary if $dictionary->name eq $name;
</del><ins>+ return $dictionary if $dictionary->type->name eq $name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return $cachedExternalDictionaries->{$name} if exists($cachedExternalDictionaries->{$name});
</span><span class="lines">@@ -561,11 +561,11 @@
</span><span class="cx"> my $document = $parser->Parse($filename, $defines, $preprocessor);
</span><span class="cx">
</span><span class="cx"> foreach my $dictionary (@{$document->dictionaries}) {
</span><del>- next unless $dictionary->name eq $name;
</del><ins>+ next unless $dictionary->type->name eq $name;
</ins><span class="cx">
</span><span class="cx"> $cachedExternalDictionaries->{$name} = $dictionary;
</span><span class="cx"> my $implementedAs = $dictionary->extendedAttributes->{ImplementedAs};
</span><del>- $dictionaryTypeImplementationNameOverrides{$dictionary->name} = $implementedAs if $implementedAs;
</del><ins>+ $dictionaryTypeImplementationNameOverrides{$dictionary->type->name} = $implementedAs if $implementedAs;
</ins><span class="cx"> return $dictionary;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub IsSVGTypeNeedingTearOffForType
</del><ins>+sub IsSVGTypeNeedingTearOff
</ins><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="cx">
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub IsSVGTypeWithWritablePropertiesNeedingTearOffForType
</del><ins>+sub IsSVGTypeWithWritablePropertiesNeedingTearOff
</ins><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="cx">
</span><span class="lines">@@ -667,7 +667,7 @@
</span><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub GetSVGTypeNeedingTearOffForType
</del><ins>+sub GetSVGTypeNeedingTearOff
</ins><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="cx">
</span><span class="lines">@@ -677,13 +677,13 @@
</span><span class="cx"> return undef;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub GetSVGWrappedTypeNeedingTearOffForType
</del><ins>+sub GetSVGWrappedTypeNeedingTearOff
</ins><span class="cx"> {
</span><span class="cx"> my ($object, $type) = @_;
</span><span class="cx">
</span><span class="cx"> assert("Not a type") if ref($type) ne "domType";
</span><span class="cx">
</span><del>- my $svgTypeNeedingTearOff = $object->GetSVGTypeNeedingTearOffForType($type);
</del><ins>+ my $svgTypeNeedingTearOff = $object->GetSVGTypeNeedingTearOff($type);
</ins><span class="cx"> return $svgTypeNeedingTearOff if not $svgTypeNeedingTearOff;
</span><span class="cx">
</span><span class="cx"> if ($svgTypeNeedingTearOff =~ /SVGPropertyTearOff/) {
</span><span class="lines">@@ -749,7 +749,6 @@
</span><span class="cx">
</span><span class="cx"> assert("Not a type") if ref($type) ne "domType";
</span><span class="cx">
</span><del>- # FIXME: Update parser to make this just 'FrozenArray'
</del><span class="cx"> return $type->name eq "FrozenArray";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -877,7 +876,7 @@
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"ImplementedAs"}) {
</span><span class="cx"> $attributeName = $attribute->signature->extendedAttributes->{"ImplementedAs"};
</span><span class="cx"> }
</span><del>- my $attributeType = $attribute->signature->idlType;
</del><ins>+ my $attributeType = $attribute->signature->type;
</ins><span class="cx">
</span><span class="cx"> # SVG animated types need to use a special attribute name.
</span><span class="cx"> # The rest of the special casing for SVG animated types is handled in the language-specific code generators.
</span><span class="lines">@@ -911,7 +910,7 @@
</span><span class="cx"> return ($generator->WK_lcfirst($generator->AttributeNameForGetterAndSetter($attribute)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $attributeType = $attribute->signature->idlType;
</del><ins>+ my $attributeType = $attribute->signature->type;
</ins><span class="cx">
</span><span class="cx"> my $functionName;
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"URL"}) {
</span><span class="lines">@@ -949,7 +948,7 @@
</span><span class="cx"> return ("set" . $generator->WK_ucfirst($generator->AttributeNameForGetterAndSetter($attribute)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $attributeType = $attribute->signature->idlType;
</del><ins>+ my $attributeType = $attribute->signature->type;
</ins><span class="cx">
</span><span class="cx"> my $functionName;
</span><span class="cx"> if ($attributeType->name eq "boolean") {
</span><span class="lines">@@ -1150,7 +1149,7 @@
</span><span class="cx">
</span><span class="cx"> my @checks = ();
</span><span class="cx"> foreach my $constant (@{$interface->constants}) {
</span><del>- my $className = $constant->extendedAttributes->{"ImplementedBy"} || $interface->name;
</del><ins>+ my $className = $constant->extendedAttributes->{"ImplementedBy"} || $interface->type->name;
</ins><span class="cx"> my $name = $constant->extendedAttributes->{"Reflect"} || $constant->name;
</span><span class="cx"> my $value = $constant->value;
</span><span class="cx"> my $conditional = $constant->extendedAttributes->{"Conditional"};
</span><span class="lines">@@ -1180,7 +1179,7 @@
</span><span class="cx"> my ($object, $interface) = @_;
</span><span class="cx">
</span><span class="cx"> my $interfaceName = $interface->extendedAttributes->{"InterfaceName"};
</span><del>- return $interfaceName ? $interfaceName : $interface->name;
</del><ins>+ return $interfaceName ? $interfaceName : $interface->type->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub InheritsInterface
</span><span class="lines">@@ -1187,12 +1186,12 @@
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $interfaceName) = @_;
</span><span class="cx">
</span><del>- return 1 if $interfaceName eq $interface->name;
</del><ins>+ return 1 if $interfaceName eq $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> my $found = 0;
</span><span class="cx"> $object->ForAllParents($interface, sub {
</span><span class="cx"> my $currentInterface = shift;
</span><del>- if ($currentInterface->name eq $interfaceName) {
</del><ins>+ if ($currentInterface->type->name eq $interfaceName) {
</ins><span class="cx"> $found = 1;
</span><span class="cx"> }
</span><span class="cx"> return 1 if $found;
</span><span class="lines">@@ -1224,9 +1223,9 @@
</span><span class="cx"> my ($object, $parameter, $interface) = @_;
</span><span class="cx">
</span><span class="cx"> return 0 if $parameter->isVariadic;
</span><del>- return 0 if $parameter->isNullable;
- return 0 if !$object->IsWrapperType($parameter->idlType) && !$object->IsTypedArrayType($parameter->idlType);
- return 0 if $object->IsSVGTypeNeedingTearOffForType($parameter->idlType);
</del><ins>+ return 0 if $parameter->type->isNullable;
+ return 0 if !$object->IsWrapperType($parameter->type) && !$object->IsTypedArrayType($parameter->type);
+ return 0 if $object->IsSVGTypeNeedingTearOff($parameter->type);
</ins><span class="cx">
</span><span class="cx"> return 1;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -179,13 +179,13 @@
</span><span class="cx"> $extendedAttributeList->{ImplementedAs} = $attribute->signature->name;
</span><span class="cx"> $stringifier->signature->extendedAttributes($extendedAttributeList);
</span><span class="cx"> $stringifier->signature->name("toString");
</span><del>- die "stringifier can only be used on attributes of String types" unless $codeGenerator->IsStringType($attribute->signature->idlType);
</del><ins>+ die "stringifier can only be used on attributes of String types" unless $codeGenerator->IsStringType($attribute->signature->type);
</ins><span class="cx">
</span><span class="cx"> # FIXME: This should use IDLParser's cloneType.
</span><span class="cx"> my $type = domType->new();
</span><del>- $type->name($attribute->signature->idlType->name);
</del><ins>+ $type->name($attribute->signature->type->name);
</ins><span class="cx">
</span><del>- $stringifier->signature->idlType($type);
</del><ins>+ $stringifier->signature->type($type);
</ins><span class="cx">
</span><span class="cx"> push(@{$interface->functions}, $stringifier);
</span><span class="cx"> last;
</span><span class="lines">@@ -209,8 +209,8 @@
</span><span class="cx">
</span><span class="cx"> return $interface->extendedAttributes->{JSLegacyParent} if $interface->extendedAttributes->{JSLegacyParent};
</span><span class="cx"> return "JSDOMObject" unless NeedsImplementationClass($interface);
</span><del>- return "JSDOMWrapper<" . GetImplClassName($interface) . ">" unless $interface->parent;
- return "JS" . $interface->parent;
</del><ins>+ return "JSDOMWrapper<" . GetImplClassName($interface) . ">" unless $interface->parentType;
+ return "JS" . $interface->parentType->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetCallbackClassName
</span><span class="lines">@@ -260,14 +260,18 @@
</span><span class="cx">
</span><span class="cx"> sub AddToImplIncludesForIDLType
</span><span class="cx"> {
</span><del>- my ($idlType, $conditional) = @_;
</del><ins>+ my ($type, $conditional) = @_;
+
+ return if $codeGenerator->IsPrimitiveType($type);
+ return if $codeGenerator->IsStringType($type);
+ return if $codeGenerator->IsTypedArrayType($type);
+ return if $type->name eq "BufferSource";
+ return if $type->name eq "any";
</ins><span class="cx">
</span><del>- return if $codeGenerator->SkipIncludeHeader($idlType->name);
-
- if ($idlType->isUnion) {
</del><ins>+ if ($type->isUnion) {
</ins><span class="cx"> AddToImplIncludes("<wtf/Variant.h>", $conditional);
</span><span class="cx">
</span><del>- foreach my $memberType (@{$idlType->subtypes}) {
</del><ins>+ foreach my $memberType (@{$type->subtypes}) {
</ins><span class="cx"> AddToImplIncludesForIDLType($memberType, $conditional);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -274,14 +278,14 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsSequenceOrFrozenArrayType($idlType)) {
</del><ins>+ if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
</ins><span class="cx"> AddToImplIncludes("<runtime/JSArray.h>", $conditional);
</span><del>- AddToImplIncludesForIDLType(@{$idlType->subtypes}[0], $conditional);
</del><ins>+ AddToImplIncludesForIDLType(@{$type->subtypes}[0], $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsWrapperType($idlType) || $codeGenerator->IsExternalDictionaryType($idlType) || $codeGenerator->IsExternalEnumType($idlType)) {
- AddToImplIncludes("JS" . $idlType->name . ".h", $conditional);
</del><ins>+ if ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsExternalDictionaryType($type) || $codeGenerator->IsExternalEnumType($type)) {
+ AddToImplIncludes("JS" . $type->name . ".h", $conditional);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -334,7 +338,7 @@
</span><span class="cx"> sub IsDOMGlobalObject
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope") || $interface->name eq "TestGlobalObject";
</del><ins>+ return $interface->type->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope") || $interface->type->name eq "TestGlobalObject";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub ShouldUseGlobalObjectPrototype
</span><span class="lines">@@ -342,7 +346,7 @@
</span><span class="cx"> my $interface = shift;
</span><span class="cx">
</span><span class="cx"> # For workers, the global object is a DedicatedWorkerGlobalScope.
</span><del>- return 0 if $interface->name eq "WorkerGlobalScope";
</del><ins>+ return 0 if $interface->type->name eq "WorkerGlobalScope";
</ins><span class="cx">
</span><span class="cx"> return IsDOMGlobalObject($interface);
</span><span class="cx"> }
</span><span class="lines">@@ -378,7 +382,7 @@
</span><span class="cx"> # where the index is out of range.
</span><span class="cx">
</span><span class="cx"> # FIXME: Should this work for all string types?
</span><del>- if ($indexedGetterFunction->signature->idlType->name eq "DOMString") {
</del><ins>+ if ($indexedGetterFunction->signature->type->name eq "DOMString") {
</ins><span class="cx"> push(@getOwnPropertySlotImpl, " if (optionalIndex) {\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@getOwnPropertySlotImpl, " if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n");
</span><span class="lines">@@ -441,7 +445,7 @@
</span><span class="cx"> sub GenerateHeaderContentHeader
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- my $className = "JS" . $interface->name;
</del><ins>+ my $className = "JS" . $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> my @headerContentHeader;
</span><span class="cx"> if ($interface->extendedAttributes->{AppleCopyright}) {
</span><span class="lines">@@ -460,7 +464,7 @@
</span><span class="cx"> sub GenerateImplementationContentHeader
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- my $className = "JS" . $interface->name;
</del><ins>+ my $className = "JS" . $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> my @implContentHeader;
</span><span class="cx"> if ($interface->extendedAttributes->{AppleCopyright}) {
</span><span class="lines">@@ -490,7 +494,7 @@
</span><span class="cx">
</span><span class="cx"> return 0 if not NeedsImplementationClass($interface);
</span><span class="cx"> return 1 if !$hasParent or $interface->extendedAttributes->{JSGenerateToNativeObject};
</span><del>- return 1 if $interface->parent && $interface->parent eq "EventTarget";
</del><ins>+ return 1 if $interface->parentType && $interface->parentType->name eq "EventTarget";
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -515,7 +519,7 @@
</span><span class="cx"> return 0 if not NeedsImplementationClass($interface);
</span><span class="cx"> return 0 if $interface->extendedAttributes->{CustomProxyToJSObject};
</span><span class="cx"> return 1 if (!$hasParent or $interface->extendedAttributes->{JSGenerateToJSObject} or $interface->extendedAttributes->{CustomToJSObject});
</span><del>- return 1 if $interface->parent && $interface->parent eq "EventTarget";
</del><ins>+ return 1 if $interface->parentType && $interface->parentType->name eq "EventTarget";
</ins><span class="cx"> return 1 if $interface->extendedAttributes->{Constructor} or $interface->extendedAttributes->{NamedConstructor};
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -535,7 +539,7 @@
</span><span class="cx">
</span><span class="cx"> return $codeGenerator->WK_lcfirst($className) . "Constructor" . $codeGenerator->WK_ucfirst($attribute->signature->name) if $attribute->isStatic;
</span><span class="cx"> return GetJSBuiltinFunctionName($className, $attribute) if IsJSBuiltin($interface, $attribute);
</span><del>- return "js" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($codeGenerator->IsConstructorType($attribute->signature->idlType) ? "Constructor" : "");
</del><ins>+ return "js" . $interface->type->name . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($codeGenerator->IsConstructorType($attribute->signature->type) ? "Constructor" : "");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetAttributeSetterName
</span><span class="lines">@@ -544,7 +548,7 @@
</span><span class="cx">
</span><span class="cx"> return "set" . $codeGenerator->WK_ucfirst($className) . "Constructor" . $codeGenerator->WK_ucfirst($attribute->signature->name) if $attribute->isStatic;
</span><span class="cx"> return "set" . $codeGenerator->WK_ucfirst(GetJSBuiltinFunctionName($className, $attribute)) if IsJSBuiltin($interface, $attribute);
</span><del>- return "setJS" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($codeGenerator->IsConstructorType($attribute->signature->idlType) ? "Constructor" : "");
</del><ins>+ return "setJS" . $interface->type->name . $codeGenerator->WK_ucfirst($attribute->signature->name) . ($codeGenerator->IsConstructorType($attribute->signature->type) ? "Constructor" : "");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetFunctionName
</span><span class="lines">@@ -571,7 +575,7 @@
</span><span class="cx"> my $specials = $function->signature->specials;
</span><span class="cx"> my $specialExists = grep { $_ eq $special } @$specials;
</span><span class="cx"> my $parameters = $function->parameters;
</span><del>- if ($specialExists and scalar(@$parameters) == $numberOfParameters and $parameters->[0]->idlType->name eq $firstParameterType) {
</del><ins>+ if ($specialExists and scalar(@$parameters) == $numberOfParameters and $parameters->[0]->type->name eq $firstParameterType) {
</ins><span class="cx"> return $function;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -590,7 +594,7 @@
</span><span class="cx"> sub InterfaceRequiresAttributesOnInstance
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> # FIXME: All these return 1 if ... should ideally be removed.
</span><span class="cx"> # Some of them are unavoidable due to DOM weirdness, in which case we should
</span><span class="lines">@@ -600,7 +604,7 @@
</span><span class="cx"> return 1 if $interface->isException;
</span><span class="cx">
</span><span class="cx"> # FIXME: Add support for [PrimaryGlobal] / [Global].
</span><del>- return 1 if IsDOMGlobalObject($interface) && $interface->name ne "WorkerGlobalScope";
</del><ins>+ return 1 if IsDOMGlobalObject($interface) && $interface->type->name ne "WorkerGlobalScope";
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -614,7 +618,7 @@
</span><span class="cx"> return 0 if $attribute->signature->extendedAttributes->{EnabledAtRuntime} && !IsDOMGlobalObject($interface);
</span><span class="cx">
</span><span class="cx"> return 1 if InterfaceRequiresAttributesOnInstance($interface);
</span><del>- return 1 if $codeGenerator->IsConstructorType($attribute->signature->idlType);
</del><ins>+ return 1 if $codeGenerator->IsConstructorType($attribute->signature->type);
</ins><span class="cx">
</span><span class="cx"> # [Unforgeable] attributes should be on the instance.
</span><span class="cx"> # https://heycam.github.io/webidl/#Unforgeable
</span><span class="lines">@@ -636,7 +640,7 @@
</span><span class="cx"> my $function = shift;
</span><span class="cx">
</span><span class="cx"> # FIXME: Add support for [PrimaryGlobal] / [Global].
</span><del>- return 1 if IsDOMGlobalObject($interface) && $interface->name ne "WorkerGlobalScope";
</del><ins>+ return 1 if IsDOMGlobalObject($interface) && $interface->type->name ne "WorkerGlobalScope";
</ins><span class="cx">
</span><span class="cx"> # FIXME: The bindings generator does not support putting runtime-enabled operations on the instance yet (except for global objects).
</span><span class="cx"> return 0 if $function->signature->extendedAttributes->{EnabledAtRuntime};
</span><span class="lines">@@ -656,10 +660,10 @@
</span><span class="cx"> push(@specials, "DontDelete") if IsUnforgeable($interface, $attribute);
</span><span class="cx">
</span><span class="cx"> # As per Web IDL specification, constructor properties on the ECMAScript global object should not be enumerable.
</span><del>- my $is_global_constructor = $attribute->signature->idlType->name =~ /Constructor$/;
- push(@specials, "DontEnum") if ($attribute->signature->extendedAttributes->{NotEnumerable} || $is_global_constructor);
</del><ins>+ my $isGlobalConstructor = $codeGenerator->IsConstructorType($attribute->signature->type);
+ push(@specials, "DontEnum") if ($attribute->signature->extendedAttributes->{NotEnumerable} || $isGlobalConstructor);
</ins><span class="cx"> push(@specials, "ReadOnly") if IsReadonly($attribute);
</span><del>- push(@specials, "CustomAccessor") unless $is_global_constructor or IsJSBuiltin($interface, $attribute);
</del><ins>+ push(@specials, "CustomAccessor") unless $isGlobalConstructor or IsJSBuiltin($interface, $attribute);
</ins><span class="cx"> push(@specials, "DOMJITAttribute") if $attribute->signature->extendedAttributes->{"DOMJIT"};
</span><span class="cx"> push(@specials, "Accessor | Builtin") if IsJSBuiltin($interface, $attribute);
</span><span class="cx"> return (@specials > 0) ? join(" | ", @specials) : "0";
</span><span class="lines">@@ -764,7 +768,7 @@
</span><span class="cx"> my $interface = shift;
</span><span class="cx"> return $interface->extendedAttributes->{JSCustomMarkFunction}
</span><span class="cx"> || $codeGenerator->InheritsInterface($interface, "EventTarget")
</span><del>- || $interface->name eq "EventTarget"
</del><ins>+ || $interface->type->name eq "EventTarget"
</ins><span class="cx"> || $interface->extendedAttributes->{ReportExtraMemoryCost}
</span><span class="cx"> || IsJSBuiltinConstructor($interface)
</span><span class="cx"> }
</span><span class="lines">@@ -782,7 +786,7 @@
</span><span class="cx"> my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interface);
</span><span class="cx"> return $svgNativeType if $svgNativeType;
</span><span class="cx">
</span><del>- return $interface->name;
</del><ins>+ return $interface->type->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub IsClassNameWordBoundary
</span><span class="lines">@@ -1044,23 +1048,23 @@
</span><span class="cx">
</span><span class="cx"> my $defaultValue = $signature->default;
</span><span class="cx">
</span><del>- if ($codeGenerator->IsEnumType($signature->idlType)) {
</del><ins>+ if ($codeGenerator->IsEnumType($signature->type)) {
</ins><span class="cx"> # FIXME: Would be nice to report an error if the value does not have quote marks around it.
</span><span class="cx"> # FIXME: Would be nice to report an error if the value is not one of the enumeration values.
</span><del>- my $className = GetEnumerationClassName($signature->idlType, $interface);
</del><ins>+ my $className = GetEnumerationClassName($signature->type, $interface);
</ins><span class="cx"> my $enumerationValueName = GetEnumerationValueName(substr($defaultValue, 1, -1));
</span><span class="cx"> return $className . "::" . $enumerationValueName;
</span><span class="cx"> }
</span><span class="cx"> if ($defaultValue eq "null") {
</span><del>- if ($signature->idlType->isUnion) {
- return "Nullopt" if $signature->idlType->isNullable;
</del><ins>+ if ($signature->type->isUnion) {
+ return "Nullopt" if $signature->type->isNullable;
</ins><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $signature->idlType);
</del><ins>+ my $IDLType = GetIDLType($interface, $signature->type);
</ins><span class="cx"> return "convert<${IDLType}>(state, jsNull());";
</span><span class="cx"> }
</span><del>- return "jsNull()" if $signature->idlType->name eq "any";
- return "nullptr" if $codeGenerator->IsWrapperType($signature->idlType) || $codeGenerator->IsTypedArrayType($signature->idlType);
- return "String()" if $codeGenerator->IsStringType($signature->idlType);
</del><ins>+ return "jsNull()" if $signature->type->name eq "any";
+ return "nullptr" if $codeGenerator->IsWrapperType($signature->type) || $codeGenerator->IsTypedArrayType($signature->type);
+ return "String()" if $codeGenerator->IsStringType($signature->type);
</ins><span class="cx"> return "Nullopt";
</span><span class="cx"> }
</span><span class="cx"> if ($defaultValue eq "[]") {
</span><span class="lines">@@ -1095,7 +1099,7 @@
</span><span class="cx">
</span><span class="cx"> my $result = "";
</span><span class="cx"> foreach my $dictionary (@$allDictionaries) {
</span><del>- $headerIncludes{$interface->name . ".h"} = 1;
</del><ins>+ $headerIncludes{$interface->type->name . ".h"} = 1;
</ins><span class="cx"> my $className = GetDictionaryClassName($dictionary->type, $interface);
</span><span class="cx"> my $conditionalString = $codeGenerator->GenerateConditionalString($dictionary);
</span><span class="cx"> $result .= GenerateDictionaryHeaderContent($dictionary, $className, $conditionalString);
</span><span class="lines">@@ -1109,7 +1113,7 @@
</span><span class="cx">
</span><span class="cx"> my $result = "";
</span><span class="cx">
</span><del>- my $name = $dictionary->name;
</del><ins>+ my $name = $dictionary->type->name;
</ins><span class="cx">
</span><span class="cx"> $result .= "#if ${conditionalString}\n\n" if $conditionalString;
</span><span class="cx">
</span><span class="lines">@@ -1159,10 +1163,10 @@
</span><span class="cx"> # For each dictionary member member declared on dictionary, in lexicographical order:
</span><span class="cx"> my @sortedMembers = sort { $a->name cmp $b->name } @{$dictionary->members};
</span><span class="cx"> foreach my $member (@sortedMembers) {
</span><del>- $member->default("undefined") if $member->idlType->name eq "any" and !defined($member->default); # Use undefined as default value for member of type 'any' unless specified otherwise.
</del><ins>+ $member->default("undefined") if $member->type->name eq "any" and !defined($member->default); # Use undefined as default value for member of type 'any' unless specified otherwise.
</ins><span class="cx">
</span><del>- my $idlType = $member->idlType;
- AddToImplIncludesForIDLType($idlType);
</del><ins>+ my $type = $member->type;
+ AddToImplIncludesForIDLType($type);
</ins><span class="cx">
</span><span class="cx"> # 5.1. Let key be the identifier of member.
</span><span class="cx"> my $key = $member->name;
</span><span class="lines">@@ -1170,7 +1174,7 @@
</span><span class="cx"> # 5.2. Let value be an ECMAScript value, depending on Type(V):
</span><span class="cx"> $result .= " JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
</span><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $idlType);
</del><ins>+ my $IDLType = GetIDLType($interface, $type);
</ins><span class="cx">
</span><span class="cx"> # 5.3. If value is not undefined, then:
</span><span class="cx"> $result .= " if (!${key}Value.isUndefined()) {\n";
</span><span class="lines">@@ -1185,7 +1189,7 @@
</span><span class="cx"> } elsif (!$member->isOptional) {
</span><span class="cx"> # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
</span><span class="cx"> $result .= " } else {\n";
</span><del>- $result .= " throwRequiredMemberTypeError(state, throwScope, \"".$member->name."\", \"$name\", \"".$idlType->name."\");\n";
</del><ins>+ $result .= " throwRequiredMemberTypeError(state, throwScope, \"". $member->name ."\", \"$name\", \"". $type->name ."\");\n";
</ins><span class="cx"> $result .= " return { };\n";
</span><span class="cx"> $result .= " }\n";
</span><span class="cx"> } else {
</span><span class="lines">@@ -1252,12 +1256,12 @@
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $enumerations, $dictionaries) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx"> my %structureFlags = ();
</span><span class="cx">
</span><span class="cx"> my $hasLegacyParent = $interface->extendedAttributes->{JSLegacyParent};
</span><del>- my $hasRealParent = $interface->parent;
</del><ins>+ my $hasRealParent = $interface->parentType;
</ins><span class="cx"> my $hasParent = $hasLegacyParent || $hasRealParent;
</span><span class="cx"> my $parentClassName = GetParentClassName($interface);
</span><span class="cx"> my $needsVisitChildren = InstanceNeedsVisitChildren($interface);
</span><span class="lines">@@ -1311,7 +1315,7 @@
</span><span class="cx"> # Static create methods
</span><span class="cx"> push(@headerContent, "public:\n");
</span><span class="cx"> push(@headerContent, " using Base = $parentClassName;\n");
</span><del>- push(@headerContent, " using DOMWrapped = $implType;\n") if $interface->parent;
</del><ins>+ push(@headerContent, " using DOMWrapped = $implType;\n") if $hasRealParent;
</ins><span class="cx">
</span><span class="cx"> if ($interfaceName eq "DOMWindow") {
</span><span class="cx"> push(@headerContent, " static $className* create(JSC::VM& vm, JSC::Structure* structure, Ref<$implType>&& impl, JSDOMWindowShell* windowShell)\n");
</span><span class="lines">@@ -1368,7 +1372,7 @@
</span><span class="cx"> # JSValue to implementation type
</span><span class="cx"> if (ShouldGenerateToWrapped($hasParent, $interface)) {
</span><span class="cx"> my $nativeType = GetNativeType($interface, $interface->type);
</span><del>- if ($interface->name eq "XPathNSResolver") {
</del><ins>+ if ($interface->type->name eq "XPathNSResolver") {
</ins><span class="cx"> push(@headerContent, " static $nativeType toWrapped(JSC::ExecState&, JSC::JSValue);\n");
</span><span class="cx"> } else {
</span><span class="cx"> my $export = "";
</span><span class="lines">@@ -1734,7 +1738,7 @@
</span><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="cx"> next unless $attribute->signature->extendedAttributes->{"DOMJIT"};
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name);
</span><span class="cx"> my $domJITClassName = $className . "DOMJIT";
</span><span class="cx">
</span><span class="lines">@@ -1780,7 +1784,7 @@
</span><span class="cx"> my @ancestors;
</span><span class="cx"> $codeGenerator->ForAllParents($interface, sub {
</span><span class="cx"> my $currentInterface = shift;
</span><del>- push(@ancestors, $currentInterface->name);
</del><ins>+ push(@ancestors, $currentInterface->type->name);
</ins><span class="cx"> }, 0);
</span><span class="cx"> for my $dictionary (@$dictionaries) {
</span><span class="cx"> my $parentType = $dictionary->parentType;
</span><span class="lines">@@ -1801,7 +1805,7 @@
</span><span class="cx"> my ($object, $interface, $isInstance, $hashKeys, $hashSpecials, $hashValue1, $hashValue2, $conditionals, $runtimeEnabledFunctions, $runtimeEnabledAttributes) = @_;
</span><span class="cx">
</span><span class="cx"> # FIXME: These should be functions on $interface.
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx">
</span><span class="cx"> # - Add all properties in a hashtable definition
</span><span class="lines">@@ -1837,7 +1841,7 @@
</span><span class="cx"> push(@$hashSpecials, $special);
</span><span class="cx">
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"DOMJIT"}) {
</span><del>- push(@$hashValue1, "domJITGetterSetterFor" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name));
</del><ins>+ push(@$hashValue1, "domJITGetterSetterFor" . $interface->type->name . $codeGenerator->WK_ucfirst($attribute->signature->name));
</ins><span class="cx"> push(@$hashValue2, "0");
</span><span class="cx"> } else {
</span><span class="cx"> my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="lines">@@ -1903,21 +1907,6 @@
</span><span class="cx"> return $propertyCount;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub IsNullableType
-{
- my $type = shift;
-
- return substr($type, -1) eq "?";
-}
-
-sub StripNullable
-{
- my $type = shift;
-
- chop($type) if IsNullableType($type);
- return $type;
-}
-
</del><span class="cx"> # This computes an effective overload set for a given operation / constructor,
</span><span class="cx"> # which represents the allowable invocations.This set is used as input for
</span><span class="cx"> # the Web IDL overload resolution algorithm.
</span><span class="lines">@@ -1946,7 +1935,7 @@
</span><span class="cx"> my @o;
</span><span class="cx"> my $isVariadic = 0;
</span><span class="cx"> foreach my $parameter (@{$overload->parameters}) {
</span><del>- push(@t, $parameter->idlType);
</del><ins>+ push(@t, $parameter->type);
</ins><span class="cx"> if ($parameter->isOptional) {
</span><span class="cx"> push(@o, "optional");
</span><span class="cx"> } elsif ($parameter->isVariadic) {
</span><span class="lines">@@ -1979,11 +1968,11 @@
</span><span class="cx">
</span><span class="cx"> sub IsIDLTypeDistinguishableWithUnionForOverloadResolution
</span><span class="cx"> {
</span><del>- my ($idlType, $unionSubtypes) = @_;
</del><ins>+ my ($type, $unionSubtypes) = @_;
</ins><span class="cx">
</span><del>- assert("First type should not be a union") if $idlType->isUnion;
</del><ins>+ assert("First type should not be a union") if $type->isUnion;
</ins><span class="cx"> for my $unionSubType (@$unionSubtypes) {
</span><del>- return 0 unless AreTypesDistinguishableForOverloadResolution($idlType, $unionSubType);
</del><ins>+ return 0 unless AreTypesDistinguishableForOverloadResolution($type, $unionSubType);
</ins><span class="cx"> }
</span><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -1993,7 +1982,7 @@
</span><span class="cx"> # http://heycam.github.io/webidl/#dfn-distinguishable
</span><span class="cx"> sub AreTypesDistinguishableForOverloadResolution
</span><span class="cx"> {
</span><del>- my ($idlTypeA, $idlTypeB) = @_;
</del><ins>+ my ($typeA, $typeB) = @_;
</ins><span class="cx">
</span><span class="cx"> my $isDictionary = sub {
</span><span class="cx"> my $type = shift;
</span><span class="lines">@@ -2005,33 +1994,33 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> # Two types are distinguishable for overload resolution if at most one of the two includes a nullable type.
</span><del>- return 0 if $idlTypeA->isNullable && $idlTypeB->isNullable;
</del><ins>+ return 0 if $typeA->isNullable && $typeB->isNullable;
</ins><span class="cx">
</span><del>- # Union types: idlTypeA and idlTypeB are distinguishable if:
</del><ins>+ # Union types: typeA and typeB are distinguishable if:
</ins><span class="cx"> # - Both types are either a union type or nullable union type, and each member type of the one is
</span><span class="cx"> # distinguishable with each member type of the other.
</span><span class="cx"> # - One type is a union type or nullable union type, the other is neither a union type nor a nullable
</span><span class="cx"> # union type, and each member type of the first is distinguishable with the second.
</span><del>- if ($idlTypeA->isUnion && $idlTypeB->isUnion) {
- for my $unionASubType (@{$idlTypeA->subtypes}) {
- return 0 unless IsIDLTypeDistinguishableWithUnionForOverloadResolution($unionASubType, $idlTypeB->subtypes);
</del><ins>+ if ($typeA->isUnion && $typeB->isUnion) {
+ for my $unionASubType (@{$typeA->subtypes}) {
+ return 0 unless IsIDLTypeDistinguishableWithUnionForOverloadResolution($unionASubType, $typeB->subtypes);
</ins><span class="cx"> }
</span><span class="cx"> return 1;
</span><del>- } elsif ($idlTypeA->isUnion) {
- return IsIDLTypeDistinguishableWithUnionForOverloadResolution($idlTypeB, $idlTypeA->subtypes);
- } elsif ($idlTypeB->isUnion) {
- return IsIDLTypeDistinguishableWithUnionForOverloadResolution($idlTypeA, $idlTypeB->subtypes);
</del><ins>+ } elsif ($typeA->isUnion) {
+ return IsIDLTypeDistinguishableWithUnionForOverloadResolution($typeB, $typeA->subtypes);
+ } elsif ($typeB->isUnion) {
+ return IsIDLTypeDistinguishableWithUnionForOverloadResolution($typeA, $typeB->subtypes);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return 0 if $idlTypeA->name eq $idlTypeB->name;
- return 0 if $idlTypeA->name eq "object" or $idlTypeB->name eq "object";
- return 0 if $codeGenerator->IsNumericType($idlTypeA) && $codeGenerator->IsNumericType($idlTypeB);
- return 0 if $codeGenerator->IsStringOrEnumType($idlTypeA) && $codeGenerator->IsStringOrEnumType($idlTypeB);
- return 0 if &$isDictionary($idlTypeA) && &$isDictionary($idlTypeB);
- return 0 if $codeGenerator->IsCallbackInterface($idlTypeA) && $codeGenerator->IsCallbackInterface($idlTypeB);
- return 0 if &$isCallbackFunctionOrDictionary($idlTypeA) && &$isCallbackFunctionOrDictionary($idlTypeB);
- return 0 if $codeGenerator->IsSequenceOrFrozenArrayType($idlTypeA) && $codeGenerator->IsSequenceOrFrozenArrayType($idlTypeB);
- # FIXME: return 0 if $idlTypeA and $idlTypeB are both exception types.
</del><ins>+ return 0 if $typeA->name eq $typeB->name;
+ return 0 if $typeA->name eq "object" or $typeB->name eq "object";
+ return 0 if $codeGenerator->IsNumericType($typeA) && $codeGenerator->IsNumericType($typeB);
+ return 0 if $codeGenerator->IsStringOrEnumType($typeA) && $codeGenerator->IsStringOrEnumType($typeB);
+ return 0 if &$isDictionary($typeA) && &$isDictionary($typeB);
+ return 0 if $codeGenerator->IsCallbackInterface($typeA) && $codeGenerator->IsCallbackInterface($typeB);
+ return 0 if &$isCallbackFunctionOrDictionary($typeA) && &$isCallbackFunctionOrDictionary($typeB);
+ return 0 if $codeGenerator->IsSequenceOrFrozenArrayType($typeA) && $codeGenerator->IsSequenceOrFrozenArrayType($typeB);
+ # FIXME: return 0 if $typeA and $typeB are both exception types.
</ins><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2044,12 +2033,12 @@
</span><span class="cx"> my ($function, $S) = @_;
</span><span class="cx">
</span><span class="cx"> # FIXME: Consider all the tuples, not just the 2 first ones?
</span><del>- my $firstTupleIDLTypes = @{@{$S}[0]}[1];
- my $secondTupleIDLTypes = @{@{$S}[1]}[1];
- for (my $index = 0; $index < scalar(@$firstTupleIDLTypes); $index++) {
- return $index if AreTypesDistinguishableForOverloadResolution(@{$firstTupleIDLTypes}[$index], @{$secondTupleIDLTypes}[$index]);
</del><ins>+ my $firstTupleTypes = @{@{$S}[0]}[1];
+ my $secondTupleTypes = @{@{$S}[1]}[1];
+ for (my $index = 0; $index < scalar(@$firstTupleTypes); $index++) {
+ return $index if AreTypesDistinguishableForOverloadResolution(@{$firstTupleTypes}[$index], @{$secondTupleTypes}[$index]);
</ins><span class="cx"> }
</span><del>- die "Undistinguishable overloads for operation " . $function->signature->name . " with length: " . scalar(@$firstTupleIDLTypes);
</del><ins>+ die "Undistinguishable overloads for operation " . $function->signature->name . " with length: " . scalar(@$firstTupleTypes);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetOverloadThatMatches
</span><span class="lines">@@ -2057,14 +2046,14 @@
</span><span class="cx"> my ($S, $parameterIndex, $matches) = @_;
</span><span class="cx">
</span><span class="cx"> for my $tuple (@{$S}) {
</span><del>- my $idlType = @{@{$tuple}[1]}[$parameterIndex];
</del><ins>+ my $type = @{@{$tuple}[1]}[$parameterIndex];
</ins><span class="cx"> my $optionality = @{@{$tuple}[2]}[$parameterIndex];
</span><del>- if ($idlType->isUnion) {
- for my $idlSubtype (GetFlattenedMemberTypes($idlType)) {
- return @{$tuple}[0] if $matches->($idlSubtype, $optionality);
</del><ins>+ if ($type->isUnion) {
+ for my $subtype (GetFlattenedMemberTypes($type)) {
+ return @{$tuple}[0] if $matches->($subtype, $optionality);
</ins><span class="cx"> }
</span><span class="cx"> } else {
</span><del>- return @{$tuple}[0] if $matches->($idlType, $optionality);
</del><ins>+ return @{$tuple}[0] if $matches->($type, $optionality);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2074,9 +2063,9 @@
</span><span class="cx"> my ($S, $parameterIndex, $matches) = @_;
</span><span class="cx">
</span><span class="cx"> for my $tuple (@{$S}) {
</span><del>- my $idlType = @{@{$tuple}[1]}[$parameterIndex];
</del><ins>+ my $type = @{@{$tuple}[1]}[$parameterIndex];
</ins><span class="cx"> my $optionality = @{@{$tuple}[2]}[$parameterIndex];
</span><del>- return @{$tuple}[0] if $matches->($idlType, $optionality);
</del><ins>+ return @{$tuple}[0] if $matches->($type, $optionality);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2102,7 +2091,7 @@
</span><span class="cx"> my ($function, $interface, $isConstructor) = @_;
</span><span class="cx"> my %allSets = ComputeEffectiveOverloadSet($function->{overloads});
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx"> my $functionName;
</span><span class="cx"> if ($isConstructor) {
</span><span class="lines">@@ -2122,68 +2111,68 @@
</span><span class="cx"> push(@implContent, "#endif\n") if $conditionalString;
</span><span class="cx"> };
</span><span class="cx"> my $isOptionalParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
</del><ins>+ my ($type, $optionality) = @_;
</ins><span class="cx"> return $optionality eq "optional";
</span><span class="cx"> };
</span><span class="cx"> my $isDictionaryParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "Dictionary" || $codeGenerator->IsDictionaryType($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "Dictionary" || $codeGenerator->IsDictionaryType($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isNullableOrDictionaryParameterOrUnionContainingOne = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return 1 if $idlType->isNullable;
- if ($idlType->isUnion) {
- for my $idlSubtype (GetFlattenedMemberTypes($idlType)) {
- return 1 if $idlType->isNullable || &$isDictionaryParameter($idlSubtype, $optionality);
</del><ins>+ my ($type, $optionality) = @_;
+ return 1 if $type->isNullable;
+ if ($type->isUnion) {
+ for my $subtype (GetFlattenedMemberTypes($type)) {
+ return 1 if $type->isNullable || &$isDictionaryParameter($subtype, $optionality);
</ins><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="cx"> } else {
</span><del>- return &$isDictionaryParameter($idlType, $optionality);
</del><ins>+ return &$isDictionaryParameter($type, $optionality);
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx"> my $isRegExpOrObjectParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "RegExp" || $idlType->name eq "object";
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "RegExp" || $type->name eq "object";
</ins><span class="cx"> };
</span><span class="cx"> my $isObjectOrErrorParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "object" || $idlType->name eq "Error";
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "object" || $type->name eq "Error";
</ins><span class="cx"> };
</span><span class="cx"> my $isObjectOrErrorOrDOMExceptionParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return 1 if &$isObjectOrErrorParameter($idlType, $optionality);
- return $idlType->name eq "DOMException";
</del><ins>+ my ($type, $optionality) = @_;
+ return 1 if &$isObjectOrErrorParameter($type, $optionality);
+ return $type->name eq "DOMException";
</ins><span class="cx"> };
</span><span class="cx"> my $isObjectOrCallbackFunctionParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "object" || $codeGenerator->IsFunctionOnlyCallbackInterface($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "object" || $codeGenerator->IsFunctionOnlyCallbackInterface($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isSequenceOrFrozenArrayParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $codeGenerator->IsSequenceOrFrozenArrayType($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return $codeGenerator->IsSequenceOrFrozenArrayType($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isDictionaryOrObjectOrCallbackInterfaceParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return 1 if &$isDictionaryParameter($idlType, $optionality);
- return 1 if $idlType->name eq "object";
- return 1 if $codeGenerator->IsCallbackInterface($idlType) && !$codeGenerator->IsFunctionOnlyCallbackInterface($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return 1 if &$isDictionaryParameter($type, $optionality);
+ return 1 if $type->name eq "object";
+ return 1 if $codeGenerator->IsCallbackInterface($type) && !$codeGenerator->IsFunctionOnlyCallbackInterface($type);
</ins><span class="cx"> return 0;
</span><span class="cx"> };
</span><span class="cx"> my $isBooleanParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "boolean";
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "boolean";
</ins><span class="cx"> };
</span><span class="cx"> my $isNumericParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $codeGenerator->IsNumericType($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return $codeGenerator->IsNumericType($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isStringOrEnumParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $codeGenerator->IsStringOrEnumType($idlType);
</del><ins>+ my ($type, $optionality) = @_;
+ return $codeGenerator->IsStringOrEnumType($type);
</ins><span class="cx"> };
</span><span class="cx"> my $isAnyParameter = sub {
</span><del>- my ($idlType, $optionality) = @_;
- return $idlType->name eq "any";
</del><ins>+ my ($type, $optionality) = @_;
+ return $type->name eq "any";
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> my $maxArgCount = LengthOfLongestFunctionParameterList($function->{overloads});
</span><span class="lines">@@ -2221,16 +2210,16 @@
</span><span class="cx">
</span><span class="cx"> for my $tuple (@{$S}) {
</span><span class="cx"> my $overload = @{$tuple}[0];
</span><del>- my $idlType = @{@{$tuple}[1]}[$d];
</del><ins>+ my $type = @{@{$tuple}[1]}[$d];
</ins><span class="cx">
</span><del>- my @idlSubtypes = $idlType->isUnion ? GetFlattenedMemberTypes($idlType) : ( $idlType );
- for my $idlSubtype (@idlSubtypes) {
- if ($codeGenerator->IsWrapperType($idlSubtype) || $codeGenerator->IsTypedArrayType($idlSubtype)) {
- if ($idlSubtype->name eq "DOMWindow") {
</del><ins>+ my @subtypes = $type->isUnion ? GetFlattenedMemberTypes($type) : ( $type );
+ for my $subtype (@subtypes) {
+ if ($codeGenerator->IsWrapperType($subtype) || $codeGenerator->IsTypedArrayType($subtype)) {
+ if ($subtype->name eq "DOMWindow") {
</ins><span class="cx"> AddToImplIncludes("JSDOMWindowShell.h");
</span><span class="cx"> &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits(JSDOMWindowShell::info()) || asObject(distinguishingArg)->inherits(JSDOMWindow::info()))");
</span><span class="cx"> } else {
</span><del>- &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JS" . $idlSubtype->name . "::info())");
</del><ins>+ &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->inherits(JS" . $subtype->name . "::info())");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2332,8 +2321,8 @@
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
- $interfaceName = $codeGenerator->GetSVGTypeNeedingTearOffForType($interface->type) if $codeGenerator->IsSVGTypeNeedingTearOffForType($interface->type);
</del><ins>+ my $interfaceName = $interface->type->name;
+ $interfaceName = $codeGenerator->GetSVGTypeNeedingTearOff($interface->type) if $codeGenerator->IsSVGTypeNeedingTearOff($interface->type);
</ins><span class="cx"> return $interfaceName;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2484,7 +2473,7 @@
</span><span class="cx"> sub GetCastingHelperForThisObject
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> return "jsNodeCast" if $interfaceName eq "Node";
</span><span class="cx"> return "jsElementCast" if $interfaceName eq "Element";
</span><span class="lines">@@ -2499,7 +2488,7 @@
</span><span class="cx"> my $indexedGetterFunction = shift;
</span><span class="cx">
</span><span class="cx"> # FIXME: Should this work for all string types?
</span><del>- return "jsStringOrUndefined(state, thisObject->wrapped().item(index))" if $indexedGetterFunction->signature->idlType->name eq "DOMString";
</del><ins>+ return "jsStringOrUndefined(state, thisObject->wrapped().item(index))" if $indexedGetterFunction->signature->type->name eq "DOMString";
</ins><span class="cx"> return "toJS(state, thisObject->globalObject(), thisObject->wrapped().item(index))";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2525,8 +2514,9 @@
</span><span class="cx"> sub GetResultTypeFilter
</span><span class="cx"> {
</span><span class="cx"> my ($signature) = @_;
</span><del>- my $idlType = $signature->idlType;
</del><span class="cx">
</span><ins>+ my $type = $signature->type;
+
</ins><span class="cx"> my %TypeFilters = (
</span><span class="cx"> "any" => "SpecHeapTop",
</span><span class="cx"> "boolean" => "SpecBoolean",
</span><span class="lines">@@ -2547,10 +2537,10 @@
</span><span class="cx"> "USVString" => "SpecString",
</span><span class="cx"> );
</span><span class="cx">
</span><del>- if (exists $TypeFilters{$idlType->name}) {
- my $resultType = "JSC::$TypeFilters{$idlType->name}";
- if ($idlType->isNullable) {
- die "\"any\" type must not become nullable." if $idlType->name eq "any";
</del><ins>+ if (exists $TypeFilters{$type->name}) {
+ my $resultType = "JSC::$TypeFilters{$type->name}";
+ if ($type->isNullable) {
+ die "\"any\" type must not become nullable." if $type->name eq "any";
</ins><span class="cx"> $resultType = "($resultType | JSC::SpecOther)";
</span><span class="cx"> }
</span><span class="cx"> return $resultType;
</span><span class="lines">@@ -2562,15 +2552,15 @@
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $enumerations, $dictionaries) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx">
</span><span class="cx"> my $hasLegacyParent = $interface->extendedAttributes->{JSLegacyParent};
</span><del>- my $hasRealParent = $interface->parent;
</del><ins>+ my $hasRealParent = $interface->parentType;
</ins><span class="cx"> my $hasParent = $hasLegacyParent || $hasRealParent;
</span><span class="cx"> my $parentClassName = GetParentClassName($interface);
</span><span class="cx"> my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
</span><del>- my $eventTarget = $codeGenerator->InheritsInterface($interface, "EventTarget") && $interface->name ne "EventTarget";
</del><ins>+ my $eventTarget = $codeGenerator->InheritsInterface($interface, "EventTarget") && $interface->type->name ne "EventTarget";
</ins><span class="cx"> my $needsVisitChildren = InstanceNeedsVisitChildren($interface);
</span><span class="cx">
</span><span class="cx"> my $namedGetterFunction = GetNamedGetterFunction($interface);
</span><span class="lines">@@ -2728,7 +2718,7 @@
</span><span class="cx"> push(@hashSpecials, $special);
</span><span class="cx">
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"DOMJIT"}) {
</span><del>- push(@hashValue1, "domJITGetterSetterFor" . $interface->name . $codeGenerator->WK_ucfirst($attribute->signature->name));
</del><ins>+ push(@hashValue1, "domJITGetterSetterFor" . $interface->type->name . $codeGenerator->WK_ucfirst($attribute->signature->name));
</ins><span class="cx"> push(@hashValue2, "0");
</span><span class="cx"> } else {
</span><span class="cx"> my $getter = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="lines">@@ -2991,8 +2981,8 @@
</span><span class="cx"> unless (ShouldUseGlobalObjectPrototype($interface)) {
</span><span class="cx"> push(@implContent, "JSObject* ${className}::createPrototype(VM& vm, JSGlobalObject* globalObject)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><del>- if ($interface->parent) {
- my $parentClassNameForPrototype = "JS" . $interface->parent;
</del><ins>+ if ($interface->parentType) {
+ my $parentClassNameForPrototype = "JS" . $interface->parentType->name;
</ins><span class="cx"> push(@implContent, " return ${className}Prototype::create(vm, globalObject, ${className}Prototype::createStructure(vm, globalObject, ${parentClassNameForPrototype}::prototype(vm, globalObject)));\n");
</span><span class="cx"> } else {
</span><span class="cx"> my $prototype = $interface->isException ? "errorPrototype" : "objectPrototype";
</span><span class="lines">@@ -3048,7 +3038,7 @@
</span><span class="cx">
</span><span class="cx"> if ($indexedGetterFunction) {
</span><span class="cx"> # FIXME: Should this work for all string types?
</span><del>- if ($indexedGetterFunction->signature->idlType->name eq "DOMString") {
</del><ins>+ if ($indexedGetterFunction->signature->type->name eq "DOMString") {
</ins><span class="cx"> push(@implContent, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " if (LIKELY(index < thisObject->wrapped().length())) {\n");
</span><span class="lines">@@ -3127,7 +3117,7 @@
</span><span class="cx"> next if IsJSBuiltin($interface, $attribute);
</span><span class="cx">
</span><span class="cx"> my $name = $attribute->signature->name;
</span><del>- my $idlType = $attribute->signature->idlType;
</del><ins>+ my $type = $attribute->signature->type;
</ins><span class="cx"> my $getFunctionName = GetAttributeGetterName($interface, $className, $attribute);
</span><span class="cx"> my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{ImplementedAs} || $name);
</span><span class="cx"> my $getterMayThrowLegacyException = $attribute->signature->extendedAttributes->{GetterMayThrowLegacyException};
</span><span class="lines">@@ -3137,7 +3127,7 @@
</span><span class="cx"> my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
</span><span class="cx"> push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
</span><span class="cx">
</span><del>- if (!$attribute->isStatic || $codeGenerator->IsConstructorType($idlType)) {
</del><ins>+ if (!$attribute->isStatic || $codeGenerator->IsConstructorType($type)) {
</ins><span class="cx"> my $templateParameters = "${getFunctionName}Getter";
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{LenientThis}) {
</span><span class="cx"> $templateParameters .= ", CastedThisErrorBehavior::ReturnEarly";
</span><span class="lines">@@ -3176,7 +3166,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Global constructors can be disabled at runtime.
</span><del>- if ($codeGenerator->IsConstructorType($idlType)) {
</del><ins>+ if ($codeGenerator->IsConstructorType($type)) {
</ins><span class="cx"> if ($attribute->signature->extendedAttributes->{EnabledBySetting}) {
</span><span class="cx"> AddToImplIncludes("Frame.h");
</span><span class="cx"> AddToImplIncludes("Settings.h");
</span><span class="lines">@@ -3211,8 +3201,8 @@
</span><span class="cx"> push(@implContent, " JSGlobalObject* globalObject = state.lexicalGlobalObject();\n");
</span><span class="cx"> push(@implContent, " InputCursor& cursor = globalObject->inputCursor();\n");
</span><span class="cx">
</span><del>- my $nativeType = GetNativeType($interface, $idlType);
- my $memoizedType = GetNativeTypeForMemoization($interface, $idlType);
</del><ins>+ my $nativeType = GetNativeType($interface, $type);
+ my $memoizedType = GetNativeTypeForMemoization($interface, $type);
</ins><span class="cx"> my $exceptionCode = $getterMayThrowLegacyException ? "ec" : "0";
</span><span class="cx"> push(@implContent, " static NeverDestroyed<const AtomicString> bindingName(\"$interfaceName.$name\", AtomicString::ConstructFromLiteral);\n");
</span><span class="cx"> push(@implContent, " if (cursor.isCapturing()) {\n");
</span><span class="lines">@@ -3242,7 +3232,7 @@
</span><span class="cx"> $implIncludes{"JSDOMBinding.h"} = 1;
</span><span class="cx"> push(@implContent, " auto& impl = thisObject.wrapped();\n");
</span><span class="cx"> push(@implContent, " return shouldAllowAccessToNode(&state, impl." . $attribute->signature->name . "()) ? " . NativeToJSValueUsingReferences($attribute->signature, 0, $interface, "impl.$implGetterFunctionName()", "thisObject") . " : jsNull();\n");
</span><del>- } elsif ($idlType->name eq "EventHandler") {
</del><ins>+ } elsif ($type->name eq "EventHandler") {
</ins><span class="cx"> $implIncludes{"EventNames.h"} = 1;
</span><span class="cx"> my $getter = $attribute->signature->extendedAttributes->{WindowEventHandler} ? "windowEventHandlerAttribute"
</span><span class="cx"> : $attribute->signature->extendedAttributes->{DocumentEventHandler} ? "documentEventHandlerAttribute"
</span><span class="lines">@@ -3249,8 +3239,8 @@
</span><span class="cx"> : "eventHandlerAttribute";
</span><span class="cx"> my $eventName = EventHandlerAttributeEventName($attribute);
</span><span class="cx"> push(@implContent, " return $getter(thisObject.wrapped(), $eventName);\n");
</span><del>- } elsif ($codeGenerator->IsConstructorType($attribute->signature->idlType)) {
- my $constructorType = $attribute->signature->idlType->name;
</del><ins>+ } elsif ($codeGenerator->IsConstructorType($attribute->signature->type)) {
+ my $constructorType = $attribute->signature->type->name;
</ins><span class="cx"> $constructorType =~ s/Constructor$//;
</span><span class="cx"> # When Constructor attribute is used by DOMWindow.idl, it's correct to pass thisObject as the global object
</span><span class="cx"> # When JSDOMWrappers have a back-pointer to the globalObject we can pass thisObject->globalObject()
</span><span class="lines">@@ -3299,7 +3289,7 @@
</span><span class="cx"> unshift(@arguments, @callWithArgs);
</span><span class="cx"> my $jsType = NativeToJSValueUsingReferences($attribute->signature, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject");
</span><span class="cx"> push(@implContent, " auto& impl = thisObject.wrapped();\n") if !$attribute->isStatic;
</span><del>- if ($codeGenerator->IsSVGAnimatedType($idlType)) {
</del><ins>+ if ($codeGenerator->IsSVGAnimatedType($type)) {
</ins><span class="cx"> push(@implContent, " auto obj = $jsType;\n");
</span><span class="cx"> push(@implContent, " JSValue result = toJS(&state, thisObject.globalObject(), obj.get());\n");
</span><span class="cx"> } else {
</span><span class="lines">@@ -3330,7 +3320,7 @@
</span><span class="cx">
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"DOMJIT"}) {
</span><span class="cx"> $implIncludes{"<wtf/NeverDestroyed.h>"} = 1;
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $attributeName = $attribute->signature->name;
</span><span class="cx"> my $generatorName = $interfaceName . $codeGenerator->WK_ucfirst($attribute->signature->name);
</span><span class="cx"> my $domJITClassName = $generatorName . "DOMJIT";
</span><span class="lines">@@ -3447,7 +3437,7 @@
</span><span class="cx"> next if IsJSBuiltin($interface, $attribute);
</span><span class="cx">
</span><span class="cx"> my $name = $attribute->signature->name;
</span><del>- my $idlType = $attribute->signature->idlType;
</del><ins>+ my $type = $attribute->signature->type;
</ins><span class="cx"> my $putFunctionName = GetAttributeSetterName($interface, $className, $attribute);
</span><span class="cx"> my $implSetterFunctionName = $codeGenerator->WK_ucfirst($name);
</span><span class="cx"> my $setterMayThrowLegacyException = $attribute->signature->extendedAttributes->{SetterMayThrowLegacyException};
</span><span class="lines">@@ -3501,7 +3491,7 @@
</span><span class="cx"> if (HasCustomSetter($attribute->signature->extendedAttributes)) {
</span><span class="cx"> push(@implContent, " thisObject.set$implSetterFunctionName(state, value);\n");
</span><span class="cx"> push(@implContent, " return true;\n");
</span><del>- } elsif ($idlType->name eq "EventHandler") {
</del><ins>+ } elsif ($type->name eq "EventHandler") {
</ins><span class="cx"> $implIncludes{"JSEventListener.h"} = 1;
</span><span class="cx"> my $eventName = EventHandlerAttributeEventName($attribute);
</span><span class="cx"> # FIXME: Find a way to do this special case without hardcoding the class and attribute names here.
</span><span class="lines">@@ -3516,8 +3506,8 @@
</span><span class="cx"> push(@implContent, " $setter(state, thisObject, thisObject.wrapped(), $eventName, value);\n");
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, " return true;\n");
</span><del>- } elsif ($codeGenerator->IsConstructorType($idlType)) {
- my $constructorType = $idlType->name;
</del><ins>+ } elsif ($codeGenerator->IsConstructorType($type)) {
+ my $constructorType = $type->name;
</ins><span class="cx"> $constructorType =~ s/Constructor$//;
</span><span class="cx"> # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
</span><span class="cx"> # We do not generate the header file for NamedConstructor of class XXXX,
</span><span class="lines">@@ -3539,7 +3529,7 @@
</span><span class="cx"> my $putForwards = $attribute->signature->extendedAttributes->{PutForwards};
</span><span class="cx"> if ($putForwards) {
</span><span class="cx"> my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{ImplementedAs} || $name);
</span><del>- my $forwardedAttribute = $codeGenerator->GetAttributeFromInterface($interface, $idlType->name, $putForwards);
</del><ins>+ my $forwardedAttribute = $codeGenerator->GetAttributeFromInterface($interface, $type->name, $putForwards);
</ins><span class="cx">
</span><span class="cx"> if ($forwardedAttribute->signature->extendedAttributes->{CEReactions}) {
</span><span class="cx"> push(@implContent, "#if ENABLE(CUSTOM_ELEMENTS)\n");
</span><span class="lines">@@ -3548,19 +3538,18 @@
</span><span class="cx"> $implIncludes{"CustomElementReactionQueue.h"} = 1;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $typeName = $idlType->name;
- if ($attribute->signature->isNullable) {
- push(@implContent, " RefPtr<${typeName}> forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n");
</del><ins>+ if ($type->isNullable) {
+ push(@implContent, " RefPtr<" . $type->name . "> forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n");
</ins><span class="cx"> push(@implContent, " if (!forwardedImpl)\n");
</span><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> push(@implContent, " auto& impl = *forwardedImpl;\n");
</span><span class="cx"> } else {
</span><span class="cx"> # Attribute is not nullable, the implementation is expected to return a reference.
</span><del>- push(@implContent, " Ref<${typeName}> forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n");
</del><ins>+ push(@implContent, " Ref<" . $type->name . "> forwardedImpl = thisObject.wrapped().${implGetterFunctionName}();\n");
</ins><span class="cx"> push(@implContent, " auto& impl = forwardedImpl.get();\n");
</span><span class="cx"> }
</span><span class="cx"> $attribute = $forwardedAttribute;
</span><del>- $idlType = $attribute->signature->idlType;
</del><ins>+ $type = $attribute->signature->type;
</ins><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " auto& impl = thisObject.wrapped();\n");
</span><span class="cx"> }
</span><span class="lines">@@ -3571,7 +3560,7 @@
</span><span class="cx"> my $shouldPassByReference = ShouldPassWrapperByReference($attribute->signature, $interface);
</span><span class="cx">
</span><span class="cx"> my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute->signature, "value", $attribute->signature->extendedAttributes->{Conditional}, "&state", "state", "thisObject");
</span><del>- if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($idlType) || $codeGenerator->IsTypedArrayType($idlType))) {
</del><ins>+ if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type))) {
</ins><span class="cx"> $implIncludes{"<runtime/Error.h>"} = 1;
</span><span class="cx"> push(@implContent, " " . GetNativeTypeFromSignature($interface, $attribute->signature) . " nativeValue = nullptr;\n");
</span><span class="cx"> push(@implContent, " if (!value.isUndefinedOrNull()) {\n");
</span><span class="lines">@@ -3578,7 +3567,7 @@
</span><span class="cx"> push(@implContent, " nativeValue = $nativeValue;\n");
</span><span class="cx"> push(@implContent, " RETURN_IF_EXCEPTION(throwScope, false);\n") if $mayThrowException;
</span><span class="cx"> push(@implContent, " if (UNLIKELY(!nativeValue)) {\n");
</span><del>- push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $idlType->name . "\");\n");
</del><ins>+ push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $type->name . "\");\n");
</ins><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="lines">@@ -3587,7 +3576,7 @@
</span><span class="cx"> push(@implContent, " RETURN_IF_EXCEPTION(throwScope, false);\n") if $mayThrowException;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsEnumType($idlType)) {
</del><ins>+ if ($codeGenerator->IsEnumType($type)) {
</ins><span class="cx"> push (@implContent, " if (UNLIKELY(!nativeValue))\n");
</span><span class="cx"> push (@implContent, " return false;\n");
</span><span class="cx"> }
</span><span class="lines">@@ -3594,7 +3583,7 @@
</span><span class="cx">
</span><span class="cx"> if ($shouldPassByReference) {
</span><span class="cx"> push(@implContent, " if (UNLIKELY(!nativeValue)) {\n");
</span><del>- push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $idlType->name . "\");\n");
</del><ins>+ push(@implContent, " throwAttributeTypeError(state, throwScope, \"$visibleInterfaceName\", \"$name\", \"" . $type->name . "\");\n");
</ins><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="cx"> }
</span><span class="lines">@@ -3630,9 +3619,9 @@
</span><span class="cx"> } else {
</span><span class="cx"> my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><span class="cx">
</span><del>- if ($codeGenerator->IsTypedArrayType($idlType) and not $idlType->name eq "ArrayBuffer") {
</del><ins>+ if ($codeGenerator->IsTypedArrayType($type) and not $type->name eq "ArrayBuffer") {
</ins><span class="cx"> push(@arguments, "nativeValue.get()");
</span><del>- } elsif ($codeGenerator->IsEnumType($idlType)) {
</del><ins>+ } elsif ($codeGenerator->IsEnumType($type)) {
</ins><span class="cx"> push(@arguments, "nativeValue.value()");
</span><span class="cx"> } else {
</span><span class="cx"> push(@arguments, $shouldPassByReference ? "*nativeValue" : "WTFMove(nativeValue)");
</span><span class="lines">@@ -3721,7 +3710,7 @@
</span><span class="cx">
</span><span class="cx"> next if $isCustom && $isOverloaded && $function->{overloadIndex} > 1;
</span><span class="cx">
</span><del>- AddToImplIncludesForIDLType($function->signature->idlType) unless $isCustom or IsReturningPromise($function);
</del><ins>+ AddToImplIncludesForIDLType($function->signature->type) unless $isCustom or IsReturningPromise($function);
</ins><span class="cx">
</span><span class="cx"> my $functionName = GetFunctionName($interface, $className, $function);
</span><span class="cx">
</span><span class="lines">@@ -3920,7 +3909,7 @@
</span><span class="cx">
</span><span class="cx"> if ($indexedGetterFunction) {
</span><span class="cx"> # FIXME: Should this work for all string types.
</span><del>- $implIncludes{"URL.h"} = 1 if $indexedGetterFunction->signature->idlType->name eq "DOMString";
</del><ins>+ $implIncludes{"URL.h"} = 1 if $indexedGetterFunction->signature->type->name eq "DOMString";
</ins><span class="cx"> if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") {
</span><span class="cx"> $implIncludes{"JSNode.h"} = 1;
</span><span class="cx"> $implIncludes{"Node.h"} = 1;
</span><span class="lines">@@ -4100,7 +4089,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $className) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> my $serializerFunctionName = "toJSON";
</span><span class="cx"> my $serializerNativeFunctionName = $codeGenerator->WK_lcfirst($className) . "PrototypeFunction" . $codeGenerator->WK_ucfirst($serializerFunctionName);
</span><span class="lines">@@ -4286,7 +4275,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($outputArray, $function, $interface, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
</span><span class="cx"> my @arguments;
</span><span class="cx"> my $functionName;
</span><span class="lines">@@ -4319,40 +4308,40 @@
</span><span class="cx">
</span><span class="cx"> my $argumentIndex = 0;
</span><span class="cx"> foreach my $parameter (@{$function->parameters}) {
</span><del>- my $idlType = $parameter->idlType;
</del><ins>+ my $type = $parameter->type;
</ins><span class="cx">
</span><del>- die "Optional parameters of non-nullable wrapper types are not supported" if $parameter->isOptional && !$parameter->isNullable && $codeGenerator->IsWrapperType($idlType);
</del><ins>+ die "Optional parameters of non-nullable wrapper types are not supported" if $parameter->isOptional && !$type->isNullable && $codeGenerator->IsWrapperType($type);
</ins><span class="cx"> die "Optional parameters preceding variadic parameters are not supported" if ($parameter->isOptional && @{$function->parameters}[$numParameters - 1]->isVariadic);
</span><span class="cx">
</span><span class="cx"> if ($parameter->isOptional && !defined($parameter->default)) {
</span><span class="cx"> # As per Web IDL, optional dictionary parameters are always considered to have a default value of an empty dictionary, unless otherwise specified.
</span><del>- $parameter->default("[]") if $idlType->name eq "Dictionary" or $codeGenerator->IsDictionaryType($idlType);
</del><ins>+ $parameter->default("[]") if $type->name eq "Dictionary" or $codeGenerator->IsDictionaryType($type);
</ins><span class="cx">
</span><span class="cx"> # We use undefined as default value for optional parameters of type 'any' unless specified otherwise.
</span><del>- $parameter->default("undefined") if $idlType->name eq "any";
</del><ins>+ $parameter->default("undefined") if $type->name eq "any";
</ins><span class="cx">
</span><span class="cx"> # We use the null string as default value for parameters of type DOMString unless specified otherwise.
</span><del>- $parameter->default("null") if $codeGenerator->IsStringType($idlType);
</del><ins>+ $parameter->default("null") if $codeGenerator->IsStringType($type);
</ins><span class="cx">
</span><span class="cx"> # As per Web IDL, passing undefined for a nullable parameter is treated as null. Therefore, use null as
</span><span class="cx"> # default value for nullable parameters unless otherwise specified.
</span><del>- $parameter->default("null") if $parameter->isNullable;
</del><ins>+ $parameter->default("null") if $type->isNullable;
</ins><span class="cx">
</span><span class="cx"> # For callback parameters, the generated bindings treat undefined as null, so use null as implicit default value.
</span><del>- $parameter->default("null") if $codeGenerator->IsCallbackInterface($idlType);
</del><ins>+ $parameter->default("null") if $codeGenerator->IsCallbackInterface($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $name = $parameter->name;
</span><span class="cx"> my $value = $name;
</span><span class="cx">
</span><del>- if ($codeGenerator->IsCallbackInterface($idlType)) {
- my $callbackClassName = GetCallbackClassName($idlType->name);
- my $typeName = $idlType->name;
</del><ins>+ if ($codeGenerator->IsCallbackInterface($type)) {
+ my $callbackClassName = GetCallbackClassName($type->name);
+ my $typeName = $type->name;
</ins><span class="cx"> $implIncludes{"$callbackClassName.h"} = 1;
</span><span class="cx"> if ($parameter->isOptional) {
</span><span class="cx"> push(@$outputArray, " RefPtr<$typeName> $name;\n");
</span><span class="cx"> push(@$outputArray, " if (!state->argument($argumentIndex).isUndefinedOrNull()) {\n");
</span><del>- if ($codeGenerator->IsFunctionOnlyCallbackInterface($idlType)) {
</del><ins>+ if ($codeGenerator->IsFunctionOnlyCallbackInterface($type)) {
</ins><span class="cx"> push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isFunction())\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@$outputArray, " if (!state->uncheckedArgument($argumentIndex).isObject())\n");
</span><span class="lines">@@ -4367,7 +4356,7 @@
</span><span class="cx"> push(@$outputArray, " }\n");
</span><span class="cx"> } else {
</span><span class="cx"> die "CallbackInterface does not support Variadic parameter" if $parameter->isVariadic;
</span><del>- if ($codeGenerator->IsFunctionOnlyCallbackInterface($idlType)) {
</del><ins>+ if ($codeGenerator->IsFunctionOnlyCallbackInterface($type)) {
</ins><span class="cx"> push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isFunction()))\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(!state->uncheckedArgument($argumentIndex).isObject()))\n");
</span><span class="lines">@@ -4383,16 +4372,16 @@
</span><span class="cx"> $value = "WTFMove($name)";
</span><span class="cx"> } elsif ($parameter->isVariadic) {
</span><span class="cx"> $implIncludes{"JSDOMConvert.h"} = 1;
</span><del>- AddToImplIncludesForIDLType($idlType, $function->signature->extendedAttributes->{Conditional});
</del><ins>+ AddToImplIncludesForIDLType($type, $function->signature->extendedAttributes->{Conditional});
</ins><span class="cx">
</span><del>- my $metaType = GetIDLType($interface, $idlType);
</del><ins>+ my $metaType = GetIDLType($interface, $type);
</ins><span class="cx"> push(@$outputArray, " auto $name = convertVariadicArguments<$metaType>(*state, $argumentIndex);\n");
</span><span class="cx"> push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
</span><span class="cx">
</span><span class="cx"> $value = "WTFMove($name.arguments.value())";
</span><span class="cx">
</span><del>- } elsif ($codeGenerator->IsEnumType($idlType)) {
- my $className = GetEnumerationClassName($idlType, $interface);
</del><ins>+ } elsif ($codeGenerator->IsEnumType($type)) {
+ my $className = GetEnumerationClassName($type, $interface);
</ins><span class="cx">
</span><span class="cx"> $implIncludes{"<runtime/Error.h>"} = 1;
</span><span class="cx">
</span><span class="lines">@@ -4424,7 +4413,7 @@
</span><span class="cx"> $indent = " ";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- $implIncludes{"JS$className.h"} = 1 if $codeGenerator->IsExternalEnumType($idlType);
</del><ins>+ $implIncludes{"JS$className.h"} = 1 if $codeGenerator->IsExternalEnumType($type);
</ins><span class="cx"> push(@$outputArray, "$indent $defineOptionalValue = parseEnumeration<$className>(*state, ${name}Value);\n");
</span><span class="cx"> push(@$outputArray, "$indent RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n");
</span><span class="cx"> push(@$outputArray, "$indent if (UNLIKELY(!$optionalValue))\n");
</span><span class="lines">@@ -4436,13 +4425,13 @@
</span><span class="cx"> my $outer;
</span><span class="cx"> my $inner;
</span><span class="cx"> my $nativeType = GetNativeTypeFromSignature($interface, $parameter);
</span><del>- my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOffForType($idlType) && $interfaceName !~ /List$/;
</del><ins>+ my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($type) && $interfaceName !~ /List$/;
</ins><span class="cx"> my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($parameter, $interface);
</span><span class="cx">
</span><span class="cx"> die "Variadic parameter is already handled here" if $parameter->isVariadic;
</span><span class="cx"> my $argumentLookupMethod = $parameter->isOptional ? "argument" : "uncheckedArgument";
</span><span class="cx">
</span><del>- if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($idlType) || $codeGenerator->IsTypedArrayType($idlType))) {
</del><ins>+ if (!$shouldPassByReference && ($codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type))) {
</ins><span class="cx"> $implIncludes{"<runtime/Error.h>"} = 1;
</span><span class="cx"> my $checkedArgument = "state->$argumentLookupMethod($argumentIndex)";
</span><span class="cx"> my $uncheckedArgument = "state->uncheckedArgument($argumentIndex)";
</span><span class="lines">@@ -4452,15 +4441,15 @@
</span><span class="cx"> push(@$outputArray, " $name = $nativeValue;\n");
</span><span class="cx"> push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $mayThrowException;
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(!$name))\n");
</span><del>- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $idlType->name . "\");\n");
</del><ins>+ push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
</ins><span class="cx"> push(@$outputArray, " }\n");
</span><span class="cx"> $value = "WTFMove($name)";
</span><span class="cx"> } else {
</span><del>- if ($parameter->isOptional && defined($parameter->default) && !WillConvertUndefinedToDefaultParameterValue($idlType, $parameter->default)) {
</del><ins>+ if ($parameter->isOptional && defined($parameter->default) && !WillConvertUndefinedToDefaultParameterValue($type, $parameter->default)) {
</ins><span class="cx"> my $defaultValue = $parameter->default;
</span><span class="cx">
</span><span class="cx"> # String-related optimizations.
</span><del>- if ($codeGenerator->IsStringType($idlType)) {
</del><ins>+ if ($codeGenerator->IsStringType($type)) {
</ins><span class="cx"> my $useAtomicString = $parameter->extendedAttributes->{AtomicString};
</span><span class="cx"> if ($defaultValue eq "null") {
</span><span class="cx"> $defaultValue = $useAtomicString ? "nullAtom" : "String()";
</span><span class="lines">@@ -4492,13 +4481,13 @@
</span><span class="cx">
</span><span class="cx"> if ($shouldPassByReference) {
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(!$name))\n");
</span><del>- push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $idlType->name . "\");\n");
</del><ins>+ push(@$outputArray, " return throwArgumentTypeError(*state, throwScope, $argumentIndex, \"$name\", \"$visibleInterfaceName\", $quotedFunctionName, \"" . $type->name . "\");\n");
</ins><span class="cx"> $value = $isTearOff ? "$name->propertyReference()" : "*$name";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($codeGenerator->IsTypedArrayType($idlType) and $idlType->name ne "ArrayBuffer") {
</del><ins>+ if ($codeGenerator->IsTypedArrayType($type) and $type->name ne "ArrayBuffer") {
</ins><span class="cx"> $value = $shouldPassByReference ? "$name.releaseNonNull()" : "WTFMove($name)";
</span><del>- } elsif ($codeGenerator->IsDictionaryType($idlType)) {
</del><ins>+ } elsif ($codeGenerator->IsDictionaryType($type)) {
</ins><span class="cx"> $value = "WTFMove($name)";
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -4509,7 +4498,7 @@
</span><span class="cx">
</span><span class="cx"> push @arguments, GenerateReturnParameters($function);
</span><span class="cx"> my $functionString = "$functionName(" . join(", ", @arguments) . ")";
</span><del>- $functionString = "propagateException(*state, throwScope, $functionString)" if $function->signature->idlType && $function->signature->idlType->name eq "void" && $function->signature->extendedAttributes->{MayThrowException};
</del><ins>+ $functionString = "propagateException(*state, throwScope, $functionString)" if $function->signature->type && $function->signature->type->name eq "void" && $function->signature->extendedAttributes->{MayThrowException};
</ins><span class="cx">
</span><span class="cx"> return ($functionString, scalar @arguments);
</span><span class="cx"> }
</span><span class="lines">@@ -4578,7 +4567,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $enumerations, $dictionaries) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx">
</span><span class="cx"> # - Add default header template and header protection
</span><span class="lines">@@ -4616,9 +4605,9 @@
</span><span class="cx"> foreach my $function (@{$interface->functions}) {
</span><span class="cx"> my @arguments = ();
</span><span class="cx"> foreach my $parameter (@{$function->parameters}) {
</span><del>- push(@arguments, GetNativeTypeForCallbacks($interface, $parameter->idlType) . " " . $parameter->name);
</del><ins>+ push(@arguments, GetNativeTypeForCallbacks($interface, $parameter->type) . " " . $parameter->name);
</ins><span class="cx"> }
</span><del>- push(@headerContent, " virtual " . GetNativeTypeForCallbacks($interface, $function->signature->idlType) . " " . $function->signature->name . "(" . join(", ", @arguments) . ");\n");
</del><ins>+ push(@headerContent, " virtual " . GetNativeTypeForCallbacks($interface, $function->signature->type) . " " . $function->signature->name . "(" . join(", ", @arguments) . ");\n");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4648,7 +4637,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($object, $interface, $enumerations, $dictionaries) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
</span><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx">
</span><span class="lines">@@ -4748,20 +4737,20 @@
</span><span class="cx"> push(@implContent, "\n// Functions\n");
</span><span class="cx"> foreach my $function (@{$interface->functions}) {
</span><span class="cx"> my @params = @{$function->parameters};
</span><del>- if ($function->signature->extendedAttributes->{Custom} || GetNativeType($interface, $function->signature->idlType) ne "bool") {
</del><ins>+ if ($function->signature->extendedAttributes->{Custom} || GetNativeType($interface, $function->signature->type) ne "bool") {
</ins><span class="cx"> next;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- AddToImplIncludesForIDLType($function->signature->idlType);
</del><ins>+ AddToImplIncludesForIDLType($function->signature->type);
</ins><span class="cx"> my $functionName = $function->signature->name;
</span><del>- push(@implContent, "\n" . GetNativeTypeForCallbacks($interface, $function->signature->idlType) . " ${className}::${functionName}(");
</del><ins>+ push(@implContent, "\n" . GetNativeTypeForCallbacks($interface, $function->signature->type) . " ${className}::${functionName}(");
</ins><span class="cx">
</span><span class="cx"> my @args = ();
</span><span class="cx"> my @argsCheck = ();
</span><span class="cx"> foreach my $param (@params) {
</span><span class="cx"> my $paramName = $param->name;
</span><del>- AddToImplIncludesForIDLType($param->idlType, 1);
- push(@args, GetNativeTypeForCallbacks($interface, $param->idlType) . " " . $paramName);
</del><ins>+ AddToImplIncludesForIDLType($param->type, 1);
+ push(@args, GetNativeTypeForCallbacks($interface, $param->type) . " " . $paramName);
</ins><span class="cx"> }
</span><span class="cx"> push(@implContent, join(", ", @args));
</span><span class="cx"> push(@implContent, ")\n");
</span><span class="lines">@@ -4829,7 +4818,7 @@
</span><span class="cx"> my $nondeterministic = $function->signature->extendedAttributes->{Nondeterministic};
</span><span class="cx"> my $mayThrowLegacyException = $function->signature->extendedAttributes->{MayThrowLegacyException};
</span><span class="cx">
</span><del>- if ($function->signature->idlType->name eq "void" || IsReturningPromise($function)) {
</del><ins>+ if ($function->signature->type->name eq "void" || IsReturningPromise($function)) {
</ins><span class="cx"> if ($nondeterministic) {
</span><span class="cx"> AddToImplIncludes("<replay/InputCursor.h>", "WEB_REPLAY");
</span><span class="cx"> push(@implContent, "#if ENABLE(WEB_REPLAY)\n");
</span><span class="lines">@@ -4865,8 +4854,8 @@
</span><span class="cx"> AddToImplIncludes("<wtf/NeverDestroyed.h>", "WEB_REPLAY");
</span><span class="cx">
</span><span class="cx"> my $nativeType = GetNativeTypeFromSignature($interface, $function->signature);
</span><del>- my $memoizedType = GetNativeTypeForMemoization($interface, $function->signature->idlType);
- my $bindingName = $interface->name . "." . $function->signature->name;
</del><ins>+ my $memoizedType = GetNativeTypeForMemoization($interface, $function->signature->type);
+ my $bindingName = $interface->type->name . "." . $function->signature->name;
</ins><span class="cx"> push(@implContent, $indent . "JSValue result;\n");
</span><span class="cx"> push(@implContent, "#if ENABLE(WEB_REPLAY)\n");
</span><span class="cx"> push(@implContent, $indent . "InputCursor& cursor = state->lexicalGlobalObject()->inputCursor();\n");
</span><span class="lines">@@ -4926,7 +4915,7 @@
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $className = "JS$interfaceName";
</span><span class="cx"> my $visibleInterfaceName = $codeGenerator->GetVisibleInterfaceName($interface);
</span><span class="cx">
</span><span class="lines">@@ -4939,8 +4928,8 @@
</span><span class="cx">
</span><span class="cx"> my $iteratorTraitsName = "${interfaceName}IteratorTraits";
</span><span class="cx"> my $iteratorTraitsType = $interface->iterable->isKeyValue ? "JSDOMIteratorType::Map" : "JSDOMIteratorType::Set";
</span><del>- my $iteratorTraitsKeyType = $interface->iterable->isKeyValue ? GetIDLType($interface, $interface->iterable->idlKeyType) : "void";
- my $iteratorTraitsValueType = GetIDLType($interface, $interface->iterable->idlValueType);
</del><ins>+ my $iteratorTraitsKeyType = $interface->iterable->isKeyValue ? GetIDLType($interface, $interface->iterable->keyType) : "void";
+ my $iteratorTraitsValueType = GetIDLType($interface, $interface->iterable->valueType);
</ins><span class="cx">
</span><span class="cx"> push(@implContent, <<END);
</span><span class="cx"> struct ${iteratorTraitsName} {
</span><span class="lines">@@ -5020,7 +5009,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $signature) = @_;
</span><span class="cx">
</span><del>- return GetNativeType($interface, $signature->idlType);
</del><ins>+ return GetNativeType($interface, $signature->type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my %nativeType = (
</span><span class="lines">@@ -5110,7 +5099,7 @@
</span><span class="cx">
</span><span class="cx"> sub GetBaseIDLType
</span><span class="cx"> {
</span><del>- my ($interface, $idlType) = @_;
</del><ins>+ my ($interface, $type) = @_;
</ins><span class="cx">
</span><span class="cx"> my %IDLTypes = (
</span><span class="cx"> "any" => "IDLAny",
</span><span class="lines">@@ -5136,21 +5125,21 @@
</span><span class="cx"> "BufferSource" => "IDLBufferSource",
</span><span class="cx"> );
</span><span class="cx">
</span><del>- return $IDLTypes{$idlType->name} if exists $IDLTypes{$idlType->name};
- return "IDLEnumeration<" . GetEnumerationClassName($idlType, $interface) . ">" if $codeGenerator->IsEnumType($idlType);
- return "IDLDictionary<" . GetDictionaryClassName($idlType, $interface) . ">" if $codeGenerator->IsDictionaryType($idlType);
- return "IDLSequence<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsSequenceType($idlType);
- return "IDLFrozenArray<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsFrozenArrayType($idlType);
- return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $idlType)) . ">" if $idlType->isUnion;
- return "IDLInterface<" . $idlType->name . ">";
</del><ins>+ return $IDLTypes{$type->name} if exists $IDLTypes{$type->name};
+ return "IDLEnumeration<" . GetEnumerationClassName($type, $interface) . ">" if $codeGenerator->IsEnumType($type);
+ return "IDLDictionary<" . GetDictionaryClassName($type, $interface) . ">" if $codeGenerator->IsDictionaryType($type);
+ return "IDLSequence<" . GetIDLType($interface, @{$type->subtypes}[0]) . ">" if $codeGenerator->IsSequenceType($type);
+ return "IDLFrozenArray<" . GetIDLType($interface, @{$type->subtypes}[0]) . ">" if $codeGenerator->IsFrozenArrayType($type);
+ return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $type)) . ">" if $type->isUnion;
+ return "IDLInterface<" . $type->name . ">";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GetIDLType
</span><span class="cx"> {
</span><del>- my ($interface, $idlType) = @_;
</del><ins>+ my ($interface, $type) = @_;
</ins><span class="cx">
</span><del>- my $baseIDLType = GetBaseIDLType($interface, $idlType);
- return "IDLNullable<" . $baseIDLType . ">" if $idlType->isNullable;
</del><ins>+ my $baseIDLType = GetBaseIDLType($interface, $type);
+ return "IDLNullable<" . $baseIDLType . ">" if $type->isNullable;
</ins><span class="cx"> return $baseIDLType;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5168,7 +5157,7 @@
</span><span class="cx"> return GetDictionaryClassName($type, $interface) if $codeGenerator->IsDictionaryType($type);
</span><span class="cx"> return GetNativeVectorType($type) if $codeGenerator->IsSequenceOrFrozenArrayType($type);
</span><span class="cx">
</span><del>- my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOffForType($type);
</del><ins>+ my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
</ins><span class="cx"> return "${tearOffType}*" if $tearOffType;
</span><span class="cx">
</span><span class="cx"> return "RefPtr<${typeName}>" if $codeGenerator->IsTypedArrayType($type) and $typeName ne "ArrayBuffer";
</span><span class="lines">@@ -5179,7 +5168,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($parameter, $interface) = @_;
</span><span class="cx">
</span><del>- my $nativeType = GetNativeType($interface, $parameter->idlType);
</del><ins>+ my $nativeType = GetNativeType($interface, $parameter->type);
</ins><span class="cx"> return $codeGenerator->ShouldPassWrapperByReference($parameter, $interface) && (substr($nativeType, -1) eq '*' || $nativeType =~ /^RefPtr/);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5213,7 +5202,7 @@
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx">
</span><span class="cx"> my $svgPropertyType;
</span><span class="cx"> my $svgListPropertyType;
</span><span class="lines">@@ -5221,10 +5210,10 @@
</span><span class="cx">
</span><span class="cx"> return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $interfaceName =~ /SVG/;
</span><span class="cx">
</span><del>- $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOffForType($interface->type);
</del><ins>+ $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($interface->type);
</ins><span class="cx"> return ($svgPropertyType, $svgListPropertyType, $svgNativeType) if not $svgNativeType;
</span><span class="cx">
</span><del>- my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOffForType($interface->type);
</del><ins>+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($interface->type);
</ins><span class="cx"> if ($svgNativeType =~ /SVGPropertyTearOff/) {
</span><span class="cx"> $svgPropertyType = $svgWrappedNativeType;
</span><span class="cx"> $headerIncludes{"$svgWrappedNativeType.h"} = 1;
</span><span class="lines">@@ -5274,20 +5263,20 @@
</span><span class="cx">
</span><span class="cx"> sub JSValueToNativeIsHandledByDOMConvert
</span><span class="cx"> {
</span><del>- my ($idlType, $signature) = @_;
</del><ins>+ my ($type, $signature) = @_;
</ins><span class="cx">
</span><del>- return 0 if $idlType->name eq "DOMString" && ($signature->extendedAttributes->{RequiresExistingAtomicString} || $signature->extendedAttributes->{AtomicString});
</del><ins>+ return 0 if $type->name eq "DOMString" && ($signature->extendedAttributes->{RequiresExistingAtomicString} || $signature->extendedAttributes->{AtomicString});
</ins><span class="cx">
</span><del>- return 1 if $idlType->isUnion;
- return 1 if $idlType->name eq "any";
- return 1 if $idlType->name eq "boolean";
- return 1 if $idlType->name eq "Date";
- return 1 if $idlType->name eq "BufferSource";
- return 1 if $codeGenerator->IsIntegerType($idlType);
- return 1 if $codeGenerator->IsFloatingPointType($idlType);
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($idlType);
- return 1 if $codeGenerator->IsDictionaryType($idlType);
- return 1 if $codeGenerator->IsStringType($idlType);
</del><ins>+ return 1 if $type->isUnion;
+ return 1 if $type->name eq "any";
+ return 1 if $type->name eq "boolean";
+ return 1 if $type->name eq "Date";
+ return 1 if $type->name eq "BufferSource";
+ return 1 if $codeGenerator->IsIntegerType($type);
+ return 1 if $codeGenerator->IsFloatingPointType($type);
+ return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
+ return 1 if $codeGenerator->IsDictionaryType($type);
+ return 1 if $codeGenerator->IsStringType($type);
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5297,7 +5286,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $signature, $value, $conditional, $statePointer, $stateReference, $thisObjectReference) = @_;
</span><span class="cx">
</span><del>- my $idlType = $signature->idlType;
</del><ins>+ my $type = $signature->type;
</ins><span class="cx">
</span><span class="cx"> # FIXME: Remove these 3 variables when all JSValueToNative use references.
</span><span class="cx"> $statePointer = "state" unless $statePointer;
</span><span class="lines">@@ -5304,63 +5293,63 @@
</span><span class="cx"> $stateReference = "*state" unless $stateReference;
</span><span class="cx"> $thisObjectReference = "*castedThis" unless $thisObjectReference;
</span><span class="cx">
</span><del>- if (JSValueToNativeIsHandledByDOMConvert($idlType, $signature)) {
</del><ins>+ if (JSValueToNativeIsHandledByDOMConvert($type, $signature)) {
</ins><span class="cx"> AddToImplIncludes("JSDOMConvert.h");
</span><del>- AddToImplIncludesForIDLType($idlType, $conditional);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $idlType);
</del><ins>+ my $IDLType = GetIDLType($interface, $type);
</ins><span class="cx">
</span><span class="cx"> my @conversionArguments = ();
</span><span class="cx"> push(@conversionArguments, "$stateReference");
</span><span class="cx"> push(@conversionArguments, "$value");
</span><del>- push(@conversionArguments, GetIntegerConversionConfiguration($signature)) if $codeGenerator->IsIntegerType($idlType);
- push(@conversionArguments, GetStringConversionConfiguration($signature)) if $codeGenerator->IsStringType($idlType);
</del><ins>+ push(@conversionArguments, GetIntegerConversionConfiguration($signature)) if $codeGenerator->IsIntegerType($type);
+ push(@conversionArguments, GetStringConversionConfiguration($signature)) if $codeGenerator->IsStringType($type);
</ins><span class="cx">
</span><span class="cx"> return ("convert<$IDLType>(" . join(", ", @conversionArguments) . ")", 1);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($idlType->name eq "DOMString") {
</del><ins>+ if ($type->name eq "DOMString") {
</ins><span class="cx"> return ("AtomicString($value.toString($statePointer)->toExistingAtomicString($statePointer))", 1) if $signature->extendedAttributes->{RequiresExistingAtomicString};
</span><span class="cx"> return ("$value.toString($statePointer)->toAtomicString($statePointer)", 1) if $signature->extendedAttributes->{AtomicString};
</span><span class="cx"> assert("Unhandled string conversion.");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($idlType->name eq "SerializedScriptValue") {
</del><ins>+ if ($type->name eq "SerializedScriptValue") {
</ins><span class="cx"> AddToImplIncludes("SerializedScriptValue.h", $conditional);
</span><span class="cx"> return ("SerializedScriptValue::create($stateReference, $value)", 1);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($idlType->name eq "Dictionary") {
</del><ins>+ if ($type->name eq "Dictionary") {
</ins><span class="cx"> AddToImplIncludes("Dictionary.h", $conditional);
</span><span class="cx"> return ("Dictionary($statePointer, $value)", 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- AddToImplIncludesForIDLType($idlType, $conditional);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- return ("to@{[$idlType->name]}($value)", 1) if $codeGenerator->IsTypedArrayType($idlType);
- return ("parseEnumeration<" . GetEnumerationClassName($idlType, $interface) . ">($stateReference, $value)", 1) if $codeGenerator->IsEnumType($idlType);
</del><ins>+ return ("to@{[$type->name]}($value)", 1) if $codeGenerator->IsTypedArrayType($type);
+ return ("parseEnumeration<" . GetEnumerationClassName($type, $interface) . ">($stateReference, $value)", 1) if $codeGenerator->IsEnumType($type);
</ins><span class="cx">
</span><span class="cx"> # FIXME: EventListener should be a callback interface.
</span><del>- return "JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))" if $idlType->name eq "EventListener";
</del><ins>+ return "JSEventListener::create($value, $thisObjectReference, false, currentWorld($statePointer))" if $type->name eq "EventListener";
</ins><span class="cx">
</span><del>- my $extendedAttributes = $codeGenerator->GetInterfaceExtendedAttributesFromName($idlType->name);
- return ("JS" . $idlType->name . "::toWrapped($stateReference, $value)", 1) if $idlType->name eq "XPathNSResolver";
- return ("JS" . $idlType->name . "::toWrapped($value)", 0);
</del><ins>+ my $extendedAttributes = $codeGenerator->GetInterfaceExtendedAttributesFromName($type->name);
+ return ("JS" . $type->name . "::toWrapped($stateReference, $value)", 1) if $type->name eq "XPathNSResolver";
+ return ("JS" . $type->name . "::toWrapped($value)", 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub NativeToJSValueIsHandledByDOMConvert
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><del>- return 1 if $idlType->name eq "any";
- return 1 if $idlType->name eq "boolean";
- return 1 if $idlType->name eq "Date";
- return 1 if $codeGenerator->IsIntegerType($idlType);
- return 1 if $codeGenerator->IsFloatingPointType($idlType);
- return 1 if $codeGenerator->IsStringType($idlType);
- return 1 if $codeGenerator->IsEnumType($idlType);
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($idlType);
- return 1 if $idlType->isUnion;
</del><ins>+ return 1 if $type->name eq "any";
+ return 1 if $type->name eq "boolean";
+ return 1 if $type->name eq "Date";
+ return 1 if $codeGenerator->IsIntegerType($type);
+ return 1 if $codeGenerator->IsFloatingPointType($type);
+ return 1 if $codeGenerator->IsStringType($type);
+ return 1 if $codeGenerator->IsEnumType($type);
+ return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
+ return 1 if $type->isUnion;
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5367,14 +5356,14 @@
</span><span class="cx">
</span><span class="cx"> sub NativeToJSValueDOMConvertNeedsState
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><span class="cx"> # FIXME: This should actually check if all the sub-objects of the union need the state.
</span><del>- return 1 if $idlType->isUnion;
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($idlType);
- return 1 if $codeGenerator->IsStringType($idlType);
- return 1 if $codeGenerator->IsEnumType($idlType);
- return 1 if $idlType->name eq "Date";
</del><ins>+ return 1 if $type->isUnion;
+ return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
+ return 1 if $codeGenerator->IsStringType($type);
+ return 1 if $codeGenerator->IsEnumType($type);
+ return 1 if $type->name eq "Date";
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5381,11 +5370,11 @@
</span><span class="cx">
</span><span class="cx"> sub NativeToJSValueDOMConvertNeedsGlobalObject
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><span class="cx"> # FIXME: This should actually check if all the sub-objects of the union need the global object.
</span><del>- return 1 if $idlType->isUnion;
- return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($idlType);
</del><ins>+ return 1 if $type->isUnion;
+ return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($type);
</ins><span class="cx">
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -5418,18 +5407,17 @@
</span><span class="cx"> my ($signature, $inFunctionCall, $interface, $value, $statePointer, $stateReference, $wrapped, $globalObject) = @_;
</span><span class="cx">
</span><span class="cx"> my $conditional = $signature->extendedAttributes->{Conditional};
</span><del>- my $idlType = $signature->idlType;
- my $isNullable = $signature->isNullable;
</del><ins>+ my $type = $signature->type;
</ins><span class="cx"> my $mayThrowException = $signature->extendedAttributes->{GetterMayThrowException} || $signature->extendedAttributes->{MayThrowException};
</span><span class="cx">
</span><span class="cx"> # We could instead overload a function to work with optional as well as non-optional numbers, but this
</span><span class="cx"> # is slightly better because it guarantees we will fail to compile if the IDL file doesn't match the C++.
</span><del>- if ($signature->extendedAttributes->{Reflect} and ($idlType->name eq "unsigned long" or $idlType->name eq "unsigned short")) {
</del><ins>+ if ($signature->extendedAttributes->{Reflect} and ($type->name eq "unsigned long" or $type->name eq "unsigned short")) {
</ins><span class="cx"> $value =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
</span><span class="cx"> $value = "std::max(0, $value)";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($idlType->name eq "any") {
</del><ins>+ if ($type->name eq "any") {
</ins><span class="cx"> my $returnType = $signature->extendedAttributes->{ImplementationReturnType};
</span><span class="cx"> if (defined $returnType and ($returnType eq "IDBKeyPath" or $returnType eq "IDBKey")) {
</span><span class="cx"> AddToImplIncludes("IDBBindingUtilities.h", $conditional);
</span><span class="lines">@@ -5437,15 +5425,15 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (NativeToJSValueIsHandledByDOMConvert($idlType)) {
</del><ins>+ if (NativeToJSValueIsHandledByDOMConvert($type)) {
</ins><span class="cx"> AddToImplIncludes("JSDOMConvert.h");
</span><del>- AddToImplIncludesForIDLType($idlType, $conditional);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- my $IDLType = GetIDLType($interface, $idlType);
</del><ins>+ my $IDLType = GetIDLType($interface, $type);
</ins><span class="cx">
</span><span class="cx"> my @conversionArguments = ();
</span><del>- push(@conversionArguments, "$stateReference") if NativeToJSValueDOMConvertNeedsState($idlType) || $mayThrowException;
- push(@conversionArguments, "*$globalObject") if NativeToJSValueDOMConvertNeedsGlobalObject($idlType);
</del><ins>+ push(@conversionArguments, "$stateReference") if NativeToJSValueDOMConvertNeedsState($type) || $mayThrowException;
+ push(@conversionArguments, "*$globalObject") if NativeToJSValueDOMConvertNeedsGlobalObject($type);
</ins><span class="cx"> push(@conversionArguments, "throwScope") if $mayThrowException;
</span><span class="cx"> push(@conversionArguments, "$value");
</span><span class="cx">
</span><span class="lines">@@ -5452,33 +5440,31 @@
</span><span class="cx"> return "toJS<$IDLType>(" . join(", ", @conversionArguments) . ")";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($idlType->name eq "SerializedScriptValue") {
</del><ins>+ if ($type->name eq "SerializedScriptValue") {
</ins><span class="cx"> AddToImplIncludes("SerializedScriptValue.h", $conditional);
</span><span class="cx"> return "$value ? $value->deserialize($stateReference, $globalObject) : jsNull()";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- AddToImplIncludes("StyleProperties.h", $conditional) if $idlType->name eq "CSSStyleDeclaration";
- AddToImplIncludes("NameNodeList.h", $conditional) if $idlType->name eq "NodeList";
- AddToImplIncludes("JS" . $idlType->name . ".h", $conditional) if !$codeGenerator->IsTypedArrayType($idlType);
</del><ins>+ AddToImplIncludesForIDLType($type, $conditional);
</ins><span class="cx">
</span><del>- return $value if $codeGenerator->IsSVGAnimatedType($idlType);
</del><ins>+ return $value if $codeGenerator->IsSVGAnimatedType($type);
</ins><span class="cx">
</span><del>- if ($codeGenerator->IsSVGAnimatedType($interface->type) or ($interface->name eq "SVGViewSpec" and $idlType->name eq "SVGTransformList")) {
</del><ins>+ if ($codeGenerator->IsSVGAnimatedType($interface->type) or ($interface->type->name eq "SVGViewSpec" and $type->name eq "SVGTransformList")) {
</ins><span class="cx"> # Convert from abstract RefPtr<ListProperty> to real type, so the right toJS() method can be invoked.
</span><del>- $value = "static_cast<" . GetNativeType($interface, $idlType) . ">($value.get())";
- } elsif ($interface->name eq "SVGViewSpec") {
</del><ins>+ $value = "static_cast<" . GetNativeType($interface, $type) . ">($value.get())";
+ } elsif ($interface->type->name eq "SVGViewSpec") {
</ins><span class="cx"> # Convert from abstract SVGProperty to real type, so the right toJS() method can be invoked.
</span><del>- $value = "static_cast<" . GetNativeType($interface, $idlType) . ">($value)";
- } elsif ($codeGenerator->IsSVGTypeNeedingTearOffForType($idlType) and not $interface->type->name =~ /List$/) {
- my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOffForType($idlType);
- if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOffForType($idlType) and !$inFunctionCall and not defined $signature->extendedAttributes->{Immutable}) {
</del><ins>+ $value = "static_cast<" . GetNativeType($interface, $type) . ">($value)";
+ } elsif ($codeGenerator->IsSVGTypeNeedingTearOff($type) and not $interface->type->name =~ /List$/) {
+ my $tearOffType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
+ if ($codeGenerator->IsSVGTypeWithWritablePropertiesNeedingTearOff($type) and !$inFunctionCall and not defined $signature->extendedAttributes->{Immutable}) {
</ins><span class="cx"> my $getter = $value;
</span><span class="cx"> $getter =~ s/impl\.//;
</span><span class="cx"> $getter =~ s/impl->//;
</span><span class="cx"> $getter =~ s/\(\)//;
</span><del>- my $updateMethod = "&" . $interface->name . "::update" . $codeGenerator->WK_ucfirst($getter);
</del><ins>+ my $updateMethod = "&" . $interface->type->name . "::update" . $codeGenerator->WK_ucfirst($getter);
</ins><span class="cx">
</span><del>- my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOffForType($interface->type);
</del><ins>+ my $selfIsTearOffType = $codeGenerator->IsSVGTypeNeedingTearOff($interface->type);
</ins><span class="cx"> if ($selfIsTearOffType) {
</span><span class="cx"> # FIXME: Why SVGMatrix specifically?
</span><span class="cx"> AddToImplIncludes("SVGMatrixTearOff.h", $conditional);
</span><span class="lines">@@ -5485,7 +5471,7 @@
</span><span class="cx"> $value = "SVGMatrixTearOff::create($wrapped, $value)";
</span><span class="cx"> } else {
</span><span class="cx"> AddToImplIncludes("SVGStaticPropertyTearOff.h", $conditional);
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> $tearOffType =~ s/SVGPropertyTearOff</SVGStaticPropertyTearOff<$interfaceName, /;
</span><span class="cx"> $value = "${tearOffType}::create(impl, $value, $updateMethod)";
</span><span class="cx"> }
</span><span class="lines">@@ -5676,7 +5662,7 @@
</span><span class="cx"> my $interface = shift;
</span><span class="cx"> my $outputDir = shift;
</span><span class="cx">
</span><del>- my $name = $interface->name;
</del><ins>+ my $name = $interface->type->name;
</ins><span class="cx"> my $prefix = FileNamePrefix;
</span><span class="cx"> my $headerFileName = "$outputDir/$prefix$name.h";
</span><span class="cx"> my $implFileName = "$outputDir/$prefix$name.cpp";
</span><span class="lines">@@ -5842,7 +5828,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($outputArray, $className, $interface) = @_;
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $constructorClassName = "${className}Constructor";
</span><span class="cx"> my $templateClassName = GetConstructorTemplateClassName($interface);
</span><span class="cx">
</span><span class="lines">@@ -5880,7 +5866,7 @@
</span><span class="cx">
</span><span class="cx"> return if IsJSBuiltinConstructor($interface);
</span><span class="cx">
</span><del>- my $interfaceName = $interface->name;
</del><ins>+ my $interfaceName = $interface->type->name;
</ins><span class="cx"> my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
</span><span class="cx">
</span><span class="cx"> if (IsConstructable($interface)) {
</span><span class="lines">@@ -6025,8 +6011,8 @@
</span><span class="cx"> # FIXME: IDL does not allow an interface without [NoInterfaceObject] to inherit one that is marked as [NoInterfaceObject]
</span><span class="cx"> # so we should be able to use our parent's interface object no matter what. However, some of our IDL files (e.g. CanvasRenderingContext2D)
</span><span class="cx"> # are not valid so we need this check for now.
</span><del>- if ($interface->parent && !$codeGenerator->GetInterfaceExtendedAttributesFromName($interface->parent)->{NoInterfaceObject}) {
- my $parentClassName = "JS" . $interface->parent;
</del><ins>+ if ($interface->parentType && !$codeGenerator->GetInterfaceExtendedAttributesFromName($interface->parentType->name)->{NoInterfaceObject}) {
+ my $parentClassName = "JS" . $interface->parentType->name;
</ins><span class="cx"> push(@$outputArray, " return ${parentClassName}::getConstructor(vm, &globalObject);\n");
</span><span class="cx"> } elsif ($interface->isCallback) {
</span><span class="cx"> # The internal [[Prototype]] property of an interface object for a callback interface must be the Object.prototype object.
</span><span class="lines">@@ -6064,7 +6050,7 @@
</span><span class="cx"> if (IsJSBuiltinConstructor($interface)) {
</span><span class="cx"> push(@$outputArray, "template<> FunctionExecutable* ${constructorClassName}::initializeExecutable(VM& vm)\n");
</span><span class="cx"> push(@$outputArray, "{\n");
</span><del>- push(@$outputArray, " return " . GetJSBuiltinFunctionNameFromString($interface->name, "initialize" . $interface->name) . "(vm);\n");
</del><ins>+ push(@$outputArray, " return " . GetJSBuiltinFunctionNameFromString($interface->type->name, "initialize" . $interface->type->name) . "(vm);\n");
</ins><span class="cx"> push(@$outputArray, "}\n");
</span><span class="cx"> push(@$outputArray, "\n");
</span><span class="cx"> }
</span><span class="lines">@@ -6105,7 +6091,7 @@
</span><span class="cx"> sub IsReturningPromise
</span><span class="cx"> {
</span><span class="cx"> my $function = shift;
</span><del>- return $function->signature->idlType && $function->signature->idlType->name eq "Promise";
</del><ins>+ return $function->signature->type && $function->signature->type->name eq "Promise";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub IsConstructable
</span><span class="lines">@@ -6188,7 +6174,7 @@
</span><span class="cx"> sub GetJSBuiltinScopeName
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $object) = @_;
</span><del>- return $object->signature->extendedAttributes->{ImplementedBy} || $interface->name;
</del><ins>+ return $object->signature->extendedAttributes->{ImplementedBy} || $interface->type->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub AddJSBuiltinIncludesIfNeeded()
</span><span class="lines">@@ -6196,7 +6182,7 @@
</span><span class="cx"> my $interface = shift;
</span><span class="cx">
</span><span class="cx"> if ($interface->extendedAttributes->{JSBuiltin} || $interface->extendedAttributes->{JSBuiltinConstructor}) {
</span><del>- AddToImplIncludes($interface->name . "Builtins.h");
</del><ins>+ AddToImplIncludes($interface->type->name . "Builtins.h");
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -51,12 +51,22 @@
</span><span class="cx"> subtypes => '@', # Array of subtypes, only valid if isUnion or sequence
</span><span class="cx"> });
</span><span class="cx">
</span><ins>+# Used to represent a map of 'variable name' <-> 'variable type'
+struct( domSignature => {
+ direction => '$', # Variable direction (in or out)
+ name => '$', # Variable name
+ type => 'domType', # Variable type
+ specials => '@', # Specials
+ extendedAttributes => '$', # Extended attributes
+ isVariadic => '$', # Is variable variadic (long... numbers)
+ isOptional => '$', # Is variable optional (optional T)
+ default => '$', # Default value for parameters
+});
+
</ins><span class="cx"> # Used to represent 'interface' blocks
</span><span class="cx"> struct( domInterface => {
</span><del>- name => '$', # Class identifier
- type => '$', # Class type
- parent => '$', # Parent class identifier
- parentType => '$', # Parent class type
</del><ins>+ type => 'domType', # Class type
+ parentType => 'domType', # Parent class type
</ins><span class="cx"> constants => '@', # List of 'domConstant'
</span><span class="cx"> functions => '@', # List of 'domFunction'
</span><span class="cx"> anonymousFunctions => '@', # List of 'domFunction'
</span><span class="lines">@@ -74,39 +84,23 @@
</span><span class="cx"> # Used to represent domInterface contents (name of method, signature)
</span><span class="cx"> struct( domFunction => {
</span><span class="cx"> isStatic => '$',
</span><del>- signature => '$', # Return type/Object name/extended attributes
- parameters => '@', # List of 'domSignature'
</del><ins>+ signature => 'domSignature', # Return type/Object name/extended attributes
+ parameters => '@', # List of 'domSignature'
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> # Used to represent domInterface contents (name of attribute, signature)
</span><span class="cx"> struct( domAttribute => {
</span><del>- type => '$', # Attribute type (including namespace)
</del><span class="cx"> isStatic => '$',
</span><span class="cx"> isStringifier => '$',
</span><span class="cx"> isReadOnly => '$',
</span><del>- signature => '$', # Attribute signature
</del><ins>+ signature => 'domSignature', # Attribute signature
</ins><span class="cx"> });
</span><span class="cx">
</span><del>-# Used to represent a map of 'variable name' <-> 'variable type'
-struct( domSignature => {
- direction => '$', # Variable direction (in or out)
- name => '$', # Variable name
- idlType => '$', # Variable type
- specials => '@', # Specials
- extendedAttributes => '$', # Extended attributes
- isNullable => '$', # Is variable type Nullable (T?)
- isVariadic => '$', # Is variable variadic (long... numbers)
- isOptional => '$', # Is variable optional (optional T)
- default => '$', # Default value for parameters
-});
-
</del><span class="cx"> # Used to represent Iterable interfaces
</span><span class="cx"> struct( domIterable => {
</span><span class="cx"> isKeyValue => '$',# Is map iterable or set iterable
</span><del>- keyType => '$', # Key type name for map iterables (DEPRECATED - please use idlKeyType)
- valueType => '$', # Value type name for map or set iterables (DEPRECATED - please use idlValueType)
- idlKeyType => '$', # Key type for map iterables
- idlValueType => '$', # Value type for map or set iterables
</del><ins>+ keyType => 'domType', # Key type for map iterables
+ valueType => 'domType', # Value type for map or set iterables
</ins><span class="cx"> functions => '@', # Iterable functions (entries, keys, values, [Symbol.Iterator], forEach)
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><span class="cx"> });
</span><span class="lines">@@ -123,7 +117,7 @@
</span><span class="cx"> # Used to represent string constants
</span><span class="cx"> struct( domConstant => {
</span><span class="cx"> name => '$', # DOM Constant identifier
</span><del>- type => '$', # Type name of data
</del><ins>+ type => 'domType', # Type name of data
</ins><span class="cx"> value => '$', # Constant value
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><span class="cx"> });
</span><span class="lines">@@ -131,16 +125,14 @@
</span><span class="cx"> # Used to represent 'enum' definitions
</span><span class="cx"> struct( domEnum => {
</span><span class="cx"> name => '$', # Enumeration identifier
</span><del>- type => '$', # Enumeration type
</del><ins>+ type => 'domType', # Enumeration type
</ins><span class="cx"> values => '@', # Enumeration values (list of unique strings)
</span><span class="cx"> extendedAttributes => '$',
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> struct( domDictionary => {
</span><del>- name => '$', # Dictionary identifier
- type => '$', # Dictionary type
- parent => '$', # Parent identifier
- parentType => '$', # Parent type identifier
</del><ins>+ type => 'domType', # Dictionary type
+ parentType => 'domType', # Parent type identifier
</ins><span class="cx"> members => '@', # List of 'domSignature'
</span><span class="cx"> extendedAttributes => '$',
</span><span class="cx"> });
</span><span class="lines">@@ -152,7 +144,7 @@
</span><span class="cx">
</span><span class="cx"> struct( Typedef => {
</span><span class="cx"> extendedAttributes => '$', # Extended attributes
</span><del>- idlType => '$', # Type of data
</del><ins>+ type => 'domType', # Type of data
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> # Maps 'typedef name' -> Typedef
</span><span class="lines">@@ -376,6 +368,22 @@
</span><span class="cx"> return $type;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub cloneType
+{
+ my $self = shift;
+ my $type = shift;
+
+ my $clonedType = domType->new();
+ $clonedType->name($type->name);
+ $clonedType->isNullable($type->isNullable);
+ $clonedType->isUnion($type->isUnion);
+ foreach my $subtype (@{$type->subtypes}) {
+ push(@{$clonedType->subtypes}, $self->cloneType($subtype));
+ }
+
+ return $clonedType;
+}
+
</ins><span class="cx"> my $nextAttribute_1 = '^(attribute|inherit|readonly)$';
</span><span class="cx"> my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$';
</span><span class="cx"> my $nextPrimitiveType_2 = '^(double|float|unrestricted)$';
</span><span class="lines">@@ -436,10 +444,16 @@
</span><span class="cx"> foreach my $definition (@$definitions) {
</span><span class="cx"> if (ref($definition) eq "domInterface") {
</span><span class="cx"> foreach my $constant (@{$definition->constants}) {
</span><del>- if (exists $typedefs{$constant->type}) {
- my $typedef = $typedefs{$constant->type};
- $self->assertNoExtendedAttributesInTypedef($constant->type, __LINE__);
- $constant->type($typedef->idlType->name);
</del><ins>+ if (exists $typedefs{$constant->type->name}) {
+ my $typedef = $typedefs{$constant->type->name};
+ $self->assertNoExtendedAttributesInTypedef($constant->type->name, __LINE__);
+
+ my $clonedType = $self->cloneType($typedef->type);
+
+ # Retain nullability from the original type.
+ $clonedType->isNullable($constant->type->isNullable);
+
+ $constant->type($clonedType);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> foreach my $attribute (@{$definition->attributes}) {
</span><span class="lines">@@ -459,50 +473,34 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub cloneType
-{
- my $self = shift;
- my $type = shift;
-
- my $clonedType = domType->new();
- $clonedType->name($type->name);
- $clonedType->isNullable($type->isNullable);
- $clonedType->isUnion($type->isUnion);
- foreach my $subtype (@{$type->subtypes}) {
- push(@{$clonedType->subtypes}, $self->cloneType($subtype));
- }
-
- return $clonedType;
-}
-
</del><span class="cx"> sub applyTypedefsForSignature
</span><span class="cx"> {
</span><span class="cx"> my $self = shift;
</span><span class="cx"> my $signature = shift;
</span><span class="cx">
</span><del>- if (!defined ($signature->idlType)) {
</del><ins>+ if (!defined ($signature->type)) {
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $typeName = $signature->idlType->name;
</del><ins>+ my $typeName = $signature->type->name;
</ins><span class="cx">
</span><span class="cx"> # Handle union types, sequences and etc.
</span><span class="cx"> # FIXME: This should be recursive.
</span><del>- my $numberOfSubtypes = scalar @{$signature->idlType->subtypes};
</del><ins>+ my $numberOfSubtypes = scalar @{$signature->type->subtypes};
</ins><span class="cx"> if ($numberOfSubtypes) {
</span><span class="cx"> for my $i (0..$numberOfSubtypes - 1) {
</span><del>- my $subtype = @{$signature->idlType->subtypes}[$i];
</del><ins>+ my $subtype = @{$signature->type->subtypes}[$i];
</ins><span class="cx"> my $subtypeName = $subtype->name;
</span><span class="cx">
</span><span class="cx"> if (exists $typedefs{$subtypeName}) {
</span><span class="cx"> my $typedef = $typedefs{$subtypeName};
</span><span class="cx">
</span><del>- my $clonedType = $self->cloneType($typedef->idlType);
</del><ins>+ my $clonedType = $self->cloneType($typedef->type);
</ins><span class="cx">
</span><span class="cx"> # Retain nullability from the original type.
</span><span class="cx"> $clonedType->isNullable($subtype->isNullable);
</span><span class="cx">
</span><del>- @{$signature->idlType->subtypes}[$i] = $clonedType;
</del><ins>+ @{$signature->type->subtypes}[$i] = $clonedType;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -512,13 +510,12 @@
</span><span class="cx"> if (exists $typedefs{$typeName}) {
</span><span class="cx"> my $typedef = $typedefs{$typeName};
</span><span class="cx">
</span><del>- my $clonedType = $self->cloneType($typedef->idlType);
</del><ins>+ my $clonedType = $self->cloneType($typedef->type);
</ins><span class="cx">
</span><span class="cx"> # Retain nullability from the original type.
</span><del>- $clonedType->isNullable($signature->idlType->isNullable);
</del><ins>+ $clonedType->isNullable($signature->type->isNullable);
</ins><span class="cx">
</span><del>- $signature->idlType($clonedType);
- $signature->isNullable($clonedType->isNullable);
</del><ins>+ $signature->type($clonedType);
</ins><span class="cx">
</span><span class="cx"> copyExtendedAttributes($signature->extendedAttributes, $typedef->extendedAttributes);
</span><span class="cx"> }
</span><span class="lines">@@ -600,13 +597,11 @@
</span><span class="cx"> $self->assertTokenType($interfaceNameToken, IdentifierToken);
</span><span class="cx">
</span><span class="cx"> my $name = identifierRemoveNullablePrefix($interfaceNameToken->value());
</span><del>- $interface->name($name);
</del><span class="cx"> $interface->type(makeSimpleType($name));
</span><span class="cx">
</span><span class="cx"> $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq ":") {
</span><span class="cx"> my $parent = $self->parseInheritance();
</span><del>- $interface->parent($parent);
</del><span class="cx"> $interface->parentType(makeSimpleType($parent));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -721,13 +716,11 @@
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="cx">
</span><span class="cx"> my $name = $nameToken->value();
</span><del>- $dictionary->name($name);
</del><span class="cx"> $dictionary->type(makeSimpleType($name));
</span><span class="cx">
</span><span class="cx"> $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq ":") {
</span><span class="cx"> my $parent = $self->parseInheritance();
</span><del>- $dictionary->parent($parent);
</del><span class="cx"> $dictionary->parentType(makeSimpleType($parent));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -776,8 +769,7 @@
</span><span class="cx"> $member->extendedAttributes($extendedAttributeList);
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $member->idlType($type);
- $member->isNullable($type->isNullable);
</del><ins>+ $member->type($type);
</ins><span class="cx">
</span><span class="cx"> my $nameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="lines">@@ -847,7 +839,6 @@
</span><span class="cx"> $self->assertTokenType($exceptionNameToken, IdentifierToken);
</span><span class="cx">
</span><span class="cx"> my $name = identifierRemoveNullablePrefix($exceptionNameToken->value());
</span><del>- $interface->name($name);
</del><span class="cx"> $interface->type(makeSimpleType($name));
</span><span class="cx"> $interface->isException(1);
</span><span class="cx">
</span><span class="lines">@@ -854,7 +845,6 @@
</span><span class="cx"> $next = $self->nextToken();
</span><span class="cx"> if ($next->value() eq ":") {
</span><span class="cx"> my $parent = $self->parseInheritance();
</span><del>- $interface->parent($parent);
</del><span class="cx"> $interface->parentType(makeSimpleType($parent));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -992,13 +982,13 @@
</span><span class="cx"> $typedef->extendedAttributes($self->parseExtendedAttributeListAllowEmpty());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $typedef->idlType($type);
</del><ins>+ $typedef->type($type);
</ins><span class="cx">
</span><span class="cx"> my $nameToken = $self->getToken();
</span><span class="cx"> $self->assertTokenType($nameToken, IdentifierToken);
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ";", __LINE__);
</span><span class="cx"> my $name = $nameToken->value();
</span><del>- die "typedef redefinition for " . $name . " at " . $self->{Line} if (exists $typedefs{$name} && $typedef->idlType->name ne $typedefs{$name}->idlType->name);
</del><ins>+ die "typedef redefinition for " . $name . " at " . $self->{Line} if (exists $typedefs{$name} && $typedef->type->name ne $typedefs{$name}->type->name);
</ins><span class="cx"> $typedefs{$name} = $typedef;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -1298,8 +1288,7 @@
</span><span class="cx"> my $returnType = $self->parseReturnType();
</span><span class="cx"> my $interface = $self->parseOperationRest($extendedAttributeList);
</span><span class="cx"> if (defined ($interface)) {
</span><del>- $interface->signature->idlType($returnType);
- $interface->signature->isNullable($returnType->isNullable);
</del><ins>+ $interface->signature->type($returnType);
</ins><span class="cx"> }
</span><span class="cx"> return $interface;
</span><span class="cx"> }
</span><span class="lines">@@ -1328,17 +1317,13 @@
</span><span class="cx"> if ($next->value() =~ /$nextAttributeRest_1/) {
</span><span class="cx"> my $newDataNode = domAttribute->new();
</span><span class="cx"> if ($self->parseReadOnly()) {
</span><del>- $newDataNode->type("attribute");
</del><span class="cx"> $newDataNode->isReadOnly(1);
</span><del>- } else {
- $newDataNode->type("attribute");
</del><span class="cx"> }
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "attribute", __LINE__);
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $newDataNode->signature->idlType($type);
- $newDataNode->signature->isNullable($type->isNullable);
</del><ins>+ $newDataNode->signature->type($type);
</ins><span class="cx">
</span><span class="cx"> my $token = $self->getToken();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="lines">@@ -1394,9 +1379,7 @@
</span><span class="cx"> my $next = $self->nextToken();
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() eq "(") {
</span><span class="cx"> my $operation = $self->parseOperationRest($extendedAttributeList);
</span><del>- $operation->signature->idlType($returnType);
- $operation->signature->isNullable($returnType->isNullable);
-
</del><ins>+ $operation->signature->type($returnType);
</ins><span class="cx"> return $operation;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -1415,8 +1398,7 @@
</span><span class="cx"> my $returnType = $self->parseReturnType();
</span><span class="cx"> my $interface = $self->parseOperationRest($extendedAttributeList);
</span><span class="cx"> if (defined ($interface)) {
</span><del>- $interface->signature->idlType($returnType);
- $interface->signature->isNullable($returnType->isNullable);
</del><ins>+ $interface->signature->type($returnType);
</ins><span class="cx"> $interface->signature->specials(\@specials);
</span><span class="cx"> }
</span><span class="cx"> return $interface;
</span><span class="lines">@@ -1513,7 +1495,7 @@
</span><span class="cx"> $forEachFunction->signature->name("forEach");
</span><span class="cx"> my $forEachArgument = domSignature->new();
</span><span class="cx"> $forEachArgument->name("callback");
</span><del>- $forEachArgument->idlType(makeSimpleType("any"));
</del><ins>+ $forEachArgument->type(makeSimpleType("any"));
</ins><span class="cx"> push(@{$forEachFunction->parameters}, ($forEachArgument));
</span><span class="cx">
</span><span class="cx"> my $newDataNode = domIterable->new();
</span><span class="lines">@@ -1532,14 +1514,11 @@
</span><span class="cx">
</span><span class="cx"> my $type2 = $self->parseType();
</span><span class="cx"> $newDataNode->isKeyValue(1);
</span><del>- $newDataNode->idlKeyType($type1);
- $newDataNode->keyType($type1->name);
- $newDataNode->idlValueType($type2);
- $newDataNode->valueType($type2->name);
</del><ins>+ $newDataNode->keyType($type1);
+ $newDataNode->valueType($type2);
</ins><span class="cx"> } else {
</span><span class="cx"> $newDataNode->isKeyValue(0);
</span><del>- $newDataNode->idlValueType($type1);
- $newDataNode->valueType($type1->name);
</del><ins>+ $newDataNode->valueType($type1);
</ins><span class="cx"> }
</span><span class="cx"> $self->assertTokenValue($self->getToken(), ">", __LINE__);
</span><span class="cx">
</span><span class="lines">@@ -1635,8 +1614,7 @@
</span><span class="cx"> $self->assertTokenValue($self->getToken(), "optional", __LINE__);
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $paramDataNode->idlType($type);
- $paramDataNode->isNullable($type->isNullable);
</del><ins>+ $paramDataNode->type($type);
</ins><span class="cx"> $paramDataNode->isOptional(1);
</span><span class="cx"> $paramDataNode->name($self->parseArgumentName());
</span><span class="cx"> $paramDataNode->default($self->parseDefault());
</span><span class="lines">@@ -1644,8 +1622,7 @@
</span><span class="cx"> }
</span><span class="cx"> if ($next->type() == IdentifierToken || $next->value() =~ /$nextExceptionField_1/) {
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $paramDataNode->idlType($type);
- $paramDataNode->isNullable($type->isNullable);
</del><ins>+ $paramDataNode->type($type);
</ins><span class="cx"> $paramDataNode->isOptional(0);
</span><span class="cx"> $paramDataNode->isVariadic($self->parseEllipsis());
</span><span class="cx"> $paramDataNode->name($self->parseArgumentName());
</span><span class="lines">@@ -1706,8 +1683,7 @@
</span><span class="cx"> $newDataNode->signature(domSignature->new());
</span><span class="cx">
</span><span class="cx"> my $type = $self->parseType();
</span><del>- $newDataNode->signature->idlType($type);
- $newDataNode->signature->isNullable($type->isNullable);
</del><ins>+ $newDataNode->signature->type($type);
</ins><span class="cx">
</span><span class="cx"> my $token = $self->getToken();
</span><span class="cx"> $self->assertTokenType($token, IdentifierToken);
</span><span class="lines">@@ -2353,7 +2329,7 @@
</span><span class="cx"> # This check may have to move to the code generator, if we don't have enough information
</span><span class="cx"> # here to determine serializability: https://heycam.github.io/webidl/#idl-serializers
</span><span class="cx"> my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMString|ByteString|USVString)$';
</span><del>- return $attribute->signature->idlType->name =~ /$serializable_types/;
</del><ins>+ return $attribute->signature->type->name =~ /$serializable_types/;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub applyMemberList
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsgeneratebindingspl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/generate-bindings.pl (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/generate-bindings.pl        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Source/WebCore/bindings/scripts/generate-bindings.pl        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -141,11 +141,11 @@
</span><span class="cx"> my $document = $parser->Parse($idlFile, $defines, $preprocessor);
</span><span class="cx">
</span><span class="cx"> foreach my $interface (@{$document->interfaces}) {
</span><del>- if (!$interface->isPartial || $interface->name eq $targetInterfaceName) {
</del><ins>+ if (!$interface->isPartial || $interface->type->name eq $targetInterfaceName) {
</ins><span class="cx"> my $targetDataNode;
</span><span class="cx"> my @targetGlobalContexts;
</span><span class="cx"> foreach my $interface (@{$targetDocument->interfaces}) {
</span><del>- if ($interface->name eq $targetInterfaceName) {
</del><ins>+ if ($interface->type->name eq $targetInterfaceName) {
</ins><span class="cx"> $targetDataNode = $interface;
</span><span class="cx"> my $exposedAttribute = $targetDataNode->extendedAttributes->{"Exposed"} || "Window";
</span><span class="cx"> $exposedAttribute = substr($exposedAttribute, 1, -1) if substr($exposedAttribute, 0, 1) eq "(";
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Tools/ChangeLog        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-28 Sam Weinig <sam@webkit.org>
+
+ [WebIDL] Update parser and code generators to only access type information through the type property
+ https://bugs.webkit.org/show_bug.cgi?id=164141
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Update to always access type information through type accessors. Remove use of removed
+ properties.
+
</ins><span class="cx"> 2016-10-28 Frederic Wang <fwang@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Upgrade HarfBuzz to version 1.3.3
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -55,16 +55,16 @@
</span><span class="cx">
</span><span class="cx"> sub _className
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><del>- return "JS" . _implementationClassName($idlType);
</del><ins>+ return "JS" . _implementationClassName($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _classRefGetter
</span><span class="cx"> {
</span><del>- my ($self, $idlType) = @_;
</del><ins>+ my ($self, $type) = @_;
</ins><span class="cx">
</span><del>- return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($idlType)) . "Class";
</del><ins>+ return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($type)) . "Class";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _parseLicenseBlock
</span><span class="lines">@@ -142,9 +142,9 @@
</span><span class="cx">
</span><span class="cx"> my @contents = ();
</span><span class="cx">
</span><del>- my $idlType = $interface->type;
- my $className = _className($idlType);
- my $implementationClassName = _implementationClassName($idlType);
</del><ins>+ my $type = $interface->type;
+ my $className = _className($type);
+ my $implementationClassName = _implementationClassName($type);
</ins><span class="cx"> my $filename = $className . ".h";
</span><span class="cx">
</span><span class="cx"> push(@contents, $self->_licenseBlock());
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx">
</span><span class="cx"> class ${className} : public ${parentClassName} {
</span><span class="cx"> public:
</span><del>- static JSClassRef @{[$self->_classRefGetter($idlType)]}();
</del><ins>+ static JSClassRef @{[$self->_classRefGetter($type)]}();
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static const JSStaticFunction* staticFunctions();
</span><span class="lines">@@ -209,14 +209,14 @@
</span><span class="cx"> my %contentsIncludes = ();
</span><span class="cx"> my @contents = ();
</span><span class="cx">
</span><del>- my $idlType = $interface->type;
- my $className = _className($idlType);
- my $implementationClassName = _implementationClassName($idlType);
</del><ins>+ my $type = $interface->type;
+ my $className = _className($type);
+ my $implementationClassName = _implementationClassName($type);
</ins><span class="cx"> my $filename = $className . ".cpp";
</span><span class="cx">
</span><span class="cx"> push(@contentsPrefix, $self->_licenseBlock());
</span><span class="cx">
</span><del>- my $classRefGetter = $self->_classRefGetter($idlType);
</del><ins>+ my $classRefGetter = $self->_classRefGetter($type);
</ins><span class="cx"> my $parentClassName = _parentClassName($interface);
</span><span class="cx">
</span><span class="cx"> $contentsIncludes{"${className}.h"} = 1;
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx"> static JSClassRef jsClass;
</span><span class="cx"> if (!jsClass) {
</span><span class="cx"> JSClassDefinition definition = kJSClassDefinitionEmpty;
</span><del>- definition.className = "${idlType}";
</del><ins>+ definition.className = "${type}";
</ins><span class="cx"> definition.parentClass = @{[$self->_parentClassRefGetterExpression($interface)]};
</span><span class="cx"> definition.staticValues = staticValues();
</span><span class="cx"> definition.staticFunctions = staticFunctions();
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx"> my @parameters = ();
</span><span class="cx"> my @specifiedParameters = @{$function->parameters};
</span><span class="cx">
</span><del>- $self->_includeHeaders(\%contentsIncludes, $function->signature->idlType, $function->signature);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $function->signature->type, $function->signature);
</ins><span class="cx">
</span><span class="cx"> if ($function->signature->extendedAttributes->{"PassContext"}) {
</span><span class="cx"> push(@parameters, "context");
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx"> foreach my $i (0..$#specifiedParameters) {
</span><span class="cx"> my $parameter = $specifiedParameters[$i];
</span><span class="cx">
</span><del>- $self->_includeHeaders(\%contentsIncludes, $idlType, $parameter);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $type, $parameter);
</ins><span class="cx">
</span><span class="cx"> push(@contents, " " . $self->_platformTypeVariableDeclaration($parameter, $parameter->name, "arguments[$i]", "argumentCount > $i") . "\n");
</span><span class="cx">
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> $functionCall = "impl->" . $function->signature->name . "(" . join(", ", @parameters) . ")";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@contents, " ${functionCall};\n\n") if $function->signature->idlType->name eq "void";
</del><ins>+ push(@contents, " ${functionCall};\n\n") if $function->signature->type->name eq "void";
</ins><span class="cx"> push(@contents, " return " . $self->_returnExpression($function->signature, $functionCall) . ";\n}\n");
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> if (my @attributes = @{$interface->attributes}) {
</span><span class="cx"> push(@contents, "\n// Attributes\n");
</span><span class="cx"> foreach my $attribute (@attributes) {
</span><del>- $self->_includeHeaders(\%contentsIncludes, $attribute->signature->idlType, $attribute->signature);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $attribute->signature->type, $attribute->signature);
</ins><span class="cx">
</span><span class="cx"> my $getterName = $self->_getterName($attribute);
</span><span class="cx"> my $getterExpression = "impl->${getterName}()";
</span><span class="lines">@@ -373,23 +373,23 @@
</span><span class="cx">
</span><span class="cx"> sub _includeHeaders
</span><span class="cx"> {
</span><del>- my ($self, $headers, $idlType, $signature) = @_;
</del><ins>+ my ($self, $headers, $type, $signature) = @_;
</ins><span class="cx">
</span><del>- return unless defined $idlType;
- return if $idlType->name eq "boolean";
- return if $idlType->name eq "object";
- return if $$self{codeGenerator}->IsNonPointerType($idlType);
- return if $$self{codeGenerator}->IsStringType($idlType);
</del><ins>+ return unless defined $type;
+ return if $type->name eq "boolean";
+ return if $type->name eq "object";
+ return if $$self{codeGenerator}->IsNonPointerType($type);
+ return if $$self{codeGenerator}->IsStringType($type);
</ins><span class="cx">
</span><del>- $$headers{_className($idlType) . ".h"} = 1;
- $$headers{_implementationClassName($idlType) . ".h"} = 1;
</del><ins>+ $$headers{_className($type) . ".h"} = 1;
+ $$headers{_implementationClassName($type) . ".h"} = 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _implementationClassName
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><del>- return $idlType->name;
</del><ins>+ return $type->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _parentClassName
</span><span class="lines">@@ -416,15 +416,15 @@
</span><span class="cx">
</span><span class="cx"> sub _platformType
</span><span class="cx"> {
</span><del>- my ($self, $idlType, $signature) = @_;
</del><ins>+ my ($self, $type, $signature) = @_;
</ins><span class="cx">
</span><del>- return undef unless defined $idlType;
</del><ins>+ return undef unless defined $type;
</ins><span class="cx">
</span><del>- return "bool" if $idlType->name eq "boolean";
- return "JSValueRef" if $idlType->name eq "object";
- return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType);
- return "double" if $$self{codeGenerator}->IsNonPointerType($idlType);
- return _implementationClassName($idlType);
</del><ins>+ return "bool" if $type->name eq "boolean";
+ return "JSValueRef" if $type->name eq "object";
+ return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($type);
+ return "double" if $$self{codeGenerator}->IsNonPointerType($type);
+ return _implementationClassName($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _platformTypeConstructor
</span><span class="lines">@@ -431,13 +431,13 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $argumentName) = @_;
</span><span class="cx">
</span><del>- my $idlType = $signature->idlType;
</del><ins>+ my $type = $signature->type;
</ins><span class="cx">
</span><del>- return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean";
- return "$argumentName" if $idlType->name eq "object";
- return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
- return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType);
- return "to" . _implementationClassName($idlType) . "(context, $argumentName)";
</del><ins>+ return "JSValueToBoolean(context, $argumentName)" if $type eq "boolean";
+ return "$argumentName" if $type->name eq "object";
+ return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($type);
+ return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($type);
+ return "to" . _implementationClassName($type) . "(context, $argumentName)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _platformTypeVariableDeclaration
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</span><span class="cx">
</span><del>- my $platformType = $self->_platformType($signature->idlType, $signature);
</del><ins>+ my $platformType = $self->_platformType($signature->type, $signature);
</ins><span class="cx"> my $constructor = $self->_platformTypeConstructor($signature, $argumentName);
</span><span class="cx">
</span><span class="cx"> my %nonPointerTypes = (
</span><span class="lines">@@ -472,13 +472,13 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $expression) = @_;
</span><span class="cx">
</span><del>- my $returnIDLType = $signature->idlType;
</del><ins>+ my $returnType = $signature->type;
</ins><span class="cx">
</span><del>- return "JSValueMakeUndefined(context)" if $returnIDLType->name eq "void";
- return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType->name eq "boolean";
- return "${expression}" if $returnIDLType->name eq "object";
- return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType);
- return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnIDLType);
</del><ins>+ return "JSValueMakeUndefined(context)" if $returnType->name eq "void";
+ return "JSValueMakeBoolean(context, ${expression})" if $returnType->name eq "boolean";
+ return "${expression}" if $returnType->name eq "object";
+ return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnType);
+ return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnType);
</ins><span class="cx"> return "toJS(context, WTF::getPtr(${expression}))";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -486,10 +486,10 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $parameter) = @_;
</span><span class="cx">
</span><del>- my $idlType = $parameter->idlType;
</del><ins>+ my $type = $parameter->type;
</ins><span class="cx"> my $name = $parameter->name;
</span><span class="cx">
</span><del>- return "${name}.get()" if $$self{codeGenerator}->IsStringType($idlType);
</del><ins>+ return "${name}.get()" if $$self{codeGenerator}->IsStringType($type);
</ins><span class="cx"> return $name;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm (208065 => 208066)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-28 20:45:22 UTC (rev 208065)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm        2016-10-28 20:53:03 UTC (rev 208066)
</span><span class="lines">@@ -69,17 +69,17 @@
</span><span class="cx">
</span><span class="cx"> sub _className
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><del>- assert("Not a type") if ref($idlType) ne "domType";
</del><ins>+ assert("Not a type") if ref($type) ne "domType";
</ins><span class="cx">
</span><del>- return "JS" . _implementationClassName($idlType);
</del><ins>+ return "JS" . _implementationClassName($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _classRefGetter
</span><span class="cx"> {
</span><del>- my ($self, $idlType) = @_;
- return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($idlType)) . "Class";
</del><ins>+ my ($self, $type) = @_;
+ return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($type)) . "Class";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _parseLicenseBlock
</span><span class="lines">@@ -157,9 +157,9 @@
</span><span class="cx">
</span><span class="cx"> my @contents = ();
</span><span class="cx">
</span><del>- my $idlType = $interface->type;
- my $className = _className($idlType);
- my $implementationClassName = _implementationClassName($idlType);
</del><ins>+ my $type = $interface->type;
+ my $className = _className($type);
+ my $implementationClassName = _implementationClassName($type);
</ins><span class="cx"> my $filename = $className . ".h";
</span><span class="cx">
</span><span class="cx"> push(@contents, $self->_licenseBlock());
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">
</span><span class="cx"> class ${className} : public ${parentClassName} {
</span><span class="cx"> public:
</span><del>- static JSClassRef @{[$self->_classRefGetter($idlType)]}();
</del><ins>+ static JSClassRef @{[$self->_classRefGetter($type)]}();
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static const JSStaticFunction* staticFunctions();
</span><span class="lines">@@ -224,14 +224,14 @@
</span><span class="cx"> my %contentsIncludes = ();
</span><span class="cx"> my @contents = ();
</span><span class="cx">
</span><del>- my $idlType = $interface->type;
- my $className = _className($idlType);
- my $implementationClassName = _implementationClassName($idlType);
</del><ins>+ my $type = $interface->type;
+ my $className = _className($type);
+ my $implementationClassName = _implementationClassName($type);
</ins><span class="cx"> my $filename = $className . ".cpp";
</span><span class="cx">
</span><span class="cx"> push(@contentsPrefix, $self->_licenseBlock());
</span><span class="cx">
</span><del>- my $classRefGetter = $self->_classRefGetter($idlType);
</del><ins>+ my $classRefGetter = $self->_classRefGetter($type);
</ins><span class="cx"> my $parentClassName = _parentClassName($interface);
</span><span class="cx">
</span><span class="cx"> $contentsIncludes{"${className}.h"} = 1;
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx"> static JSClassRef jsClass;
</span><span class="cx"> if (!jsClass) {
</span><span class="cx"> JSClassDefinition definition = kJSClassDefinitionEmpty;
</span><del>- definition.className = "@{[$idlType->name]}";
</del><ins>+ definition.className = "@{[$type->name]}";
</ins><span class="cx"> definition.parentClass = @{[$self->_parentClassRefGetterExpression($interface)]};
</span><span class="cx"> definition.staticValues = staticValues();
</span><span class="cx"> definition.staticFunctions = staticFunctions();
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx"> my @parameters = ();
</span><span class="cx"> my @specifiedParameters = @{$function->parameters};
</span><span class="cx">
</span><del>- $self->_includeHeaders(\%contentsIncludes, $function->signature->idlType, $function->signature);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $function->signature->type, $function->signature);
</ins><span class="cx">
</span><span class="cx"> if ($function->signature->extendedAttributes->{"PassContext"}) {
</span><span class="cx"> push(@parameters, "context");
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx"> foreach my $i (0..$#specifiedParameters) {
</span><span class="cx"> my $parameter = $specifiedParameters[$i];
</span><span class="cx">
</span><del>- $self->_includeHeaders(\%contentsIncludes, $idlType, $parameter);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $type, $parameter);
</ins><span class="cx">
</span><span class="cx"> push(@contents, " " . $self->_platformTypeVariableDeclaration($parameter, $parameter->name, "arguments[$i]", "argumentCount > $i") . "\n");
</span><span class="cx">
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx"> $functionCall = "impl->" . $function->signature->name . "(" . join(", ", @parameters) . ")";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@contents, " ${functionCall};\n\n") if $function->signature->idlType->name eq "void";
</del><ins>+ push(@contents, " ${functionCall};\n\n") if $function->signature->type->name eq "void";
</ins><span class="cx"> push(@contents, " return " . $self->_returnExpression($function->signature, $functionCall) . ";\n}\n");
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx"> if (my @attributes = @{$interface->attributes}) {
</span><span class="cx"> push(@contents, "\n// Attributes\n");
</span><span class="cx"> foreach my $attribute (@attributes) {
</span><del>- $self->_includeHeaders(\%contentsIncludes, $attribute->signature->idlType, $attribute->signature);
</del><ins>+ $self->_includeHeaders(\%contentsIncludes, $attribute->signature->type, $attribute->signature);
</ins><span class="cx">
</span><span class="cx"> my $getterName = $self->_getterName($attribute);
</span><span class="cx"> my $getterExpression = "impl->${getterName}()";
</span><span class="lines">@@ -388,23 +388,23 @@
</span><span class="cx">
</span><span class="cx"> sub _includeHeaders
</span><span class="cx"> {
</span><del>- my ($self, $headers, $idlType, $signature) = @_;
</del><ins>+ my ($self, $headers, $type, $signature) = @_;
</ins><span class="cx">
</span><del>- return unless defined $idlType;
- return if $idlType->name eq "boolean";
- return if $idlType->name eq "object";
- return if $$self{codeGenerator}->IsNonPointerType($idlType);
- return if $$self{codeGenerator}->IsStringType($idlType);
</del><ins>+ return unless defined $type;
+ return if $type->name eq "boolean";
+ return if $type->name eq "object";
+ return if $$self{codeGenerator}->IsNonPointerType($type);
+ return if $$self{codeGenerator}->IsStringType($type);
</ins><span class="cx">
</span><del>- $$headers{_className($idlType) . ".h"} = 1;
- $$headers{_implementationClassName($idlType) . ".h"} = 1;
</del><ins>+ $$headers{_className($type) . ".h"} = 1;
+ $$headers{_implementationClassName($type) . ".h"} = 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _implementationClassName
</span><span class="cx"> {
</span><del>- my ($idlType) = @_;
</del><ins>+ my ($type) = @_;
</ins><span class="cx">
</span><del>- return $idlType->name;
</del><ins>+ return $type->name;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _parentClassName
</span><span class="lines">@@ -431,15 +431,15 @@
</span><span class="cx">
</span><span class="cx"> sub _platformType
</span><span class="cx"> {
</span><del>- my ($self, $idlType, $signature) = @_;
</del><ins>+ my ($self, $type, $signature) = @_;
</ins><span class="cx">
</span><del>- return undef unless defined $idlType;
</del><ins>+ return undef unless defined $type;
</ins><span class="cx">
</span><del>- return "bool" if $idlType->name eq "boolean";
- return "JSValueRef" if $idlType->name eq "object";
- return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType);
- return "double" if $$self{codeGenerator}->IsNonPointerType($idlType);
- return _implementationClassName($idlType);
</del><ins>+ return "bool" if $type->name eq "boolean";
+ return "JSValueRef" if $type->name eq "object";
+ return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($type);
+ return "double" if $$self{codeGenerator}->IsNonPointerType($type);
+ return _implementationClassName($type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _platformTypeConstructor
</span><span class="lines">@@ -446,13 +446,13 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $argumentName) = @_;
</span><span class="cx">
</span><del>- my $idlType = $signature->idlType;
</del><ins>+ my $type = $signature->type;
</ins><span class="cx">
</span><del>- return "JSValueToBoolean(context, $argumentName)" if $idlType->name eq "boolean";
- return "$argumentName" if $idlType->name eq "object";
- return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
- return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType);
- return "to" . _implementationClassName($idlType) . "(context, $argumentName)";
</del><ins>+ return "JSValueToBoolean(context, $argumentName)" if $type->name eq "boolean";
+ return "$argumentName" if $type->name eq "object";
+ return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($type);
+ return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($type);
+ return "to" . _implementationClassName($type) . "(context, $argumentName)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub _platformTypeVariableDeclaration
</span><span class="lines">@@ -459,7 +459,7 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $variableName, $argumentName, $condition) = @_;
</span><span class="cx">
</span><del>- my $platformType = $self->_platformType($signature->idlType, $signature);
</del><ins>+ my $platformType = $self->_platformType($signature->type, $signature);
</ins><span class="cx"> my $constructor = $self->_platformTypeConstructor($signature, $argumentName);
</span><span class="cx">
</span><span class="cx"> my %nonPointerTypes = (
</span><span class="lines">@@ -487,13 +487,13 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $signature, $expression) = @_;
</span><span class="cx">
</span><del>- my $returnIDLType = $signature->idlType;
</del><ins>+ my $returnType = $signature->type;
</ins><span class="cx">
</span><del>- return "JSValueMakeUndefined(context)" if $returnIDLType->name eq "void";
- return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType->name eq "boolean";
- return "${expression}" if $returnIDLType->name eq "object";
- return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType);
- return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnIDLType);
</del><ins>+ return "JSValueMakeUndefined(context)" if $returnType->name eq "void";
+ return "JSValueMakeBoolean(context, ${expression})" if $returnType->name eq "boolean";
+ return "${expression}" if $returnType->name eq "object";
+ return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnType);
+ return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnType);
</ins><span class="cx"> return "toJS(context, WTF::getPtr(${expression}))";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -501,10 +501,10 @@
</span><span class="cx"> {
</span><span class="cx"> my ($self, $parameter) = @_;
</span><span class="cx">
</span><del>- my $idlType = $parameter->idlType;
</del><ins>+ my $type = $parameter->type;
</ins><span class="cx"> my $name = $parameter->name;
</span><span class="cx">
</span><del>- return "${name}.get()" if $$self{codeGenerator}->IsStringType($idlType);
</del><ins>+ return "${name}.get()" if $$self{codeGenerator}->IsStringType($type);
</ins><span class="cx"> return $name;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>