<!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>[200374] 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/200374">200374</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-03 08:44:36 -0700 (Tue, 03 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Drop some unnecessary exception checking in the generated bindings
https://bugs.webkit.org/show_bug.cgi?id=157299
Reviewed by Darin Adler.
Drop some unnecessary exception checking in the generated bindings.
Only do a check for state->hadException() after converting a JSValue
to a native value when necessary. Update JSValueToNative() to
indicate the caller if converting to the native value may throw an
exception.
This gets rid of a lot of unnecessary branching in the bindings.
No new tests, no intended web-exposed behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:</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>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/ChangeLog        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-05-03 Chris Dumez <cdumez@apple.com>
+
+ Drop some unnecessary exception checking in the generated bindings
+ https://bugs.webkit.org/show_bug.cgi?id=157299
+
+ Reviewed by Darin Adler.
+
+ Drop some unnecessary exception checking in the generated bindings.
+ Only do a check for state->hadException() after converting a JSValue
+ to a native value when necessary. Update JSValueToNative() to
+ indicate the caller if converting to the native value may throw an
+ exception.
+
+ This gets rid of a lot of unnecessary branching in the bindings.
+
+ No new tests, no intended web-exposed behavior change.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateParametersCheck):
+ (JSValueToNative):
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+
</ins><span class="cx"> 2016-05-03 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Add/refactor isolatedCopy methods for 3 IDB classes.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -2863,9 +2863,12 @@
</span><span class="cx"> push(@implContent, " };\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@implContent, " " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue = " . JSValueToNative($interface, $attribute->signature, "value", $attribute->signature->extendedAttributes->{"Conditional"}) . ";\n");
- push(@implContent, " if (UNLIKELY(state->hadException()))\n");
- push(@implContent, " return false;\n");
</del><ins>+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute->signature, "value", $attribute->signature->extendedAttributes->{"Conditional"});
+ push(@implContent, " " . GetNativeTypeFromSignature($attribute->signature) . " nativeValue = $nativeValue;\n");
+ if ($mayThrowException) {
+ push(@implContent, " if (UNLIKELY(state->hadException()))\n");
+ push(@implContent, " return false;\n");
+ }
</ins><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> push (@implContent, " if (UNLIKELY(!nativeValue))\n");
</span><span class="lines">@@ -3693,6 +3696,8 @@
</span><span class="cx"> push(@$outputArray, " AtomicString $name = state->argument($argsIndex).toString(state)->toExistingAtomicString(state).get();\n");
</span><span class="cx"> push(@$outputArray, " if ($name.isNull())\n");
</span><span class="cx"> push(@$outputArray, " return JSValue::encode(jsNull());\n");
</span><ins>+ push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
+ push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
</ins><span class="cx"> } else {
</span><span class="cx"> my $outer;
</span><span class="cx"> my $inner;
</span><span class="lines">@@ -3731,13 +3736,14 @@
</span><span class="cx"> $outer = "";
</span><span class="cx"> $inner = "state->argument($argsIndex)";
</span><span class="cx"> }
</span><del>- push(@$outputArray, " $nativeType $name = $outer" . JSValueToNative($interface, $parameter, $inner, $function->signature->extendedAttributes->{"Conditional"}) . ";\n");
</del><ins>+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function->signature->extendedAttributes->{"Conditional"});
+ push(@$outputArray, " $nativeType $name = ${outer}${nativeValue};\n");
+ if ($mayThrowException) {
+ push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
+ push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- # Check if the type conversion succeeded.
- push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
-
</del><span class="cx"> my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($argType) && $interfaceName !~ /List$/;
</span><span class="cx"> my $shouldPassByReference = ShouldPassWrapperByReference($parameter, $interface);
</span><span class="cx"> if ($isTearOff or $shouldPassByReference) {
</span><span class="lines">@@ -4327,6 +4333,7 @@
</span><span class="cx"> "unsigned short" => "toUInt16",
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+# Returns (convertString, mayThrowException).
</ins><span class="cx"> sub JSValueToNative
</span><span class="cx"> {
</span><span class="cx"> my ($interface, $signature, $value, $conditional) = @_;
</span><span class="lines">@@ -4338,54 +4345,54 @@
</span><span class="cx"> my $conversionType = "NormalConversion";
</span><span class="cx"> $conversionType = "EnforceRange" if $signature->extendedAttributes->{"EnforceRange"};
</span><span class="cx"> $conversionType = "Clamp" if $signature->extendedAttributes->{"Clamp"};
</span><del>- return "$function(state, $value, $conversionType)";
</del><ins>+ return ("$function(state, $value, $conversionType)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type eq "DOMString") {
</span><span class="cx"> if ($signature->extendedAttributes->{"TreatNullAs"}) {
</span><del>- return "valueToStringTreatingNullAsEmptyString(state, $value)" if $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString";
- return "valueToStringWithNullCheck(state, $value)" if $signature->extendedAttributes->{"TreatNullAs"} eq "LegacyNullString";
</del><ins>+ return ("valueToStringTreatingNullAsEmptyString(state, $value)", 1) if $signature->extendedAttributes->{"TreatNullAs"} eq "EmptyString";
+ return ("valueToStringWithNullCheck(state, $value)", 1) if $signature->extendedAttributes->{"TreatNullAs"} eq "LegacyNullString";
</ins><span class="cx"> }
</span><del>- return "valueToStringWithUndefinedOrNullCheck(state, $value)" if $signature->isNullable;
- return "$value.toString(state)->toAtomicString(state)" if $signature->extendedAttributes->{"AtomicString"};
- return "$value.toWTFString(state)";
</del><ins>+ return ("valueToStringWithUndefinedOrNullCheck(state, $value)", 1) if $signature->isNullable;
+ return ("$value.toString(state)->toAtomicString(state)", 1) if $signature->extendedAttributes->{"AtomicString"};
+ return ("$value.toWTFString(state)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type eq "SerializedScriptValue") {
</span><span class="cx"> AddToImplIncludes("SerializedScriptValue.h", $conditional);
</span><del>- return "SerializedScriptValue::create(state, $value, 0, 0)";
</del><ins>+ return ("SerializedScriptValue::create(state, $value, 0, 0)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type eq "Dictionary") {
</span><span class="cx"> AddToImplIncludes("Dictionary.h", $conditional);
</span><del>- return "{ state, $value }";
</del><ins>+ return ("{ state, $value }", 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $arrayOrSequenceType = $codeGenerator->GetArrayOrSequenceType($type);
</span><span class="cx"> if ($arrayOrSequenceType) {
</span><span class="cx"> if ($codeGenerator->IsRefPtrType($arrayOrSequenceType)) {
</span><span class="cx"> AddToImplIncludes("JS${arrayOrSequenceType}.h");
</span><del>- return "(toRefPtrNativeArray<${arrayOrSequenceType}, JS${arrayOrSequenceType}>(state, $value, &JS${arrayOrSequenceType}::toWrapped))";
</del><ins>+ return ("(toRefPtrNativeArray<${arrayOrSequenceType}, JS${arrayOrSequenceType}>(state, $value, &JS${arrayOrSequenceType}::toWrapped))", 1);
</ins><span class="cx"> }
</span><del>- return "toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(state, $value)";
</del><ins>+ return ("toNativeArray<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">(state, $value)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return $value if $type eq "any";
</del><ins>+ return ($value, 0) if $type eq "any";
</ins><span class="cx">
</span><del>- return "$value.toBoolean(state)" if $type eq "boolean";
- return "$value.toNumber(state)" if $type eq "double" or $type eq "unrestricted double";
- return "$value.toFloat(state)" if $type eq "float" or $type eq "unrestricted float";
- return "valueToDate(state, $value)" if $type eq "Date";
</del><ins>+ return ("$value.toBoolean(state)", 1) if $type eq "boolean";
+ return ("$value.toNumber(state)", 1) if $type eq "double" or $type eq "unrestricted double";
+ return ("$value.toFloat(state)", 1) if $type eq "float" or $type eq "unrestricted float";
+ return ("valueToDate(state, $value)", 1) if $type eq "Date";
</ins><span class="cx">
</span><del>- return "to$type($value)" if $codeGenerator->IsTypedArrayType($type);
- return "parse" . GetEnumerationClassIdentifier($interface, $type) . "(*state, $value)" if $codeGenerator->IsEnumType($type);
</del><ins>+ return ("to$type($value)", 1) if $codeGenerator->IsTypedArrayType($type);
+ return ("parse" . GetEnumerationClassIdentifier($interface, $type) . "(*state, $value)", 1) if $codeGenerator->IsEnumType($type);
</ins><span class="cx">
</span><span class="cx"> AddToImplIncludes("JS$type.h", $conditional);
</span><span class="cx">
</span><del>- return "toDOMStringList(state, $value)" if $type eq "DOMStringList";
- return "JSNodeFilter::toWrapped(state->vm(), $value)" if $type eq "NodeFilter";
</del><ins>+ return ("toDOMStringList(state, $value)", 1) if $type eq "DOMStringList";
+ return ("JSNodeFilter::toWrapped(state->vm(), $value)", 1) if $type eq "NodeFilter";
</ins><span class="cx">
</span><del>- return "JS${type}::toWrapped($value)";
</del><ins>+ return ("JS${type}::toWrapped($value)", 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub NativeToJSValue
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -204,8 +204,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> Node* nextChild = JSNode::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!nextChild))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> impl.excitingFunction(*nextChild);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -684,8 +684,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> Node* nativeValue = JSNode::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -754,8 +752,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> Node* nativeValue = JSNode::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -805,8 +801,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, strArg, *objArg, ec)));
</span><span class="lines">@@ -873,8 +867,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, strArg, *objArg, ec)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -2684,8 +2684,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -2705,8 +2703,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> impl.setTestNullableObjAttr(nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -2722,8 +2718,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -2760,8 +2754,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3103,8 +3095,6 @@
</span><span class="cx"> return false;
</span><span class="cx"> };
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3197,8 +3187,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3221,8 +3209,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3242,8 +3228,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3266,8 +3250,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3290,8 +3272,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3314,8 +3294,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3338,8 +3316,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* nativeValue = JSTestObj::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><span class="cx"> throwVMTypeError(state);
</span><span class="cx"> return false;
</span><span class="lines">@@ -3461,8 +3437,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> JSC::JSValue nativeValue = value;
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> impl.setAnyAttribute(nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3478,8 +3452,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> SVGPropertyTearOff<SVGPoint>* nativeValue = JSSVGPoint::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> impl.setMutablePoint(nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3495,8 +3467,6 @@
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> SVGPropertyTearOff<SVGPoint>* nativeValue = JSSVGPoint::toWrapped(value);
</span><del>- if (UNLIKELY(state->hadException()))
- return false;
</del><span class="cx"> impl.setImmutablePoint(nativeValue);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -3775,8 +3745,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> impl.voidMethodWithArgs(longArg, strArg, *objArg);
</span><span class="lines">@@ -3812,8 +3780,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, *objArg));
</span><span class="lines">@@ -3849,8 +3815,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, *objArg));
</span><span class="lines">@@ -3886,8 +3850,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, *objArg));
</span><span class="lines">@@ -3923,8 +3885,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, *objArg)));
</span><span class="lines">@@ -4090,8 +4050,6 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, *objArg, ec)));
</span><span class="lines">@@ -4128,11 +4086,7 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> Dictionary oo = { state, state->argument(0) };
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> Dictionary ooo = { state, state->argument(1) };
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.optionsObject(oo, ooo);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4768,8 +4722,6 @@
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> JSC::JSValue a = state->argument(0);
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.methodWithOptionalAny(a);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4783,8 +4735,6 @@
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* obj = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.methodWithOptionalNullableWrapper(obj);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4798,8 +4748,6 @@
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> TestObj* obj = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.methodWithOptionalNullableWrapperIsNull(obj);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4993,8 +4941,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> String strArg = state->argument(1).toWTFString(state);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5013,8 +4959,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> Optional<int> longArg = state->argument(1).isUndefined() ? Optional<int>() : toInt32(state, state->uncheckedArgument(1), NormalConversion);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5118,8 +5062,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> impl.overloadedMethod(*objArg);
</span><span class="lines">@@ -5240,11 +5182,7 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestObj* objArg1 = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> TestObj* objArg2 = JSTestObj::toWrapped(state->argument(1));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.overloadedMethodWithOptionalParameter(objArg1, objArg2);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -5260,8 +5198,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> Optional<int> longArg = state->argument(1).isUndefined() ? Optional<int>() : toInt32(state, state->uncheckedArgument(1), NormalConversion);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5519,8 +5455,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestNode* value = JSTestNode::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!value))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> impl.convert1(*value);
</span><span class="lines">@@ -5538,8 +5472,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> TestNode* value = JSTestNode::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> impl.convert2(value);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -5654,8 +5586,6 @@
</span><span class="cx"> if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
</span><span class="cx"> return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> Vector<unsigned> a = toNativeArray<unsigned>(state, state->argument(1));
</span><span class="lines">@@ -5681,8 +5611,6 @@
</span><span class="cx"> if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
</span><span class="cx"> return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
</span><span class="cx"> TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!objArg))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> Vector<int> array = toNativeArray<int>(state, state->argument(1));
</span><span class="lines">@@ -5745,8 +5673,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> Node* head = JSNode::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!head))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> Vector<Node*> tail;
</span><span class="lines">@@ -5905,8 +5831,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> FetchRequest* request = JSFetchRequest::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!request))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> impl.testPromiseOverloadedFunction(*request, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200373 => 200374)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-03 15:39:28 UTC (rev 200373)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-03 15:44:36 UTC (rev 200374)
</span><span class="lines">@@ -99,8 +99,6 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> Blob* blob = JSBlob::toWrapped(state->argument(0));
</span><del>- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
</del><span class="cx"> if (UNLIKELY(!blob))
</span><span class="cx"> return throwVMTypeError(state);
</span><span class="cx"> RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*blob);
</span></span></pre>
</div>
</div>
</body>
</html>