<!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>[200583] 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/200583">200583</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-09 12:46:35 -0700 (Mon, 09 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Optimize [StrictTypeChecking] on IDL operations
https://bugs.webkit.org/show_bug.cgi?id=157467
Reviewed by Darin Adler.
Source/WebCore:
Optimize [StrictTypeChecking] on IDL operations so that:
- Only generate extra code for nullable parameters because for non-nullable
parameters, JSXXX::toWrapped() will return null in case of a bad input
type. We will then throw a TypeError when null-checking it already.
- After the JSValue::isNullOrUndefined() check, avoid calling
JSXXX::toWrapped() and set nativeValue to nullptr directly.
- Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
check on the value returned by JSXXX::toWrapped(). toWrapped() already
does a JSValue::inherits(JSXXX::info() check. Since we only call
toWrapped() if the JSValue is not null/undefined, a null return value
always indicates a bad input type.
Also update the TypeError message to be more useful when passing null
for non-nullable parameters or assigning null to a non-nullable
attribute. The message is now consistent with the one used for strict
type checking.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::setJSTestInterfaceImplementsNode):
(WebCore::setJSTestInterfaceSupplementalNode):
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjLenientTestObjAttr):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
(WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors3):
* bindings/scripts/test/TestObj.idl:
LayoutTests:
Rebaseline existing tests now that we provide a more useful exception
message when passing null for a non-nullable parameter and assigning
null to a non-nullable attribute.
* editing/selection/extend-expected.txt:
* fast/dom/Document/adoptNode-null-expected.txt:
* fast/dom/Document/adoptNode-null.html:
* fast/dom/Document/importNode-null-expected.txt:
* fast/dom/Document/importNode-null.html:
* fast/dom/Element/attr-param-typechecking-expected.txt:
* fast/dom/MutationObserver/observe-exceptions-expected.txt:
* fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt:
* fast/dom/Range/range-intersectsNode-expected.txt:
* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createNodeIterator-parameters.html:
* fast/dom/createTreeWalker-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters.html:
* fast/dom/xmlserializer-serialize-to-string-exception-expected.txt:
* fast/dynamic/insertAdjacentElement-expected.txt:
* fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt:
* fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt:
* fast/text/font-face-set-javascript-expected.txt:
* fast/text/text-combine-crash-expected.txt:
* media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
* media/encrypted-media/encrypted-media-v2-syntax.html:
* webaudio/createMediaStreamSource-null-expected.txt:
* webaudio/createMediaStreamSource-null.html:
* webaudio/decode-audio-data-basic-expected.txt:
* webaudio/decode-audio-data-basic.html:
* webaudio/mediaelementaudiosourcenode-expected.txt:
* webaudio/mediaelementaudiosourcenode.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingselectionextendexpectedtxt">trunk/LayoutTests/editing/selection/extend-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomDocumentadoptNodenullexpectedtxt">trunk/LayoutTests/fast/dom/Document/adoptNode-null-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomDocumentadoptNodenullhtml">trunk/LayoutTests/fast/dom/Document/adoptNode-null.html</a></li>
<li><a href="#trunkLayoutTestsfastdomDocumentimportNodenullexpectedtxt">trunk/LayoutTests/fast/dom/Document/importNode-null-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomDocumentimportNodenullhtml">trunk/LayoutTests/fast/dom/Document/importNode-null.html</a></li>
<li><a href="#trunkLayoutTestsfastdomElementattrparamtypecheckingexpectedtxt">trunk/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt">trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomNamedNodeMapsetNamedItemcrashexpectedtxt">trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomRangerangeintersectsNodeexpectedtxt">trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomcreateNodeIteratorparametersexpectedtxt">trunk/LayoutTests/fast/dom/createNodeIterator-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomcreateNodeIteratorparametershtml">trunk/LayoutTests/fast/dom/createNodeIterator-parameters.html</a></li>
<li><a href="#trunkLayoutTestsfastdomcreateTreeWalkerparametersexpectedtxt">trunk/LayoutTests/fast/dom/createTreeWalker-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomcreateTreeWalkerparametershtml">trunk/LayoutTests/fast/dom/createTreeWalker-parameters.html</a></li>
<li><a href="#trunkLayoutTestsfastdomxmlserializerserializetostringexceptionexpectedtxt">trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdynamicinsertAdjacentElementexpectedtxt">trunk/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediastreamMediaStreamaddremovenullundefinedtracksexpectedtxt">trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastspeechsynthesisspeechsynthesiscrashonbadutteranceexpectedtxt">trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt">trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttexttextcombinecrashexpectedtxt">trunk/LayoutTests/fast/text/text-combine-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediaencryptedmediaencryptedmediav2syntaxexpectedtxt">trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediaencryptedmediaencryptedmediav2syntaxhtml">trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html</a></li>
<li><a href="#trunkLayoutTestswebaudiocreateMediaStreamSourcenullexpectedtxt">trunk/LayoutTests/webaudio/createMediaStreamSource-null-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebaudiocreateMediaStreamSourcenullhtml">trunk/LayoutTests/webaudio/createMediaStreamSource-null.html</a></li>
<li><a href="#trunkLayoutTestswebaudiodecodeaudiodatabasicexpectedtxt">trunk/LayoutTests/webaudio/decode-audio-data-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebaudiodecodeaudiodatabasichtml">trunk/LayoutTests/webaudio/decode-audio-data-basic.html</a></li>
<li><a href="#trunkLayoutTestswebaudiomediaelementaudiosourcenodeexpectedtxt">trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt</a></li>
<li><a href="#trunkLayoutTestswebaudiomediaelementaudiosourcenodehtml">trunk/LayoutTests/webaudio/mediaelementaudiosourcenode.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</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>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/ChangeLog        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-05-09 Chris Dumez <cdumez@apple.com>
+
+ Optimize [StrictTypeChecking] on IDL operations
+ https://bugs.webkit.org/show_bug.cgi?id=157467
+
+ Reviewed by Darin Adler.
+
+ Rebaseline existing tests now that we provide a more useful exception
+ message when passing null for a non-nullable parameter and assigning
+ null to a non-nullable attribute.
+
+ * editing/selection/extend-expected.txt:
+ * fast/dom/Document/adoptNode-null-expected.txt:
+ * fast/dom/Document/adoptNode-null.html:
+ * fast/dom/Document/importNode-null-expected.txt:
+ * fast/dom/Document/importNode-null.html:
+ * fast/dom/Element/attr-param-typechecking-expected.txt:
+ * fast/dom/MutationObserver/observe-exceptions-expected.txt:
+ * fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt:
+ * fast/dom/Range/range-intersectsNode-expected.txt:
+ * fast/dom/createNodeIterator-parameters-expected.txt:
+ * fast/dom/createNodeIterator-parameters.html:
+ * fast/dom/createTreeWalker-parameters-expected.txt:
+ * fast/dom/createTreeWalker-parameters.html:
+ * fast/dom/xmlserializer-serialize-to-string-exception-expected.txt:
+ * fast/dynamic/insertAdjacentElement-expected.txt:
+ * fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt:
+ * fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt:
+ * fast/text/font-face-set-javascript-expected.txt:
+ * fast/text/text-combine-crash-expected.txt:
+ * media/encrypted-media/encrypted-media-v2-syntax-expected.txt:
+ * media/encrypted-media/encrypted-media-v2-syntax.html:
+ * webaudio/createMediaStreamSource-null-expected.txt:
+ * webaudio/createMediaStreamSource-null.html:
+ * webaudio/decode-audio-data-basic-expected.txt:
+ * webaudio/decode-audio-data-basic.html:
+ * webaudio/mediaelementaudiosourcenode-expected.txt:
+ * webaudio/mediaelementaudiosourcenode.html:
+
</ins><span class="cx"> 2016-05-09 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Focusing a shadow host places the slot content after the shadow DOM content
</span></span></pre></div>
<a id="trunkLayoutTestseditingselectionextendexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/selection/extend-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/selection/extend-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/editing/selection/extend-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -5,4 +5,4 @@
</span><span class="cx"> Success: window.getSelection() is b.
</span><span class="cx"> Success: window.getSelection() is arbaz.
</span><span class="cx"> Success: s.extend() raised TypeError: Not enough arguments.
</span><del>-Success: s.extend(null, 0) raised TypeError: Type error.
</del><ins>+Success: s.extend(null, 0) raised TypeError: Argument 1 ('node') to DOMSelection.extend must be an instance of Node.
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentadoptNodenullexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Document/adoptNode-null-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/adoptNode-null-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Document/adoptNode-null-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS document.adoptNode(null) threw exception TypeError: Type error.
</del><ins>+PASS document.adoptNode(null) threw exception TypeError: Argument 1 ('source') to Document.adoptNode must be an instance of Node.
</ins><span class="cx"> PASS document.adoptNode() threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentadoptNodenullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Document/adoptNode-null.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/adoptNode-null.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Document/adoptNode-null.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> <script>
</span><span class="cx"> description("Tests that document.adoptNode(null) throws a TypeError");
</span><span class="cx">
</span><del>-shouldThrow("document.adoptNode(null)", "'TypeError: Type error'");
</del><ins>+shouldThrow("document.adoptNode(null)", "'TypeError: Argument 1 (\\'source\\') to Document.adoptNode must be an instance of Node'");
</ins><span class="cx"> shouldThrow("document.adoptNode()", "'TypeError: Not enough arguments'");
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentimportNodenullexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Document/importNode-null-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/importNode-null-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Document/importNode-null-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS document.importNode(null) threw exception TypeError: Type error.
</del><ins>+PASS document.importNode(null) threw exception TypeError: Argument 1 ('importedNode') to Document.importNode must be an instance of Node.
</ins><span class="cx"> PASS document.importNode() threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomDocumentimportNodenullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Document/importNode-null.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Document/importNode-null.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Document/importNode-null.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> <script>
</span><span class="cx"> description("Tests that document.importNode(null) throws a TypeError");
</span><span class="cx">
</span><del>-shouldThrow("document.importNode(null)", "'TypeError: Type error'");
</del><ins>+shouldThrow("document.importNode(null)", "'TypeError: Argument 1 (\\'importedNode\\') to Document.importNode must be an instance of Node'");
</ins><span class="cx"> shouldThrow("document.importNode()", "'TypeError: Not enough arguments'");
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../../../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomElementattrparamtypecheckingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,18 +3,18 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS element.setAttributeNode("style"); threw exception TypeError: Type error.
-PASS element.setAttributeNode(null); threw exception TypeError: Type error.
-PASS element.setAttributeNode(undefined); threw exception TypeError: Type error.
-PASS element.setAttributeNode(new Object); threw exception TypeError: Type error.
-PASS element.removeAttributeNode("style"); threw exception TypeError: Type error.
-PASS element.removeAttributeNode(null); threw exception TypeError: Type error.
-PASS element.removeAttributeNode(undefined); threw exception TypeError: Type error.
-PASS element.removeAttributeNode(new Object); threw exception TypeError: Type error.
-PASS element.setAttributeNodeNS("style"); threw exception TypeError: Type error.
-PASS element.setAttributeNodeNS(null); threw exception TypeError: Type error.
-PASS element.setAttributeNodeNS(undefined); threw exception TypeError: Type error.
-PASS element.setAttributeNodeNS(new Object); threw exception TypeError: Type error.
</del><ins>+PASS element.setAttributeNode("style"); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNode must be an instance of Attr.
+PASS element.setAttributeNode(null); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNode must be an instance of Attr.
+PASS element.setAttributeNode(undefined); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNode must be an instance of Attr.
+PASS element.setAttributeNode(new Object); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNode must be an instance of Attr.
+PASS element.removeAttributeNode("style"); threw exception TypeError: Argument 1 ('oldAttr') to Element.removeAttributeNode must be an instance of Attr.
+PASS element.removeAttributeNode(null); threw exception TypeError: Argument 1 ('oldAttr') to Element.removeAttributeNode must be an instance of Attr.
+PASS element.removeAttributeNode(undefined); threw exception TypeError: Argument 1 ('oldAttr') to Element.removeAttributeNode must be an instance of Attr.
+PASS element.removeAttributeNode(new Object); threw exception TypeError: Argument 1 ('oldAttr') to Element.removeAttributeNode must be an instance of Attr.
+PASS element.setAttributeNodeNS("style"); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNodeNS must be an instance of Attr.
+PASS element.setAttributeNodeNS(null); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNodeNS must be an instance of Attr.
+PASS element.setAttributeNodeNS(undefined); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNodeNS must be an instance of Attr.
+PASS element.setAttributeNodeNS(new Object); threw exception TypeError: Argument 1 ('newAttr') to Element.setAttributeNodeNS must be an instance of Attr.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomMutationObserverobserveexceptionsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -9,8 +9,8 @@
</span><span class="cx"> PASS observer.observe(document.body) threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS observer.observe(document.body, null) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(document.body, undefined) threw exception TypeError: Type error.
</span><del>-PASS observer.observe(null, {attributes: true}) threw exception TypeError: Type error.
-PASS observer.observe(undefined, {attributes: true}) threw exception TypeError: Type error.
</del><ins>+PASS observer.observe(null, {attributes: true}) threw exception TypeError: Argument 1 ('target') to MutationObserver.observe must be an instance of Node.
+PASS observer.observe(undefined, {attributes: true}) threw exception TypeError: Argument 1 ('target') to MutationObserver.observe must be an instance of Node.
</ins><span class="cx"> PASS observer.observe(document.body, {subtree: true}) threw exception TypeError: Type error.
</span><span class="cx"> PASS observer.observe(document.body, {childList: true, attributeOldValue: true}) did not throw exception.
</span><span class="cx"> PASS observer.observe(document.body, {attributes: true, characterDataOldValue: true}) did not throw exception.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomNamedNodeMapsetNamedItemcrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-CONSOLE MESSAGE: line 7: TypeError: Type error
</del><ins>+CONSOLE MESSAGE: line 7: TypeError: Argument 1 ('node') to NamedNodeMap.setNamedItem must be an instance of Node
</ins><span class="cx"> This passes if it does not crash. (see https://bugs.webkit.org/show_bug.cgi?id=18958)
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomRangerangeintersectsNodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> PASS intersects is false
</span><span class="cx">
</span><span class="cx"> 2.6 Node deleted
</span><del>-PASS range.intersectsNode(node) threw exception TypeError: Type error.
</del><ins>+PASS range.intersectsNode(node) threw exception TypeError: Argument 1 ('refNode') to Range.intersectsNode must be an instance of Node.
</ins><span class="cx">
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcreateNodeIteratorparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/createNodeIterator-parameters-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/createNodeIterator-parameters-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/createNodeIterator-parameters-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS document.createNodeIterator() threw exception TypeError: Not enough arguments.
</span><span class="cx">
</span><span class="cx"> Null root node
</span><del>-PASS document.createNodeIterator(null) threw exception TypeError: Type error.
</del><ins>+PASS document.createNodeIterator(null) threw exception TypeError: Argument 1 ('root') to Document.createNodeIterator must be an instance of Node.
</ins><span class="cx">
</span><span class="cx"> Default parameters
</span><span class="cx"> iterator = document.createNodeIterator(document)
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcreateNodeIteratorparametershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/createNodeIterator-parameters.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/createNodeIterator-parameters.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/createNodeIterator-parameters.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">
</span><span class="cx"> debug("")
</span><span class="cx"> debug("Null root node");
</span><del>-shouldThrow("document.createNodeIterator(null)", "'TypeError: Type error'");
</del><ins>+shouldThrow("document.createNodeIterator(null)", "'TypeError: Argument 1 (\\'root\\') to Document.createNodeIterator must be an instance of Node'");
</ins><span class="cx">
</span><span class="cx"> debug("");
</span><span class="cx"> debug("Default parameters");
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcreateTreeWalkerparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/createTreeWalker-parameters-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/createTreeWalker-parameters-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/createTreeWalker-parameters-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> PASS document.createTreeWalker() threw exception TypeError: Not enough arguments.
</span><span class="cx">
</span><span class="cx"> Null root node
</span><del>-PASS document.createTreeWalker(null) threw exception TypeError: Type error.
</del><ins>+PASS document.createTreeWalker(null) threw exception TypeError: Argument 1 ('root') to Document.createTreeWalker must be an instance of Node.
</ins><span class="cx">
</span><span class="cx"> Default parameters
</span><span class="cx"> walker = document.createTreeWalker(document)
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcreateTreeWalkerparametershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/createTreeWalker-parameters.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/createTreeWalker-parameters.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/createTreeWalker-parameters.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">
</span><span class="cx"> debug("")
</span><span class="cx"> debug("Null root node");
</span><del>-shouldThrow("document.createTreeWalker(null)", "'TypeError: Type error'");
</del><ins>+shouldThrow("document.createTreeWalker(null)", "'TypeError: Argument 1 (\\'root\\') to Document.createTreeWalker must be an instance of Node'");
</ins><span class="cx">
</span><span class="cx"> debug("");
</span><span class="cx"> debug("Default parameters");
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomxmlserializerserializetostringexceptionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -1,19 +1,19 @@
</span><span class="cx"> This tests XMLSerializer.serializeToString() throwing exception when node value is invalid and passing otherwise.
</span><span class="cx">
</span><span class="cx"> 1. Verifying XMLSerializer.serializeToString() should THROW exception with node value = null
</span><del>-Exception thrown = [TypeError: Type error]
</del><ins>+Exception thrown = [TypeError: Argument 1 ('node') to XMLSerializer.serializeToString must be an instance of Node]
</ins><span class="cx"> PASS
</span><span class="cx">
</span><span class="cx"> 2. Verifying XMLSerializer.serializeToString() should THROW exception with node value = undefined
</span><del>-Exception thrown = [TypeError: Type error]
</del><ins>+Exception thrown = [TypeError: Argument 1 ('node') to XMLSerializer.serializeToString must be an instance of Node]
</ins><span class="cx"> PASS
</span><span class="cx">
</span><span class="cx"> 3. Verifying XMLSerializer.serializeToString() should THROW exception with node value = <html><title>Hello World</title></html>
</span><del>-Exception thrown = [TypeError: Type error]
</del><ins>+Exception thrown = [TypeError: Argument 1 ('node') to XMLSerializer.serializeToString must be an instance of Node]
</ins><span class="cx"> PASS
</span><span class="cx">
</span><span class="cx"> 4. Verifying XMLSerializer.serializeToString() should THROW exception with node value = [object HTMLCollection]
</span><del>-Exception thrown = [TypeError: Type error]
</del><ins>+Exception thrown = [TypeError: Argument 1 ('node') to XMLSerializer.serializeToString must be an instance of Node]
</ins><span class="cx"> PASS
</span><span class="cx">
</span><span class="cx"> 5. Verifying XMLSerializer.serializeToString() should NOT-THROW exception with node value = [object HTMLDocument]
</span></span></pre></div>
<a id="trunkLayoutTestsfastdynamicinsertAdjacentElementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> Caught expected exception: Error: NotSupportedError: DOM Exception 9
</span><del>-Caught expected exception: TypeError: Type error
</del><ins>+Caught expected exception: TypeError: Argument 2 ('element') to HTMLElement.insertAdjacentElement must be an instance of Element
</ins><span class="cx"> 1 (black) 2 (green) 3 (green) 4 (black)
</span><span class="cx">
</span><span class="cx"> PASS
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediastreamMediaStreamaddremovenullundefinedtracksexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-null-undefined-tracks-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -5,12 +5,12 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> Calling addTrack with null and undefined parameters
</span><del>-PASS stream.addTrack(null); threw exception TypeError: Type error.
-PASS stream.addTrack(undefined); threw exception TypeError: Type error.
</del><ins>+PASS stream.addTrack(null); threw exception TypeError: Argument 1 ('track') to MediaStream.addTrack must be an instance of MediaStreamTrack.
+PASS stream.addTrack(undefined); threw exception TypeError: Argument 1 ('track') to MediaStream.addTrack must be an instance of MediaStreamTrack.
</ins><span class="cx">
</span><span class="cx"> Calling removeTrack with null and undefined parameters
</span><del>-PASS stream.removeTrack(null); threw exception TypeError: Type error.
-PASS stream.removeTrack(undefined); threw exception TypeError: Type error.
</del><ins>+PASS stream.removeTrack(null); threw exception TypeError: Argument 1 ('track') to MediaStream.removeTrack must be an instance of MediaStreamTrack.
+PASS stream.removeTrack(undefined); threw exception TypeError: Argument 1 ('track') to MediaStream.removeTrack must be an instance of MediaStreamTrack.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastspeechsynthesisspeechsynthesiscrashonbadutteranceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/speechsynthesis/speech-synthesis-crash-on-bad-utterance-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS speechSynthesis.speak('Hello World') threw exception TypeError: Type error.
</del><ins>+PASS speechSynthesis.speak('Hello World') threw exception TypeError: Argument 1 ('utterance') to SpeechSynthesis.speak must be an instance of SpeechSynthesisUtterance.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontfacesetjavascriptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/text/font-face-set-javascript-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS item.done is true
</span><span class="cx"> PASS fontFaceSet.add(fontFace2) is fontFaceSet
</span><span class="cx"> PASS fontFaceSet.size is 2
</span><del>-PASS fontFaceSet.add(null) threw exception TypeError: Type error.
</del><ins>+PASS fontFaceSet.add(null) threw exception TypeError: Argument 1 ('font') to FontFaceSet.add must be an instance of FontFace.
</ins><span class="cx"> PASS item.done is false
</span><span class="cx"> PASS item.value is fontFace1
</span><span class="cx"> PASS item.done is false
</span><span class="lines">@@ -21,10 +21,10 @@
</span><span class="cx"> PASS item.done is true
</span><span class="cx"> PASS fontFaceSet.delete(fontFace1) is true
</span><span class="cx"> PASS fontFaceSet.delete(fontFace3) is false
</span><del>-PASS fontFaceSet.delete(null) threw exception TypeError: Type error.
</del><ins>+PASS fontFaceSet.delete(null) threw exception TypeError: Argument 1 ('font') to FontFaceSet.delete must be an instance of FontFace.
</ins><span class="cx"> PASS fontFaceSet.has(fontFace1) is false
</span><span class="cx"> PASS fontFaceSet.has(fontFace2) is true
</span><del>-PASS fontFaceSet.has(null) threw exception TypeError: Type error.
</del><ins>+PASS fontFaceSet.has(null) threw exception TypeError: Argument 1 ('font') to FontFaceSet.has must be an instance of FontFace.
</ins><span class="cx"> PASS fontFaceSet.size is 0
</span><span class="cx"> PASS fontFaceSet.values().next().done is true
</span><span class="cx"> PASS fontFaceSet.check('garbage') threw exception Error: SyntaxError: DOM Exception 12.
</span></span></pre></div>
<a id="trunkLayoutTestsfasttexttextcombinecrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/text-combine-crash-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/text-combine-crash-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/fast/text/text-combine-crash-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -6,12 +6,12 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> Errlog webtest_fn_1: TypeError: undefined is not an object (evaluating 'document.applets[0].addEventListener')
</span><del>-Errlog webtest_fn_2: TypeError: Type error
</del><ins>+Errlog webtest_fn_2: TypeError: Argument 1 ('refNode') to Range.setStartBefore must be an instance of Node
</ins><span class="cx"> Errlog webtest_fn_3: TypeError: undefined is not an object (evaluating 'document.images[2].contentEditable="true"')
</span><span class="cx"> Errlog webtest_fn_8: TypeError: null is not an object (evaluating 'lis.length')
</span><span class="cx"> Errlog webtest_fn_9: TypeError: undefined is not an object (evaluating 'document.anchors[4].setAttribute')
</span><del>-Errlog webtest_fn_10: TypeError: Type error
-Errlog webtest_fn_15: TypeError: Type error
</del><ins>+Errlog webtest_fn_10: TypeError: Argument 1 ('refNode') to Range.setStartAfter must be an instance of Node
+Errlog webtest_fn_15: TypeError: Argument 1 ('refNode') to Range.setStart must be an instance of Node
</ins><span class="cx"> Errlog webtest_fn_16: TypeError: undefined is not an object (evaluating 'elem.parentNode')
</span><span class="cx"> Errlog webtest_fn_18: TypeError: undefined is not an object (evaluating 'document.applets[0].contentEditable="true"')
</span><span class="cx"> Errlog webtest_fn_21: TypeError: undefined is not an object (evaluating 'document.anchors[4].appendChild')
</span></span></pre></div>
<a id="trunkLayoutTestsmediaencryptedmediaencryptedmediav2syntaxexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -22,6 +22,6 @@
</span><span class="cx"> EXPECTED (mediaKeySession.onwebkitkeyadded == 'null') OK
</span><span class="cx"> EXPECTED (mediaKeySession.onwebkitkeyerror == 'null') OK
</span><span class="cx"> EXPECTED (mediaKeySession.onwebkitkeymessage == 'null') OK
</span><del>-TEST(mediaKeySession.update(null)) THROWS('TypeError: Type error') OK
</del><ins>+TEST(mediaKeySession.update(null)) THROWS('TypeError: Argument 1 (\'key\') to MediaKeySession.update must be an instance of Uint8Array') OK
</ins><span class="cx"> END OF TEST
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsmediaencryptedmediaencryptedmediav2syntaxhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> testExpected('mediaKeySession.onwebkitkeyadded', null);
</span><span class="cx"> testExpected('mediaKeySession.onwebkitkeyerror', null);
</span><span class="cx"> testExpected('mediaKeySession.onwebkitkeymessage', null);
</span><del>- testException('mediaKeySession.update(null)', "'TypeError: Type error'");
</del><ins>+ testException('mediaKeySession.update(null)', "'TypeError: Argument 1 (\\'key\\') to MediaKeySession.update must be an instance of Uint8Array'");
</ins><span class="cx"> endTest();
</span><span class="cx"> }
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiocreateMediaStreamSourcenullexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/createMediaStreamSource-null-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/createMediaStreamSource-null-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/createMediaStreamSource-null-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS context.createMediaStreamSource(null) threw exception TypeError: Type error.
</del><ins>+PASS context.createMediaStreamSource(null) threw exception TypeError: Argument 1 ('mediaStream') to AudioContext.createMediaStreamSource must be an instance of MediaStream.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiocreateMediaStreamSourcenullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/createMediaStreamSource-null.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/createMediaStreamSource-null.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/createMediaStreamSource-null.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> description("Tests that passing null to context.createMediaStreamSource() throws a TypeError.");
</span><span class="cx">
</span><span class="cx"> var context = new webkitAudioContext();
</span><del>-shouldThrow("context.createMediaStreamSource(null)", "'TypeError: Type error'");
</del><ins>+shouldThrow("context.createMediaStreamSource(null)", "'TypeError: Argument 1 (\\'mediaStream\\') to AudioContext.createMediaStreamSource must be an instance of MediaStream'");
</ins><span class="cx">
</span><span class="cx"> </script>
</span><span class="cx"> <script src="../resources/js-test-post.js"></script>
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiodecodeaudiodatabasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/decode-audio-data-basic-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/decode-audio-data-basic-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/decode-audio-data-basic-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS context.decodeAudioData(null, function(){}, function(){}); threw exception TypeError: Type error.
</del><ins>+PASS context.decodeAudioData(null, function(){}, function(){}); threw exception TypeError: Argument 1 ('audioData') to AudioContext.decodeAudioData must be an instance of ArrayBuffer.
</ins><span class="cx"> PASS The resources/media/24bit-44khz.wav test: successCallback has been called correctly.
</span><span class="cx"> PASS The resources/media/invalid-audio-file.txt test: errorCallback has been called correctly.
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiodecodeaudiodatabasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/decode-audio-data-basic.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/decode-audio-data-basic.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/decode-audio-data-basic.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> var context = new webkitAudioContext();
</span><span class="cx">
</span><span class="cx"> // decodeAudioData should raise exception when arraybuffer parameter is null.
</span><del>-shouldThrow("context.decodeAudioData(null, function(){}, function(){});", "'TypeError: Type error'");
</del><ins>+shouldThrow("context.decodeAudioData(null, function(){}, function(){});", "'TypeError: Argument 1 (\\'audioData\\') to AudioContext.decodeAudioData must be an instance of ArrayBuffer'");
</ins><span class="cx">
</span><span class="cx"> var decodeCaseArray = [{url: "resources/media/24bit-44khz.wav", result: true},
</span><span class="cx"> {url: "resources/media/invalid-audio-file.txt", result: false}];
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiomediaelementaudiosourcenodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-expected.txt        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> PASS connect() exception thrown for illegal input index.
</span><span class="cx"> PASS audioNode.connect(context.destination) succeeded.
</span><span class="cx"> PASS createMediaElementSource() threw error when called twice on same HTMLMediaElement.
</span><del>-PASS context.createMediaElementSource(null) threw exception TypeError: Type error.
</del><ins>+PASS context.createMediaElementSource(null) threw exception TypeError: Argument 1 ('mediaElement') to AudioContext.createMediaElementSource must be an instance of HTMLMediaElement.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestswebaudiomediaelementaudiosourcenodehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/webaudio/mediaelementaudiosourcenode.html (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/webaudio/mediaelementaudiosourcenode.html        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/LayoutTests/webaudio/mediaelementaudiosourcenode.html        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> testPassed("createMediaElementSource() threw error when called twice on same HTMLMediaElement.");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- shouldThrow("context.createMediaElementSource(null)", "'TypeError: Type error'");
</del><ins>+ shouldThrow("context.createMediaElementSource(null)", "'TypeError: Argument 1 (\\'mediaElement\\') to AudioContext.createMediaElementSource must be an instance of HTMLMediaElement'");
</ins><span class="cx">
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/ChangeLog        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -1,3 +1,72 @@
</span><ins>+2016-05-09 Chris Dumez <cdumez@apple.com>
+
+ Optimize [StrictTypeChecking] on IDL operations
+ https://bugs.webkit.org/show_bug.cgi?id=157467
+
+ Reviewed by Darin Adler.
+
+ Optimize [StrictTypeChecking] on IDL operations so that:
+ - Only generate extra code for nullable parameters because for non-nullable
+ parameters, JSXXX::toWrapped() will return null in case of a bad input
+ type. We will then throw a TypeError when null-checking it already.
+ - After the JSValue::isNullOrUndefined() check, avoid calling
+ JSXXX::toWrapped() and set nativeValue to nullptr directly.
+ - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
+ check on the value returned by JSXXX::toWrapped(). toWrapped() already
+ does a JSValue::inherits(JSXXX::info() check. Since we only call
+ toWrapped() if the JSValue is not null/undefined, a null return value
+ always indicates a bad input type.
+
+ Also update the TypeError message to be more useful when passing null
+ for non-nullable parameters or assigning null to a non-nullable
+ attribute. The message is now consistent with the one used for strict
+ type checking.
+
+ No new tests, rebaselined existing tests.
+
+ * bindings/js/JSDOMBinding.h:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateParametersCheck):
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ (WebCore::setJSTestInterfaceImplementsNode):
+ (WebCore::setJSTestInterfaceSupplementalNode):
+ (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
+ (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::setJSTestObjTestObjAttr):
+ (WebCore::setJSTestObjLenientTestObjAttr):
+ (WebCore::setJSTestObjXMLObjAttr):
+ (WebCore::setJSTestObjTypedArrayAttr):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
+ (WebCore::setJSTestObjWithScriptStateAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
+ (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
+ (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
+ (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
+ (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
+ (WebCore::jsTestObjPrototypeFunctionConvert1):
+ (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
+ (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
+ (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
+ (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+ (WebCore::constructJSTestOverloadedConstructors1):
+ (WebCore::constructJSTestOverloadedConstructors2):
+ (WebCore::constructJSTestOverloadedConstructors3):
+ * bindings/scripts/test/TestObj.idl:
+
</ins><span class="cx"> 2016-05-09 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Download progress on attachment elements sometimes exceeds element bounds
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentMustBeEnumError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedValues);
</span><span class="cx"> JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName);
</span><del>-JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType);
</del><ins>+WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType);
</ins><span class="cx"> JSC::EncodedJSValue throwConstructorDocumentUnavailableError(JSC::ExecState&, const char* interfaceName);
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwGetterTypeError(JSC::ExecState&, const char* interfaceName, const char* attributeName);
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwThisTypeError(JSC::ExecState&, const char* interfaceName, const char* functionName);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -2917,13 +2917,15 @@
</span><span class="cx"> push(@implContent, " ExceptionCode ec = 0;\n");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ my $shouldPassByReference = ShouldPassWrapperByReference($attribute->signature, $interface);
+
</ins><span class="cx"> # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
</span><span class="cx"> # interface type, then if the incoming value does not implement that interface, a TypeError
</span><span class="cx"> # is thrown rather than silently passing NULL to the C++ code.
</span><span class="cx"> # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to
</span><span class="cx"> # both strings and numbers, so do not throw TypeError if the attribute is of these types.
</span><span class="cx"> my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $attribute->signature, "value", $attribute->signature->extendedAttributes->{"Conditional"});
</span><del>- if ($codeGenerator->IsWrapperType($type) && $attribute->signature->extendedAttributes->{"StrictTypeChecking"} && $attribute->signature->isNullable) {
</del><ins>+ if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"} && !$shouldPassByReference && $codeGenerator->IsWrapperType($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">@@ -2950,10 +2952,9 @@
</span><span class="cx"> push (@implContent, " return false;\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $shouldPassByReference = ShouldPassWrapperByReference($attribute->signature, $interface);
</del><span class="cx"> if ($shouldPassByReference) {
</span><span class="cx"> push(@implContent, " if (UNLIKELY(!nativeValue)) {\n");
</span><del>- push(@implContent, " throwVMTypeError(state);\n");
</del><ins>+ push(@implContent, " throwAttributeTypeError(*state, \"$interfaceName\", \"$name\", \"$type\");\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">@@ -3733,68 +3734,71 @@
</span><span class="cx">
</span><span class="cx"> push(@$outputArray, " }\n") if $indent ne "";
</span><span class="cx"> } else {
</span><del>- # If the "StrictTypeChecking" extended attribute is present, and the argument'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 semantics, incoming values can always be converted to both
- # strings and numbers, so do not throw TypeError if the argument is of these types.
- if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) {
- $implIncludes{"<runtime/Error.h>"} = 1;
-
- my $argValue = "state->argument($argumentIndex)";
- if ($codeGenerator->IsWrapperType($type)) {
- push(@$outputArray, " if (UNLIKELY(!${argValue}.isUndefinedOrNull() && !${argValue}.inherits(JS${type}::info())))\n");
- push(@$outputArray, " return throwArgumentTypeError(*state, $argumentIndex, \"$name\", \"$interfaceName\", $quotedFunctionName, \"$type\");\n");
- }
- }
-
</del><span class="cx"> my $outer;
</span><span class="cx"> my $inner;
</span><span class="cx"> my $nativeType = GetNativeTypeFromSignature($interface, $parameter);
</span><ins>+ my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($type) && $interfaceName !~ /List$/;
+ my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($parameter, $interface);
</ins><span class="cx">
</span><del>- if ($parameter->isOptional && defined($parameter->default) && !WillConvertUndefinedToDefaultParameterValue($type, $parameter->default)) {
- my $defaultValue = $parameter->default;
-
- # String-related optimizations.
- if ($type eq "DOMString") {
- my $useAtomicString = $parameter->extendedAttributes->{"AtomicString"};
- if ($defaultValue eq "null") {
- $defaultValue = $useAtomicString ? "nullAtom" : "String()";
- } elsif ($defaultValue eq "\"\"") {
- $defaultValue = $useAtomicString ? "emptyAtom" : "emptyString()";
</del><ins>+ if ($function->signature->extendedAttributes->{"StrictTypeChecking"} && !$shouldPassByReference && $codeGenerator->IsWrapperType($type)) {
+ $implIncludes{"<runtime/Error.h>"} = 1;
+ my $checkedArgument = "state->argument($argumentIndex)";
+ my $uncheckedArgument = "state->uncheckedArgument($argumentIndex)";
+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $uncheckedArgument, $function->signature->extendedAttributes->{"Conditional"});
+ push(@$outputArray, " $nativeType $name = nullptr;\n");
+ push(@$outputArray, " if (!$checkedArgument.isUndefinedOrNull()) {\n");
+ push(@$outputArray, " $name = $nativeValue;\n");
+ if ($mayThrowException) {
+ push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
+ push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
+ }
+ push(@$outputArray, " if (UNLIKELY(!$name))\n");
+ push(@$outputArray, " return throwArgumentTypeError(*state, $argumentIndex, \"$name\", \"$interfaceName\", $quotedFunctionName, \"$type\");\n");
+ push(@$outputArray, " }\n");
+ } else {
+ if ($parameter->isOptional && defined($parameter->default) && !WillConvertUndefinedToDefaultParameterValue($type, $parameter->default)) {
+ my $defaultValue = $parameter->default;
+
+ # String-related optimizations.
+ if ($type eq "DOMString") {
+ my $useAtomicString = $parameter->extendedAttributes->{"AtomicString"};
+ if ($defaultValue eq "null") {
+ $defaultValue = $useAtomicString ? "nullAtom" : "String()";
+ } elsif ($defaultValue eq "\"\"") {
+ $defaultValue = $useAtomicString ? "emptyAtom" : "emptyString()";
+ } else {
+ $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)";
+ }
</ins><span class="cx"> } else {
</span><del>- $defaultValue = $useAtomicString ? "AtomicString($defaultValue, AtomicString::ConstructFromLiteral)" : "ASCIILiteral($defaultValue)";
</del><ins>+ $defaultValue = "nullptr" if $defaultValue eq "null";
+ $defaultValue = "PNaN" if $defaultValue eq "NaN";
+ $defaultValue = "$nativeType()" if $defaultValue eq "[]";
+ $defaultValue = "JSValue::JSUndefined" if $defaultValue eq "undefined";
</ins><span class="cx"> }
</span><ins>+
+ $outer = "state->argument($argumentIndex).isUndefined() ? $defaultValue : ";
+ $inner = "state->uncheckedArgument($argumentIndex)";
+ } elsif ($parameter->isOptional && !defined($parameter->default)) {
+ # Use WTF::Optional<>() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
+ $outer = "state->argument($argumentIndex).isUndefined() ? Optional<$nativeType>() : ";
+ $inner = "state->uncheckedArgument($argumentIndex)";
</ins><span class="cx"> } else {
</span><del>- $defaultValue = "nullptr" if $defaultValue eq "null";
- $defaultValue = "PNaN" if $defaultValue eq "NaN";
- $defaultValue = "$nativeType()" if $defaultValue eq "[]";
- $defaultValue = "JSValue::JSUndefined" if $defaultValue eq "undefined";
</del><ins>+ $outer = "";
+ $inner = "state->argument($argumentIndex)";
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- $outer = "state->argument($argumentIndex).isUndefined() ? $defaultValue : ";
- $inner = "state->uncheckedArgument($argumentIndex)";
- } elsif ($parameter->isOptional && !defined($parameter->default)) {
- # Use WTF::Optional<>() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
- $outer = "state->argument($argumentIndex).isUndefined() ? Optional<$nativeType>() : ";
- $inner = "state->uncheckedArgument($argumentIndex)";
- } else {
- $outer = "";
- $inner = "state->argument($argumentIndex)";
</del><ins>+ my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function->signature->extendedAttributes->{"Conditional"});
+ push(@$outputArray, " auto $name = ${outer}${nativeValue};\n");
+ $value = "WTFMove($name)";
+ if ($mayThrowException) {
+ push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
+ push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
+ }
</ins><span class="cx"> }
</span><del>- my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function->signature->extendedAttributes->{"Conditional"});
- push(@$outputArray, " auto $name = ${outer}${nativeValue};\n");
- $value = "WTFMove($name)";
- if ($mayThrowException) {
- push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- }
</del><span class="cx">
</span><del>- my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($type) && $interfaceName !~ /List$/;
- my $shouldPassByReference = ShouldPassWrapperByReference($parameter, $interface);
- if ($isTearOff or $shouldPassByReference) {
</del><ins>+ if ($shouldPassByReference) {
</ins><span class="cx"> push(@$outputArray, " if (UNLIKELY(!$name))\n");
</span><del>- push(@$outputArray, " return throwVMTypeError(state);\n");
</del><ins>+ push(@$outputArray, " return throwArgumentTypeError(*state, $argumentIndex, \"$name\", \"$interfaceName\", $quotedFunctionName, \"$type\");\n");
</ins><span class="cx"> $value = $isTearOff ? "$name->propertyReference()" : "*$name";
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto nextChild = JSNode::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!nextChild))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "nextChild", "TestActiveDOMObject", "excitingFunction", "Node");
</ins><span class="cx"> impl.excitingFunction(*nextChild);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -685,7 +685,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSNode::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestInterface", "implementsNode", "Node");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setImplementsNode(*nativeValue);
</span><span class="lines">@@ -753,7 +753,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSNode::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestInterface", "supplementalNode", "Node");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue);
</span><span class="lines">@@ -802,7 +802,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(1));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 1, "objArg", "TestInterface", "implementsMethod2", "TestObj");
</ins><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, WTFMove(strArg), *objArg, ec)));
</span><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="lines">@@ -868,7 +868,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(1));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj");
</ins><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg, ec)));
</span><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -2866,7 +2866,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "testObjAttr", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setTestObjAttr(*nativeValue);
</span><span class="lines">@@ -2900,7 +2900,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "lenientTestObjAttr", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setLenientTestObjAttr(*nativeValue);
</span><span class="lines">@@ -2936,7 +2936,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "XMLObjAttr", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setXMLObjAttr(*nativeValue);
</span><span class="lines">@@ -3146,7 +3146,7 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "typedArrayAttr", "Float32Array");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setTypedArrayAttr(nativeValue.get());
</span><span class="lines">@@ -3368,7 +3368,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptExecutionContextAttribute", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="lines">@@ -3390,7 +3390,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptStateAttributeRaises", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setWithScriptStateAttributeRaises(*state, *nativeValue);
</span><span class="lines">@@ -3409,7 +3409,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptExecutionContextAttributeRaises", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="lines">@@ -3431,7 +3431,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttribute", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="lines">@@ -3453,7 +3453,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateAttributeRaises", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="lines">@@ -3475,7 +3475,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptExecutionContextAndScriptStateWithSpacesAttribute", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext();
</span><span class="lines">@@ -3497,7 +3497,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> auto nativeValue = JSTestObj::toWrapped(value);
</span><span class="cx"> if (UNLIKELY(!nativeValue)) {
</span><del>- throwVMTypeError(state);
</del><ins>+ throwAttributeTypeError(*state, "TestObj", "withScriptArgumentsAndCallStackAttribute", "TestObj");
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> impl.setWithScriptArgumentsAndCallStackAttribute(*nativeValue);
</span><span class="lines">@@ -3926,7 +3926,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(2));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 2, "objArg", "TestObj", "voidMethodWithArgs", "TestObj");
</ins><span class="cx"> impl.voidMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -3961,7 +3961,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(2));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 2, "objArg", "TestObj", "byteMethodWithArgs", "TestObj");
</ins><span class="cx"> JSValue result = jsNumber(impl.byteMethodWithArgs(WTFMove(byteArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -3996,7 +3996,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(2));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 2, "objArg", "TestObj", "octetMethodWithArgs", "TestObj");
</ins><span class="cx"> JSValue result = jsNumber(impl.octetMethodWithArgs(WTFMove(octetArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -4031,7 +4031,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(2));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 2, "objArg", "TestObj", "longMethodWithArgs", "TestObj");
</ins><span class="cx"> JSValue result = jsNumber(impl.longMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -4066,7 +4066,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(2));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 2, "objArg", "TestObj", "objMethodWithArgs", "TestObj");
</ins><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(WTFMove(longArg), WTFMove(strArg), *objArg)));
</span><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -4114,7 +4114,7 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> if (UNLIKELY(!resolver))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "resolver", "TestObj", "methodWithXPathNSResolverParameter", "XPathNSResolver");
</ins><span class="cx"> impl.methodWithXPathNSResolverParameter(*resolver);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -4250,7 +4250,7 @@
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(1));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 1, "objArg", "TestObj", "methodThatRequiresAllArgsAndThrows", "TestObj");
</ins><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(WTFMove(strArg), *objArg, ec)));
</span><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="lines">@@ -5277,7 +5277,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "overloadedMethod", "TestObj");
</ins><span class="cx"> impl.overloadedMethod(*objArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -5594,7 +5594,7 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> if (UNLIKELY(!values))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "values", "TestObj", "domStringListFunction", "DOMStringList");
</ins><span class="cx"> JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.domStringListFunction(*values, ec)));
</span><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="lines">@@ -5687,7 +5687,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto value = JSTestNode::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!value))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "value", "TestObj", "convert1", "TestNode");
</ins><span class="cx"> impl.convert1(*value);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -5814,15 +5814,16 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
- return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
- auto objArg = JSTestObj::toWrapped(state->argument(0));
- if (UNLIKELY(!objArg))
- return throwVMTypeError(state);
</del><ins>+ TestObj* objArg = nullptr;
+ if (!state->argument(0).isUndefinedOrNull()) {
+ objArg = JSTestObj::toWrapped(state->uncheckedArgument(0));
+ if (UNLIKELY(!objArg))
+ return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
+ }
</ins><span class="cx"> auto a = toNativeArray<uint32_t>(state, state->argument(1));
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- JSValue result = jsBoolean(impl.strictFunctionWithSequence(*objArg, WTFMove(a), ec));
</del><ins>+ JSValue result = jsBoolean(impl.strictFunctionWithSequence(objArg, WTFMove(a), ec));
</ins><span class="cx">
</span><span class="cx"> setDOMException(state, ec);
</span><span class="cx"> return JSValue::encode(result);
</span><span class="lines">@@ -5839,11 +5840,9 @@
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
- return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
</del><span class="cx"> auto objArg = JSTestObj::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!objArg))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
</ins><span class="cx"> auto array = toNativeArray<int32_t>(state, state->argument(1));
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5905,7 +5904,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto head = JSNode::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!head))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "head", "TestObj", "variadicNodeMethod", "Node");
</ins><span class="cx"> Vector<Node*> tail;
</span><span class="cx"> for (unsigned i = 1, count = state->argumentCount(); i < count; ++i) {
</span><span class="cx"> if (!state->uncheckedArgument(i).inherits(JSNode::info()))
</span><span class="lines">@@ -6059,7 +6058,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto request = JSFetchRequest::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!request))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "request", "TestObj", "testPromiseOverloadedFunction", "FetchRequest");
</ins><span class="cx"> impl.testPromiseOverloadedFunction(*request, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> if (UNLIKELY(!arrayBuffer))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer");
</ins><span class="cx"> RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*arrayBuffer);
</span><span class="cx"> return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
</span><span class="cx"> }
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> if (UNLIKELY(!arrayBufferView))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView");
</ins><span class="cx"> RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*arrayBufferView);
</span><span class="cx"> return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
</span><span class="cx"> }
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx"> auto blob = JSBlob::toWrapped(state->argument(0));
</span><span class="cx"> if (UNLIKELY(!blob))
</span><del>- return throwVMTypeError(state);
</del><ins>+ return throwArgumentTypeError(*state, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob");
</ins><span class="cx"> RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*blob);
</span><span class="cx"> return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (200582 => 200583)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-09 18:05:20 UTC (rev 200582)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-09 19:46:35 UTC (rev 200583)
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx"> [StrictTypeChecking] attribute unrestricted float strictFloat;
</span><span class="cx"> [StrictTypeChecking, RaisesException] boolean strictFunction(DOMString str, unrestricted float a, long b);
</span><span class="cx">
</span><del>- [StrictTypeChecking, RaisesException] boolean strictFunctionWithSequence(TestObj objArg, sequence<unsigned long> a);
</del><ins>+ [StrictTypeChecking, RaisesException] boolean strictFunctionWithSequence(TestObj? objArg, sequence<unsigned long> a);
</ins><span class="cx"> [StrictTypeChecking, RaisesException] boolean strictFunctionWithArray(TestObj objArg, long[] array);
</span><span class="cx">
</span><span class="cx"> // ObjectiveC reserved words.
</span></span></pre>
</div>
</div>
</body>
</html>