<!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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;rniwa@webkit.org&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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"> &lt;script&gt;
</span><span class="cx"> description(&quot;Tests that document.adoptNode(null) throws a TypeError&quot;);
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;document.adoptNode(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;document.adoptNode(null)&quot;, &quot;'TypeError: Argument 1 (\\'source\\') to Document.adoptNode must be an instance of Node'&quot;);
</ins><span class="cx"> shouldThrow(&quot;document.adoptNode()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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"> &lt;script&gt;
</span><span class="cx"> description(&quot;Tests that document.importNode(null) throws a TypeError&quot;);
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;document.importNode(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;document.importNode(null)&quot;, &quot;'TypeError: Argument 1 (\\'importedNode\\') to Document.importNode must be an instance of Node'&quot;);
</ins><span class="cx"> shouldThrow(&quot;document.importNode()&quot;, &quot;'TypeError: Not enough arguments'&quot;);
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS element.setAttributeNode(&quot;style&quot;); 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(&quot;style&quot;); 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(&quot;style&quot;); 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(&quot;style&quot;); 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(&quot;style&quot;); 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(&quot;style&quot;); 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(&quot;&quot;)
</span><span class="cx"> debug(&quot;Null root node&quot;);
</span><del>-shouldThrow(&quot;document.createNodeIterator(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;document.createNodeIterator(null)&quot;, &quot;'TypeError: Argument 1 (\\'root\\') to Document.createNodeIterator must be an instance of Node'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Default parameters&quot;);
</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(&quot;&quot;)
</span><span class="cx"> debug(&quot;Null root node&quot;);
</span><del>-shouldThrow(&quot;document.createTreeWalker(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;document.createTreeWalker(null)&quot;, &quot;'TypeError: Argument 1 (\\'root\\') to Document.createTreeWalker must be an instance of Node'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Default parameters&quot;);
</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 = &lt;html&gt;&lt;title&gt;Hello World&lt;/title&gt;&lt;/html&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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=&quot;true&quot;')
</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=&quot;true&quot;')
</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)', &quot;'TypeError: Type error'&quot;);
</del><ins>+                testException('mediaKeySession.update(null)', &quot;'TypeError: Argument 1 (\\'key\\') to MediaKeySession.update must be an instance of Uint8Array'&quot;);
</ins><span class="cx">                 endTest();
</span><span class="cx">             }
</span><span class="cx">         &lt;/script&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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(&quot;Tests that passing null to context.createMediaStreamSource() throws a TypeError.&quot;);
</span><span class="cx"> 
</span><span class="cx"> var context = new webkitAudioContext();
</span><del>-shouldThrow(&quot;context.createMediaStreamSource(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;context.createMediaStreamSource(null)&quot;, &quot;'TypeError: Argument 1 (\\'mediaStream\\') to AudioContext.createMediaStreamSource must be an instance of MediaStream'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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(&quot;context.decodeAudioData(null, function(){}, function(){});&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;context.decodeAudioData(null, function(){}, function(){});&quot;, &quot;'TypeError: Argument 1 (\\'audioData\\') to AudioContext.decodeAudioData must be an instance of ArrayBuffer'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> var decodeCaseArray = [{url: &quot;resources/media/24bit-44khz.wav&quot;, result: true},
</span><span class="cx">                        {url: &quot;resources/media/invalid-audio-file.txt&quot;, 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(&quot;createMediaElementSource() threw error when called twice on same HTMLMediaElement.&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    shouldThrow(&quot;context.createMediaElementSource(null)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+    shouldThrow(&quot;context.createMediaElementSource(null)&quot;, &quot;'TypeError: Argument 1 (\\'mediaElement\\') to AudioContext.createMediaElementSource must be an instance of HTMLMediaElement'&quot;);
</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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;timothy_horton@apple.com&gt;
</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&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedValues);
</span><span class="cx"> JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName);
</span><del>-JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType);
</del><ins>+WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType);
</ins><span class="cx"> JSC::EncodedJSValue throwConstructorDocumentUnavailableError(JSC::ExecState&amp;, const char* interfaceName);
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwGetterTypeError(JSC::ExecState&amp;, const char* interfaceName, const char* attributeName);
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwThisTypeError(JSC::ExecState&amp;, 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, &quot;    ExceptionCode ec = 0;\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+                my $shouldPassByReference = ShouldPassWrapperByReference($attribute-&gt;signature, $interface);
+
</ins><span class="cx">                 # If the &quot;StrictTypeChecking&quot; 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-&gt;signature, &quot;value&quot;, $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
</span><del>-                if ($codeGenerator-&gt;IsWrapperType($type) &amp;&amp; $attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;} &amp;&amp; $attribute-&gt;signature-&gt;isNullable) {
</del><ins>+                if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;} &amp;&amp; !$shouldPassByReference &amp;&amp; $codeGenerator-&gt;IsWrapperType($type)) {
</ins><span class="cx">                     $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx">                     push(@implContent, &quot;    &quot; . GetNativeTypeFromSignature($interface, $attribute-&gt;signature) . &quot; nativeValue = nullptr;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    if (!value.isUndefinedOrNull()) {\n&quot;);
</span><span class="lines">@@ -2950,10 +2952,9 @@
</span><span class="cx">                     push (@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                my $shouldPassByReference = ShouldPassWrapperByReference($attribute-&gt;signature, $interface);
</del><span class="cx">                 if ($shouldPassByReference) {
</span><span class="cx">                     push(@implContent, &quot;    if (UNLIKELY(!nativeValue)) {\n&quot;);
</span><del>-                    push(@implContent, &quot;        throwVMTypeError(state);\n&quot;);
</del><ins>+                    push(@implContent, &quot;        throwAttributeTypeError(*state, \&quot;$interfaceName\&quot;, \&quot;$name\&quot;, \&quot;$type\&quot;);\n&quot;);
</ins><span class="cx">                     push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;    }\n&quot;);
</span><span class="cx">                 }
</span><span class="lines">@@ -3733,68 +3734,71 @@
</span><span class="cx"> 
</span><span class="cx">             push(@$outputArray, &quot;    }\n&quot;) if $indent ne &quot;&quot;;
</span><span class="cx">         } else {
</span><del>-            # If the &quot;StrictTypeChecking&quot; 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-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;}) {
-                $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
-
-                my $argValue = &quot;state-&gt;argument($argumentIndex)&quot;;
-                if ($codeGenerator-&gt;IsWrapperType($type)) {
-                    push(@$outputArray, &quot;    if (UNLIKELY(!${argValue}.isUndefinedOrNull() &amp;&amp; !${argValue}.inherits(JS${type}::info())))\n&quot;);
-                    push(@$outputArray, &quot;        return throwArgumentTypeError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
-                }
-            }
-
</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-&gt;IsSVGTypeNeedingTearOff($type) &amp;&amp; $interfaceName !~ /List$/;
+            my $shouldPassByReference = $isTearOff || ShouldPassWrapperByReference($parameter, $interface);
</ins><span class="cx"> 
</span><del>-            if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($type, $parameter-&gt;default)) {
-                my $defaultValue = $parameter-&gt;default;
-
-                # String-related optimizations.
-                if ($type eq &quot;DOMString&quot;) {
-                    my $useAtomicString = $parameter-&gt;extendedAttributes-&gt;{&quot;AtomicString&quot;};
-                    if ($defaultValue eq &quot;null&quot;) {
-                        $defaultValue = $useAtomicString ? &quot;nullAtom&quot; : &quot;String()&quot;;
-                    } elsif ($defaultValue eq &quot;\&quot;\&quot;&quot;) {
-                        $defaultValue = $useAtomicString ? &quot;emptyAtom&quot; : &quot;emptyString()&quot;;
</del><ins>+            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;} &amp;&amp; !$shouldPassByReference &amp;&amp; $codeGenerator-&gt;IsWrapperType($type)) {
+                $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
+                my $checkedArgument = &quot;state-&gt;argument($argumentIndex)&quot;;
+                my $uncheckedArgument = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
+                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $uncheckedArgument, $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
+                push(@$outputArray, &quot;    $nativeType $name = nullptr;\n&quot;);
+                push(@$outputArray, &quot;    if (!$checkedArgument.isUndefinedOrNull()) {\n&quot;);
+                push(@$outputArray, &quot;        $name = $nativeValue;\n&quot;);
+                if ($mayThrowException) {
+                    push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
+                    push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
+                }
+                push(@$outputArray, &quot;        if (UNLIKELY(!$name))\n&quot;);
+                push(@$outputArray, &quot;            return throwArgumentTypeError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
+                push(@$outputArray, &quot;    }\n&quot;);
+            } else {
+                if ($parameter-&gt;isOptional &amp;&amp; defined($parameter-&gt;default) &amp;&amp; !WillConvertUndefinedToDefaultParameterValue($type, $parameter-&gt;default)) {
+                    my $defaultValue = $parameter-&gt;default;
+    
+                    # String-related optimizations.
+                    if ($type eq &quot;DOMString&quot;) {
+                        my $useAtomicString = $parameter-&gt;extendedAttributes-&gt;{&quot;AtomicString&quot;};
+                        if ($defaultValue eq &quot;null&quot;) {
+                            $defaultValue = $useAtomicString ? &quot;nullAtom&quot; : &quot;String()&quot;;
+                        } elsif ($defaultValue eq &quot;\&quot;\&quot;&quot;) {
+                            $defaultValue = $useAtomicString ? &quot;emptyAtom&quot; : &quot;emptyString()&quot;;
+                        } else {
+                            $defaultValue = $useAtomicString ? &quot;AtomicString($defaultValue, AtomicString::ConstructFromLiteral)&quot; : &quot;ASCIILiteral($defaultValue)&quot;;
+                        }
</ins><span class="cx">                     } else {
</span><del>-                        $defaultValue = $useAtomicString ? &quot;AtomicString($defaultValue, AtomicString::ConstructFromLiteral)&quot; : &quot;ASCIILiteral($defaultValue)&quot;;
</del><ins>+                        $defaultValue = &quot;nullptr&quot; if $defaultValue eq &quot;null&quot;;
+                        $defaultValue = &quot;PNaN&quot; if $defaultValue eq &quot;NaN&quot;;
+                        $defaultValue = &quot;$nativeType()&quot; if $defaultValue eq &quot;[]&quot;;
+                        $defaultValue = &quot;JSValue::JSUndefined&quot; if $defaultValue eq &quot;undefined&quot;;
</ins><span class="cx">                     }
</span><ins>+    
+                    $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? $defaultValue : &quot;;
+                    $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
+                } elsif ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
+                    # Use WTF::Optional&lt;&gt;() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
+                    $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? Optional&lt;$nativeType&gt;() : &quot;;
+                    $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
</ins><span class="cx">                 } else {
</span><del>-                    $defaultValue = &quot;nullptr&quot; if $defaultValue eq &quot;null&quot;;
-                    $defaultValue = &quot;PNaN&quot; if $defaultValue eq &quot;NaN&quot;;
-                    $defaultValue = &quot;$nativeType()&quot; if $defaultValue eq &quot;[]&quot;;
-                    $defaultValue = &quot;JSValue::JSUndefined&quot; if $defaultValue eq &quot;undefined&quot;;
</del><ins>+                    $outer = &quot;&quot;;
+                    $inner = &quot;state-&gt;argument($argumentIndex)&quot;;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? $defaultValue : &quot;;
-                $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
-            } elsif ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
-                # Use WTF::Optional&lt;&gt;() for optional parameters that are missing or undefined and that do not have a default value in the IDL.
-                $outer = &quot;state-&gt;argument($argumentIndex).isUndefined() ? Optional&lt;$nativeType&gt;() : &quot;;
-                $inner = &quot;state-&gt;uncheckedArgument($argumentIndex)&quot;;
-            } else {
-                $outer = &quot;&quot;;
-                $inner = &quot;state-&gt;argument($argumentIndex)&quot;;
</del><ins>+                my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
+                push(@$outputArray, &quot;    auto $name = ${outer}${nativeValue};\n&quot;);
+                $value = &quot;WTFMove($name)&quot;;
+                if ($mayThrowException) {
+                    push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
+                    push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
+                }
</ins><span class="cx">             }
</span><del>-            my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $parameter, $inner, $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;});
-            push(@$outputArray, &quot;    auto $name = ${outer}${nativeValue};\n&quot;);
-            $value = &quot;WTFMove($name)&quot;;
-            if ($mayThrowException) {
-                push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
-                push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
-            }
</del><span class="cx"> 
</span><del>-            my $isTearOff = $codeGenerator-&gt;IsSVGTypeNeedingTearOff($type) &amp;&amp; $interfaceName !~ /List$/;
-            my $shouldPassByReference = ShouldPassWrapperByReference($parameter, $interface);
-            if ($isTearOff or $shouldPassByReference) {
</del><ins>+            if ($shouldPassByReference) {
</ins><span class="cx">                 push(@$outputArray, &quot;    if (UNLIKELY(!$name))\n&quot;);
</span><del>-                push(@$outputArray, &quot;        return throwVMTypeError(state);\n&quot;);
</del><ins>+                push(@$outputArray, &quot;        return throwArgumentTypeError(*state, $argumentIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, \&quot;$type\&quot;);\n&quot;);
</ins><span class="cx">                 $value = $isTearOff ? &quot;$name-&gt;propertyReference()&quot; : &quot;*$name&quot;;
</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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!nextChild))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;nextChild&quot;, &quot;TestActiveDOMObject&quot;, &quot;excitingFunction&quot;, &quot;Node&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestInterface&quot;, &quot;implementsNode&quot;, &quot;Node&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestInterface&quot;, &quot;supplementalNode&quot;, &quot;Node&quot;);
</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-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 1, &quot;objArg&quot;, &quot;TestInterface&quot;, &quot;implementsMethod2&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     JSValue result = toJS(state, castedThis-&gt;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-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 1, &quot;objArg&quot;, &quot;TestInterface&quot;, &quot;supplementalMethod2&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     JSValue result = toJS(state, castedThis-&gt;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&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;testObjAttr&quot;, &quot;TestObj&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;lenientTestObjAttr&quot;, &quot;TestObj&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;XMLObjAttr&quot;, &quot;TestObj&quot;);
</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-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     if (UNLIKELY(!nativeValue)) {
</span><del>-        throwVMTypeError(state);
</del><ins>+        throwAttributeTypeError(*state, &quot;TestObj&quot;, &quot;typedArrayAttr&quot;, &quot;Float32Array&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptExecutionContextAttribute&quot;, &quot;TestObj&quot;);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="lines">@@ -3390,7 +3390,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptStateAttributeRaises&quot;, &quot;TestObj&quot;);
</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&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptExecutionContextAttributeRaises&quot;, &quot;TestObj&quot;);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="lines">@@ -3431,7 +3431,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptExecutionContextAndScriptStateAttribute&quot;, &quot;TestObj&quot;);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="lines">@@ -3453,7 +3453,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptExecutionContextAndScriptStateAttributeRaises&quot;, &quot;TestObj&quot;);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="lines">@@ -3475,7 +3475,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptExecutionContextAndScriptStateWithSpacesAttribute&quot;, &quot;TestObj&quot;);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     auto* context = jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject())-&gt;scriptExecutionContext();
</span><span class="lines">@@ -3497,7 +3497,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;withScriptArgumentsAndCallStackAttribute&quot;, &quot;TestObj&quot;);
</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-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 2, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;voidMethodWithArgs&quot;, &quot;TestObj&quot;);
</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-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 2, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;byteMethodWithArgs&quot;, &quot;TestObj&quot;);
</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-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 2, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;octetMethodWithArgs&quot;, &quot;TestObj&quot;);
</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-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 2, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;longMethodWithArgs&quot;, &quot;TestObj&quot;);
</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-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 2, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;objMethodWithArgs&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     JSValue result = toJS(state, castedThis-&gt;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-&gt;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, &quot;resolver&quot;, &quot;TestObj&quot;, &quot;methodWithXPathNSResolverParameter&quot;, &quot;XPathNSResolver&quot;);
</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-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 1, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;methodThatRequiresAllArgsAndThrows&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     JSValue result = toJS(state, castedThis-&gt;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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;overloadedMethod&quot;, &quot;TestObj&quot;);
</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-&gt;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, &quot;values&quot;, &quot;TestObj&quot;, &quot;domStringListFunction&quot;, &quot;DOMStringList&quot;);
</ins><span class="cx">     JSValue result = toJS(state, castedThis-&gt;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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!value))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;value&quot;, &quot;TestObj&quot;, &quot;convert1&quot;, &quot;TestNode&quot;);
</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-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    if (UNLIKELY(!state-&gt;argument(0).isUndefinedOrNull() &amp;&amp; !state-&gt;argument(0).inherits(JSTestObj::info())))
-        return throwArgumentTypeError(*state, 0, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;strictFunctionWithSequence&quot;, &quot;TestObj&quot;);
-    auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
-    if (UNLIKELY(!objArg))
-        return throwVMTypeError(state);
</del><ins>+    TestObj* objArg = nullptr;
+    if (!state-&gt;argument(0).isUndefinedOrNull()) {
+        objArg = JSTestObj::toWrapped(state-&gt;uncheckedArgument(0));
+        if (UNLIKELY(!objArg))
+            return throwArgumentTypeError(*state, 0, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;strictFunctionWithSequence&quot;, &quot;TestObj&quot;);
+    }
</ins><span class="cx">     auto a = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(state-&gt;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-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    if (UNLIKELY(!state-&gt;argument(0).isUndefinedOrNull() &amp;&amp; !state-&gt;argument(0).inherits(JSTestObj::info())))
-        return throwArgumentTypeError(*state, 0, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;strictFunctionWithArray&quot;, &quot;TestObj&quot;);
</del><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;objArg&quot;, &quot;TestObj&quot;, &quot;strictFunctionWithArray&quot;, &quot;TestObj&quot;);
</ins><span class="cx">     auto array = toNativeArray&lt;int32_t&gt;(state, state-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(state-&gt;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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!head))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;head&quot;, &quot;TestObj&quot;, &quot;variadicNodeMethod&quot;, &quot;Node&quot;);
</ins><span class="cx">     Vector&lt;Node*&gt; tail;
</span><span class="cx">     for (unsigned i = 1, count = state-&gt;argumentCount(); i &lt; count; ++i) {
</span><span class="cx">         if (!state-&gt;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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!request))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;request&quot;, &quot;TestObj&quot;, &quot;testPromiseOverloadedFunction&quot;, &quot;FetchRequest&quot;);
</ins><span class="cx">     impl.testPromiseOverloadedFunction(*request, DeferredWrapper(state, castedThis-&gt;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-&gt;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, &quot;arrayBuffer&quot;, &quot;TestOverloadedConstructors&quot;, nullptr, &quot;ArrayBuffer&quot;);
</ins><span class="cx">     RefPtr&lt;TestOverloadedConstructors&gt; object = TestOverloadedConstructors::create(*arrayBuffer);
</span><span class="cx">     return JSValue::encode(asObject(toJS(state, castedThis-&gt;globalObject(), object.get())));
</span><span class="cx"> }
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;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, &quot;arrayBufferView&quot;, &quot;TestOverloadedConstructors&quot;, nullptr, &quot;ArrayBufferView&quot;);
</ins><span class="cx">     RefPtr&lt;TestOverloadedConstructors&gt; object = TestOverloadedConstructors::create(*arrayBufferView);
</span><span class="cx">     return JSValue::encode(asObject(toJS(state, castedThis-&gt;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-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!blob))
</span><del>-        return throwVMTypeError(state);
</del><ins>+        return throwArgumentTypeError(*state, 0, &quot;blob&quot;, &quot;TestOverloadedConstructors&quot;, nullptr, &quot;Blob&quot;);
</ins><span class="cx">     RefPtr&lt;TestOverloadedConstructors&gt; object = TestOverloadedConstructors::create(*blob);
</span><span class="cx">     return JSValue::encode(asObject(toJS(state, castedThis-&gt;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&lt;unsigned long&gt; a);
</del><ins>+    [StrictTypeChecking, RaisesException] boolean strictFunctionWithSequence(TestObj? objArg, sequence&lt;unsigned long&gt; 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>