<!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>[160793] trunk/Source/WebCore</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/160793">160793</a></dd>
<dt>Author</dt> <dd>oliver@apple.com</dd>
<dt>Date</dt> <dd>2013-12-18 13:08:35 -0800 (Wed, 18 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Refactor CodeGeneratorJS - Move attribute function creation out of getOwnPropertyName guard
https://bugs.webkit.org/show_bug.cgi?id=125940
Reviewed by Simon Fraser.
This is just a huge block move of code out from behind the
ImplementationOverridesGetOwnProperty guard.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160792 => 160793)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-18 21:03:14 UTC (rev 160792)
+++ trunk/Source/WebCore/ChangeLog        2013-12-18 21:08:35 UTC (rev 160793)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2013-12-18 Oliver Hunt <oliver@apple.com>
+
+ Refactor CodeGeneratorJS - Move attribute function creation out of getOwnPropertyName guard
+ https://bugs.webkit.org/show_bug.cgi?id=125940
+
+ Reviewed by Simon Fraser.
+
+ This is just a huge block move of code out from behind the
+ ImplementationOverridesGetOwnProperty guard.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+
</ins><span class="cx"> 2013-12-18 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Frequent ASSERT(hasOneRef()) in SharedBuffer::releasePurgeableBuffer
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (160792 => 160793)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2013-12-18 21:03:14 UTC (rev 160792)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2013-12-18 21:08:35 UTC (rev 160793)
</span><span class="lines">@@ -1874,200 +1874,201 @@
</span><span class="cx"> push(@implContent, "}\n\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($numAttributes > 0) {
- foreach my $attribute (@{$interface->attributes}) {
- my $name = $attribute->signature->name;
- my $type = $attribute->signature->type;
- my $isNullable = $attribute->signature->isNullable;
- $codeGenerator->AssertNotSequenceType($type);
- my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute);
- my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{"ImplementedAs"} || $name);
</del><ins>+ }
+ if ($numAttributes > 0) {
+ foreach my $attribute (@{$interface->attributes}) {
+ my $name = $attribute->signature->name;
+ my $type = $attribute->signature->type;
+ my $isNullable = $attribute->signature->isNullable;
+ $codeGenerator->AssertNotSequenceType($type);
+ my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute);
+ my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{"ImplementedAs"} || $name);
</ins><span class="cx">
</span><del>- my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
- push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
</del><ins>+ my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
+ push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
</ins><span class="cx">
</span><del>- push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n");
- push(@implContent, "{\n");
</del><ins>+ push(@implContent, "EncodedJSValue ${getFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n");
+ push(@implContent, "{\n");
</ins><span class="cx">
</span><del>- if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
- push(@implContent, " ${className}* castedThis = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n");
- } else {
- push(@implContent, " UNUSED_PARAM(slotBase);\n");
</del><ins>+ if (!$attribute->isStatic || $attribute->signature->type =~ /Constructor$/) {
+ push(@implContent, " ${className}* castedThis = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n");
+ } else {
+ push(@implContent, " UNUSED_PARAM(slotBase);\n");
+ }
+
+ # Global constructors can be disabled at runtime.
+ if ($attribute->signature->type =~ /Constructor$/) {
+ if ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+ AddToImplIncludes("RuntimeEnabledFeatures.h");
+ my $enable_function = GetRuntimeEnableFunctionName($attribute->signature);
+ push(@implContent, " if (!${enable_function}())\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ } elsif ($attribute->signature->extendedAttributes->{"EnabledBySetting"}) {
+ AddToImplIncludes("Frame.h");
+ AddToImplIncludes("Settings.h");
+ my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled";
+ push(@implContent, " if (!castedThis->impl().frame())\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " Settings& settings = castedThis->impl().frame()->settings();\n");
+ push(@implContent, " if (!settings.$enable_function())\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
</ins><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><del>- # Global constructors can be disabled at runtime.
- if ($attribute->signature->type =~ /Constructor$/) {
- if ($attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
- AddToImplIncludes("RuntimeEnabledFeatures.h");
- my $enable_function = GetRuntimeEnableFunctionName($attribute->signature);
- push(@implContent, " if (!${enable_function}())\n");
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- } elsif ($attribute->signature->extendedAttributes->{"EnabledBySetting"}) {
- AddToImplIncludes("Frame.h");
- AddToImplIncludes("Settings.h");
- my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled";
- push(@implContent, " if (!castedThis->impl().frame())\n");
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- push(@implContent, " Settings& settings = castedThis->impl().frame()->settings();\n");
- push(@implContent, " if (!settings.$enable_function())\n");
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- }
</del><ins>+ if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
+ $needsMarkChildren = 1;
+ }
+
+ if ($interface->extendedAttributes->{"CheckSecurity"} &&
+ !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
+ !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
+ push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ }
+
+ if (HasCustomGetter($attribute->signature->extendedAttributes)) {
+ push(@implContent, " return JSValue::encode(castedThis->$implGetterFunctionName(exec));\n");
+ } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
+ $implIncludes{"JSDOMBinding.h"} = 1;
+ push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
+ push(@implContent, " return JSValue::encode(shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n");
+ } elsif ($type eq "EventListener") {
+ $implIncludes{"EventListener.h"} = 1;
+ push(@implContent, " UNUSED_PARAM(exec);\n");
+ push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
+ push(@implContent, " if (EventListener* listener = impl.$implGetterFunctionName()) {\n");
+ push(@implContent, " if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
+ if ($interfaceName eq "Document" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
+ push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(&impl))\n");
+ } else {
+ push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))\n");
</ins><span class="cx"> }
</span><ins>+ push(@implContent, " return JSValue::encode(jsFunction);\n");
+ push(@implContent, " }\n");
+ push(@implContent, " }\n");
+ push(@implContent, " return JSValue::encode(jsNull());\n");
+ } elsif ($attribute->signature->type =~ /Constructor$/) {
+ my $constructorType = $attribute->signature->type;
+ $constructorType =~ s/Constructor$//;
+ # When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThis as the global object
+ # When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
+ if ($interfaceName eq "DOMWindow") {
+ my $named = ($constructorType =~ /Named$/) ? "Named" : "";
+ $constructorType =~ s/Named$//;
+ push(@implContent, " return JSValue::encode(JS" . $constructorType . "::get${named}Constructor(exec->vm(), castedThis));\n");
+ } else {
+ AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"});
+ push(@implContent, " return JSValue::encode(JS" . $constructorType . "::getConstructor(exec->vm(), castedThis->globalObject()));\n");
+ }
+ } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"}) {
+ push(@implContent, " UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
+ push(@implContent, " bool isNull = false;\n") if $isNullable;
</ins><span class="cx">
</span><ins>+ my $cacheIndex = 0;
</ins><span class="cx"> if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
</span><del>- $needsMarkChildren = 1;
</del><ins>+ $cacheIndex = $currentCachedAttribute;
+ $currentCachedAttribute++;
+ push(@implContent, " if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
+ push(@implContent, " return JSValue::encode(cachedValue);\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if ($interface->extendedAttributes->{"CheckSecurity"} &&
- !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
- !$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
- push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl()))\n");
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- }
</del><ins>+ my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())");
</ins><span class="cx">
</span><del>- if (HasCustomGetter($attribute->signature->extendedAttributes)) {
- push(@implContent, " return JSValue::encode(castedThis->$implGetterFunctionName(exec));\n");
- } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
- $implIncludes{"JSDOMBinding.h"} = 1;
- push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
- push(@implContent, " return JSValue::encode(shouldAllowAccessToNode(exec, impl." . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName()", "castedThis") . " : jsNull());\n");
- } elsif ($type eq "EventListener") {
- $implIncludes{"EventListener.h"} = 1;
- push(@implContent, " UNUSED_PARAM(exec);\n");
- push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
- push(@implContent, " if (EventListener* listener = impl.$implGetterFunctionName()) {\n");
- push(@implContent, " if (const JSEventListener* jsListener = JSEventListener::cast(listener)) {\n");
- if ($interfaceName eq "Document" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
- push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(&impl))\n");
</del><ins>+ if ($svgListPropertyType) {
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
+ } elsif ($svgPropertyOrListPropertyType) {
+ push(@implContent, " $svgPropertyOrListPropertyType& impl = castedThis->impl().propertyReference();\n");
+ if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl", "castedThis") . ";\n");
</ins><span class="cx"> } else {
</span><del>- push(@implContent, " if (JSObject* jsFunction = jsListener->jsFunction(impl.scriptExecutionContext()))\n");
- }
- push(@implContent, " return JSValue::encode(jsFunction);\n");
- push(@implContent, " }\n");
- push(@implContent, " }\n");
- push(@implContent, " return JSValue::encode(jsNull());\n");
- } elsif ($attribute->signature->type =~ /Constructor$/) {
- my $constructorType = $attribute->signature->type;
- $constructorType =~ s/Constructor$//;
- # When Constructor attribute is used by DOMWindow.idl, it's correct to pass castedThis as the global object
- # When JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
- if ($interfaceName eq "DOMWindow") {
- my $named = ($constructorType =~ /Named$/) ? "Named" : "";
- $constructorType =~ s/Named$//;
- push(@implContent, " return JSValue::encode(JS" . $constructorType . "::get${named}Constructor(exec->vm(), castedThis));\n");
- } else {
- AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"});
- push(@implContent, " return JSValue::encode(JS" . $constructorType . "::getConstructor(exec->vm(), castedThis->globalObject()));\n");
- }
- } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"}) {
- push(@implContent, " UNUSED_PARAM(exec);\n") if !$attribute->signature->extendedAttributes->{"CallWith"};
- push(@implContent, " bool isNull = false;\n") if $isNullable;
</del><ins>+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
</ins><span class="cx">
</span><del>- my $cacheIndex = 0;
- if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
- $cacheIndex = $currentCachedAttribute;
- $currentCachedAttribute++;
- push(@implContent, " if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
- push(@implContent, " return JSValue::encode(cachedValue);\n");
</del><span class="cx"> }
</span><del>-
- my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())");
-
- if ($svgListPropertyType) {
- push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl().$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
- } elsif ($svgPropertyOrListPropertyType) {
- push(@implContent, " $svgPropertyOrListPropertyType& impl = castedThis->impl().propertyReference();\n");
- if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
- push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl", "castedThis") . ";\n");
- } else {
- push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
-
- }
</del><ins>+ } else {
+ my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
+ push(@arguments, "isNull") if $isNullable;
+ if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ $functionName = "${implementedBy}::${functionName}";
+ unshift(@arguments, "&impl") if !$attribute->isStatic;
+ } elsif ($attribute->isStatic) {
+ $functionName = "${interfaceName}::${functionName}";
</ins><span class="cx"> } else {
</span><del>- my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
- push(@arguments, "isNull") if $isNullable;
- if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
- my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
- $implIncludes{"${implementedBy}.h"} = 1;
- $functionName = "${implementedBy}::${functionName}";
- unshift(@arguments, "&impl") if !$attribute->isStatic;
- } elsif ($attribute->isStatic) {
- $functionName = "${interfaceName}::${functionName}";
- } else {
- $functionName = "impl.${functionName}";
- }
-
- unshift(@arguments, @callWithArgs);
- my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
- push(@implContent, " $interfaceName& impl = castedThis->impl();\n") if !$attribute->isStatic;
- if ($codeGenerator->IsSVGAnimatedType($type)) {
- push(@implContent, " RefPtr<$type> obj = $jsType;\n");
- push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n");
- } else {
- push(@implContent, " JSValue result = $jsType;\n");
- }
-
- if ($isNullable) {
- push(@implContent, " if (isNull)\n");
- push(@implContent, " return JSValue::encode(jsNull());\n");
- }
</del><ins>+ $functionName = "impl.${functionName}";
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(exec->vm(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
- push(@implContent, " return JSValue::encode(result);\n");
-
- } else {
- my @arguments = ("ec");
- push(@implContent, " ExceptionCode ec = 0;\n");
-
- if ($isNullable) {
- push(@implContent, " bool isNull = false;\n");
- unshift(@arguments, "isNull");
- }
-
- unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())"));
-
- if ($svgPropertyOrListPropertyType) {
- push(@implContent, " $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
- push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
</del><ins>+ unshift(@arguments, @callWithArgs);
+ my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
+ push(@implContent, " $interfaceName& impl = castedThis->impl();\n") if !$attribute->isStatic;
+ if ($codeGenerator->IsSVGAnimatedType($type)) {
+ push(@implContent, " RefPtr<$type> obj = $jsType;\n");
+ push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n");
</ins><span class="cx"> } else {
</span><del>- push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
- push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
</del><ins>+ push(@implContent, " JSValue result = $jsType;\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($isNullable) {
</span><span class="cx"> push(@implContent, " if (isNull)\n");
</span><span class="cx"> push(@implContent, " return JSValue::encode(jsNull());\n");
</span><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><del>- push(@implContent, " setDOMException(exec, ec);\n");
- push(@implContent, " return JSValue::encode(result);\n");
</del><ins>+ push(@implContent, " castedThis->m_" . $attribute->signature->name . ".set(exec->vm(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
+ push(@implContent, " return JSValue::encode(result);\n");
+
+ } else {
+ my @arguments = ("ec");
+ push(@implContent, " ExceptionCode ec = 0;\n");
+
+ if ($isNullable) {
+ push(@implContent, " bool isNull = false;\n");
+ unshift(@arguments, "isNull");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- push(@implContent, "}\n\n");
</del><ins>+ unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "JSValue::encode(jsUndefined())"));
</ins><span class="cx">
</span><del>- push(@implContent, "#endif\n") if $attributeConditionalString;
</del><ins>+ if ($svgPropertyOrListPropertyType) {
+ push(@implContent, " $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
+ push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+ } else {
+ push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
+ push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
+ }
</ins><span class="cx">
</span><del>- push(@implContent, "\n");
</del><ins>+ if ($isNullable) {
+ push(@implContent, " if (isNull)\n");
+ push(@implContent, " return JSValue::encode(jsNull());\n");
+ }
+
+ push(@implContent, " setDOMException(exec, ec);\n");
+ push(@implContent, " return JSValue::encode(result);\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
- my $constructorFunctionName = "js" . $interfaceName . "Constructor";
</del><ins>+ push(@implContent, "}\n\n");
</ins><span class="cx">
</span><del>- push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n");
- push(@implContent, "{\n");
- push(@implContent, " ${className}* domObject = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n");
</del><ins>+ push(@implContent, "#endif\n") if $attributeConditionalString;
</ins><span class="cx">
</span><del>- if ($interface->extendedAttributes->{"CheckSecurity"}) {
- push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, domObject->impl()))\n");
- push(@implContent, " return JSValue::encode(jsUndefined());\n");
- }
</del><ins>+ push(@implContent, "\n");
+ }
</ins><span class="cx">
</span><del>- push(@implContent, " return JSValue::encode(${className}::getConstructor(exec->vm(), domObject->globalObject()));\n");
- push(@implContent, "}\n\n");
</del><ins>+ if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+ my $constructorFunctionName = "js" . $interfaceName . "Constructor";
+
+ push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " ${className}* domObject = jsDynamicCast<$className*>(JSValue::decode(slotBase));\n");
+
+ if ($interface->extendedAttributes->{"CheckSecurity"}) {
+ push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, domObject->impl()))\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
</ins><span class="cx"> }
</span><ins>+
+ push(@implContent, " return JSValue::encode(${className}::getConstructor(exec->vm(), domObject->globalObject()));\n");
+ push(@implContent, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> # Check if we have any writable attributes
</span><span class="cx"> my $hasReadWriteProperties = 0;
</span><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="lines">@@ -2075,8 +2076,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $hasSetter = $hasReadWriteProperties
</span><del>- || $interface->extendedAttributes->{"CustomNamedSetter"}
- || $interface->extendedAttributes->{"CustomIndexedSetter"};
</del><ins>+ || $interface->extendedAttributes->{"CustomNamedSetter"}
+ || $interface->extendedAttributes->{"CustomIndexedSetter"};
</ins><span class="cx">
</span><span class="cx"> if ($hasSetter) {
</span><span class="cx"> if (!$interface->extendedAttributes->{"CustomPutFunction"}) {
</span><span class="lines">@@ -2102,7 +2103,7 @@
</span><span class="cx"> push(@implContent, " Base::put(thisObject, exec, propertyName, value, slot);\n");
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, "}\n\n");
</span><del>-
</del><ins>+
</ins><span class="cx"> if ($interface->extendedAttributes->{"CustomIndexedSetter"} || $interface->extendedAttributes->{"CustomNamedSetter"}) {
</span><span class="cx"> push(@implContent, "void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="lines">@@ -2115,14 +2116,14 @@
</span><span class="cx"> push(@implContent, " return;\n");
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if ($interface->extendedAttributes->{"CustomNamedSetter"}) {
</span><span class="cx"> push(@implContent, " PropertyName propertyName = Identifier::from(exec, index);\n");
</span><span class="cx"> push(@implContent, " PutPropertySlot slot(shouldThrow);\n");
</span><span class="cx"> push(@implContent, " if (thisObject->putDelegate(exec, propertyName, value, slot))\n");
</span><span class="cx"> push(@implContent, " return;\n");
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> push(@implContent, " Base::putByIndex(cell, exec, index, value, shouldThrow);\n");
</span><span class="cx"> push(@implContent, "}\n\n");
</span><span class="cx"> }
</span><span class="lines">@@ -2145,141 +2146,141 @@
</span><span class="cx"> push(@implContent, ", JSValue value)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx">
</span><del>- push(@implContent, " UNUSED_PARAM(exec);\n");
</del><ins>+ push(@implContent, " UNUSED_PARAM(exec);\n");
</ins><span class="cx">
</span><del>- if ($interface->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
- if ($interfaceName eq "DOMWindow") {
- push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
- } else {
- push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
- }
- push(@implContent, " return;\n");
</del><ins>+ if ($interface->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
+ if ($interfaceName eq "DOMWindow") {
+ push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
+ } else {
+ push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
</ins><span class="cx"> }
</span><ins>+ push(@implContent, " return;\n");
+ }
</ins><span class="cx">
</span><del>- if (HasCustomSetter($attribute->signature->extendedAttributes)) {
- push(@implContent, " jsCast<$className*>(thisObject)->set$implSetterFunctionName(exec, value);\n");
- } elsif ($type eq "EventListener") {
- $implIncludes{"JSEventListener.h"} = 1;
- push(@implContent, " UNUSED_PARAM(exec);\n");
- push(@implContent, " ${className}* castedThis = jsCast<${className}*>(thisObject);\n");
- my $windowEventListener = $attribute->signature->extendedAttributes->{"JSWindowEventListener"};
- if ($windowEventListener) {
- push(@implContent, " JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
- }
- push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
- if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerGlobalScope")) and $name eq "onerror") {
- $implIncludes{"JSErrorHandler.h"} = 1;
- push(@implContent, " impl.set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
- } else {
- push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener));
- }
- } elsif ($attribute->signature->type =~ /Constructor$/) {
- my $constructorType = $attribute->signature->type;
- $constructorType =~ s/Constructor$//;
- # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
- # We do not generate the header file for NamedConstructor of class XXXX,
- # since we generate the NamedConstructor declaration into the header file of class XXXX.
- if ($constructorType ne "any" and $constructorType !~ /Named$/) {
- AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"});
- }
- push(@implContent, " // Shadowing a built-in constructor\n");
- if ($interfaceName eq "DOMWindow" && $className eq "JSblah") {
- # FIXME: This branch never executes and should be removed.
- push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), exec->propertyNames().constructor, value);\n");
- } else {
- push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), Identifier(exec, \"$name\"), value);\n");
- }
- } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
- push(@implContent, " // Shadowing a built-in object\n");
</del><ins>+ if (HasCustomSetter($attribute->signature->extendedAttributes)) {
+ push(@implContent, " jsCast<$className*>(thisObject)->set$implSetterFunctionName(exec, value);\n");
+ } elsif ($type eq "EventListener") {
+ $implIncludes{"JSEventListener.h"} = 1;
+ push(@implContent, " UNUSED_PARAM(exec);\n");
+ push(@implContent, " ${className}* castedThis = jsCast<${className}*>(thisObject);\n");
+ my $windowEventListener = $attribute->signature->extendedAttributes->{"JSWindowEventListener"};
+ if ($windowEventListener) {
+ push(@implContent, " JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
+ }
+ push(@implContent, " $interfaceName& impl = castedThis->impl();\n");
+ if ((($interfaceName eq "DOMWindow") or ($interfaceName eq "WorkerGlobalScope")) and $name eq "onerror") {
+ $implIncludes{"JSErrorHandler.h"} = 1;
+ push(@implContent, " impl.set$implSetterFunctionName(createJSErrorHandler(exec, value, thisObject));\n");
+ } else {
+ push(@implContent, GenerateAttributeEventListenerCall($className, $implSetterFunctionName, $windowEventListener));
+ }
+ } elsif ($attribute->signature->type =~ /Constructor$/) {
+ my $constructorType = $attribute->signature->type;
+ $constructorType =~ s/Constructor$//;
+ # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
+ # We do not generate the header file for NamedConstructor of class XXXX,
+ # since we generate the NamedConstructor declaration into the header file of class XXXX.
+ if ($constructorType ne "any" and $constructorType !~ /Named$/) {
+ AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"});
+ }
+ push(@implContent, " // Shadowing a built-in constructor\n");
+ if ($interfaceName eq "DOMWindow" && $className eq "JSblah") {
+ # FIXME: This branch never executes and should be removed.
+ push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), exec->propertyNames().constructor, value);\n");
+ } else {
</ins><span class="cx"> push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), Identifier(exec, \"$name\"), value);\n");
</span><del>- } else {
- if (!$attribute->isStatic) {
- push(@implContent, " $className* castedThis = jsCast<$className*>(thisObject);\n");
- push(@implContent, " $implType& impl = castedThis->impl();\n");
- }
- push(@implContent, " ExceptionCode ec = 0;\n") if $setterRaisesException;
</del><ins>+ }
+ } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
+ push(@implContent, " // Shadowing a built-in object\n");
+ push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), Identifier(exec, \"$name\"), value);\n");
+ } else {
+ if (!$attribute->isStatic) {
+ push(@implContent, " $className* castedThis = jsCast<$className*>(thisObject);\n");
+ push(@implContent, " $implType& impl = castedThis->impl();\n");
+ }
+ push(@implContent, " ExceptionCode ec = 0;\n") if $setterRaisesException;
</ins><span class="cx">
</span><del>- # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
- # interface type, then if the incoming value does not implement that interface, a TypeError
- # is thrown rather than silently passing NULL to the C++ code.
- # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to
- # both strings and numbers, so do not throw TypeError if the attribute is of these types.
- if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
- $implIncludes{"<runtime/Error.h>"} = 1;
</del><ins>+ # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
+ # interface type, then if the incoming value does not implement that interface, a TypeError
+ # is thrown rather than silently passing NULL to the C++ code.
+ # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to
+ # both strings and numbers, so do not throw TypeError if the attribute is of these types.
+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
</ins><span class="cx">
</span><del>- my $argType = $attribute->signature->type;
- if ($codeGenerator->IsWrapperType($argType)) {
- push(@implContent, " if (!value.isUndefinedOrNull() && !value.inherits(JS${argType}::info())) {\n");
- push(@implContent, " throwVMTypeError(exec);\n");
- push(@implContent, " return;\n");
- push(@implContent, " };\n");
- }
</del><ins>+ my $argType = $attribute->signature->type;
+ if ($codeGenerator->IsWrapperType($argType)) {
+ push(@implContent, " if (!value.isUndefinedOrNull() && !value.inherits(JS${argType}::info())) {\n");
+ push(@implContent, " throwVMTypeError(exec);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " };\n");
</ins><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><del>- push(@implContent, " " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue(" . JSValueToNative($attribute->signature, "value") . ");\n");
- push(@implContent, " if (exec->hadException())\n");
- push(@implContent, " return;\n");
</del><ins>+ push(@implContent, " " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue(" . JSValueToNative($attribute->signature, "value") . ");\n");
+ push(@implContent, " if (exec->hadException())\n");
+ push(@implContent, " return;\n");
</ins><span class="cx">
</span><del>- if ($codeGenerator->IsEnumType($type)) {
- my @enumValues = $codeGenerator->ValidEnumValues($type);
- my @enumChecks = ();
- foreach my $enumValue (@enumValues) {
- push(@enumChecks, "nativeValue != \"$enumValue\"");
- }
- push (@implContent, " if (" . join(" && ", @enumChecks) . ")\n");
- push (@implContent, " return;\n");
</del><ins>+ if ($codeGenerator->IsEnumType($type)) {
+ my @enumValues = $codeGenerator->ValidEnumValues($type);
+ my @enumChecks = ();
+ foreach my $enumValue (@enumValues) {
+ push(@enumChecks, "nativeValue != \"$enumValue\"");
</ins><span class="cx"> }
</span><ins>+ push (@implContent, " if (" . join(" && ", @enumChecks) . ")\n");
+ push (@implContent, " return;\n");
+ }
</ins><span class="cx">
</span><del>- if ($svgPropertyOrListPropertyType) {
- if ($svgPropertyType) {
- push(@implContent, " if (impl.isReadOnly()) {\n");
- push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
- push(@implContent, " return;\n");
- push(@implContent, " }\n");
- $implIncludes{"ExceptionCode.h"} = 1;
- }
- push(@implContent, " $svgPropertyOrListPropertyType& podImpl = impl.propertyReference();\n");
- if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
- push(@implContent, " podImpl = nativeValue;\n");
</del><ins>+ if ($svgPropertyOrListPropertyType) {
+ if ($svgPropertyType) {
+ push(@implContent, " if (impl.isReadOnly()) {\n");
+ push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " }\n");
+ $implIncludes{"ExceptionCode.h"} = 1;
+ }
+ push(@implContent, " $svgPropertyOrListPropertyType& podImpl = impl.propertyReference();\n");
+ if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
+ push(@implContent, " podImpl = nativeValue;\n");
+ } else {
+ push(@implContent, " podImpl.set$implSetterFunctionName(nativeValue");
+ push(@implContent, ", ec") if $setterRaisesException;
+ push(@implContent, ");\n");
+ push(@implContent, " setDOMException(exec, ec);\n") if $setterRaisesException;
+ }
+ if ($svgPropertyType) {
+ if ($setterRaisesException) {
+ push(@implContent, " if (!ec)\n");
+ push(@implContent, " impl.commitChange();\n");
</ins><span class="cx"> } else {
</span><del>- push(@implContent, " podImpl.set$implSetterFunctionName(nativeValue");
- push(@implContent, ", ec") if $setterRaisesException;
- push(@implContent, ");\n");
- push(@implContent, " setDOMException(exec, ec);\n") if $setterRaisesException;
</del><ins>+ push(@implContent, " impl.commitChange();\n");
</ins><span class="cx"> }
</span><del>- if ($svgPropertyType) {
- if ($setterRaisesException) {
- push(@implContent, " if (!ec)\n");
- push(@implContent, " impl.commitChange();\n");
- } else {
- push(@implContent, " impl.commitChange();\n");
- }
- }
</del><ins>+ }
+ } else {
+ my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
+ if ($codeGenerator->IsTypedArrayType($attribute->signature->type) and not $attribute->signature->type eq "ArrayBuffer") {
+ push(@arguments, "nativeValue.get()");
</ins><span class="cx"> } else {
</span><del>- my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
- if ($codeGenerator->IsTypedArrayType($attribute->signature->type) and not $attribute->signature->type eq "ArrayBuffer") {
- push(@arguments, "nativeValue.get()");
- } else {
- push(@arguments, "nativeValue");
- }
- if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
- my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
- $implIncludes{"${implementedBy}.h"} = 1;
- unshift(@arguments, "&impl") if !$attribute->isStatic;
- $functionName = "${implementedBy}::${functionName}";
- } elsif ($attribute->isStatic) {
- $functionName = "${interfaceName}::${functionName}";
- } else {
- $functionName = "impl.${functionName}";
- }
</del><ins>+ push(@arguments, "nativeValue");
+ }
+ if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ unshift(@arguments, "&impl") if !$attribute->isStatic;
+ $functionName = "${implementedBy}::${functionName}";
+ } elsif ($attribute->isStatic) {
+ $functionName = "${interfaceName}::${functionName}";
+ } else {
+ $functionName = "impl.${functionName}";
+ }
</ins><span class="cx">
</span><del>- unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, ""));
</del><ins>+ unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, ""));
</ins><span class="cx">
</span><del>- push(@arguments, "ec") if $setterRaisesException;
- push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n");
- push(@implContent, " setDOMException(exec, ec);\n") if $setterRaisesException;
- }
</del><ins>+ push(@arguments, "ec") if $setterRaisesException;
+ push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n");
+ push(@implContent, " setDOMException(exec, ec);\n") if $setterRaisesException;
</ins><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> push(@implContent, "}\n\n");
</span><span class="cx"> push(@implContent, "#endif\n") if $attributeConditionalString;
</span><span class="lines">@@ -2287,30 +2288,30 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><del>- if ($interface->extendedAttributes->{"ReplaceableConstructor"}) {
- my $constructorFunctionName = "setJS" . $interfaceName . "Constructor";
</del><ins>+ if ($interface->extendedAttributes->{"ReplaceableConstructor"}) {
+ my $constructorFunctionName = "setJS" . $interfaceName . "Constructor";
</ins><span class="cx">
</span><del>- push(@implContent, "void ${constructorFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n");
- push(@implContent, "{\n");
- if ($interface->extendedAttributes->{"CheckSecurity"}) {
- if ($interfaceName eq "DOMWindow") {
- push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
- } else {
- push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
- }
- push(@implContent, " return;\n");
</del><ins>+ push(@implContent, "void ${constructorFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n");
+ push(@implContent, "{\n");
+ if ($interface->extendedAttributes->{"CheckSecurity"}) {
+ if ($interfaceName eq "DOMWindow") {
+ push(@implContent, " if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, jsCast<$className*>(thisObject)->impl()))\n");
+ } else {
+ push(@implContent, " if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl().frame()))\n");
</ins><span class="cx"> }
</span><ins>+ push(@implContent, " return;\n");
+ }
</ins><span class="cx">
</span><del>- push(@implContent, " // Shadowing a built-in constructor\n");
</del><ins>+ push(@implContent, " // Shadowing a built-in constructor\n");
</ins><span class="cx">
</span><del>- if ($interfaceName eq "DOMWindow") {
- push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), exec->propertyNames().constructor, value);\n");
- } else {
- die "No way to handle interface with ReplaceableConstructor extended attribute: $interfaceName";
- }
- push(@implContent, "}\n\n");
- }
</del><ins>+ if ($interfaceName eq "DOMWindow") {
+ push(@implContent, " jsCast<$className*>(thisObject)->putDirect(exec->vm(), exec->propertyNames().constructor, value);\n");
+ } else {
+ die "No way to handle interface with ReplaceableConstructor extended attribute: $interfaceName";
+ }
+ push(@implContent, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>