<!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>[200556] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200556">200556</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-08 11:29:04 -0700 (Sun, 08 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Bindings] Add convert&lt;&gt;() template specializations for integer types
https://bugs.webkit.org/show_bug.cgi?id=157458

Reviewed by Darin Adler.

Add convert&lt;&gt;() template specializations for integer types and use them
in the JS bindings. Also, treat non-32bit types the same way as the
32bit ones, allowing the compiler to optimize out branching based on
the IntegerConversionConfiguration.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:

* bindings/js/JSDOMBinding.cpp:
(WebCore::enforceRange):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt8EnforceRange):
(WebCore::toUInt8EnforceRange):
(WebCore::toInt8Clamp):
(WebCore::toUInt8Clamp):
(WebCore::toInt8):
(WebCore::toUInt8):
(WebCore::toInt16EnforceRange):
(WebCore::toUInt16EnforceRange):
(WebCore::toInt16Clamp):
(WebCore::toUInt16Clamp):
(WebCore::toInt16):
(WebCore::toUInt16):
(WebCore::toInt32EnforceRange):
(WebCore::toInt32Clamp):
(WebCore::toUInt32Clamp):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
(WebCore::toInt64Clamp):
(WebCore::toUInt64Clamp):
(WebCore::toInt64):
(WebCore::toUInt64):
* bindings/js/JSDOMBinding.h:
- Splt some integer conversion functions into 3 Normal / Clamp /
  Enforce versions, similarly to what was done for 32bit types already.
  This is so that these can be called from the inline functions in
  JSDOMConvert.h, allowing the compiler to optimize out the branches.
- Get rid of some unnecessary state.hadException() checks.

* bindings/js/JSDOMConvert.h:
Add convert&lt;&gt; specializations for integer types.

* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):

* bindings/scripts/CodeGenerator.pm:
- Add utility function to distinguish integer types.
- Have IsNumericType() using the integerType / floatingPointType
  hashes to avoid duplication.
- Stop int / unsigned int from integer types as those are not
  in Web IDL and they are not used.

* bindings/scripts/CodeGeneratorJS.pm:
(GetIntegerConversionType):
(JSValueToNative):
Use convert&lt;&gt;() for converting JSValue to integer types.

* bindings/scripts/IDLParser.pm:
Stop allowing int / unsigned int types as those are not in Web IDL.

* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Rebaseline bindings tests.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactorycpp">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryh">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp">trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMConverth">trunk/Source/WebCore/bindings/js/JSDOMConvert.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp">trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLParserpm">trunk/Source/WebCore/bindings/scripts/IDLParser.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.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="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/ChangeLog        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -1,3 +1,77 @@
</span><ins>+2016-05-08  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Bindings] Add convert&lt;&gt;() template specializations for integer types
+        https://bugs.webkit.org/show_bug.cgi?id=157458
+
+        Reviewed by Darin Adler.
+
+        Add convert&lt;&gt;() template specializations for integer types and use them
+        in the JS bindings. Also, treat non-32bit types the same way as the
+        32bit ones, allowing the compiler to optimize out branching based on
+        the IntegerConversionConfiguration.
+
+        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::enforceRange):
+        (WebCore::toSmallerInt):
+        (WebCore::toSmallerUInt):
+        (WebCore::toInt8EnforceRange):
+        (WebCore::toUInt8EnforceRange):
+        (WebCore::toInt8Clamp):
+        (WebCore::toUInt8Clamp):
+        (WebCore::toInt8):
+        (WebCore::toUInt8):
+        (WebCore::toInt16EnforceRange):
+        (WebCore::toUInt16EnforceRange):
+        (WebCore::toInt16Clamp):
+        (WebCore::toUInt16Clamp):
+        (WebCore::toInt16):
+        (WebCore::toUInt16):
+        (WebCore::toInt32EnforceRange):
+        (WebCore::toInt32Clamp):
+        (WebCore::toUInt32Clamp):
+        (WebCore::toUInt32EnforceRange):
+        (WebCore::toInt64EnforceRange):
+        (WebCore::toUInt64EnforceRange):
+        (WebCore::toInt64Clamp):
+        (WebCore::toUInt64Clamp):
+        (WebCore::toInt64):
+        (WebCore::toUInt64):
+        * bindings/js/JSDOMBinding.h:
+        - Splt some integer conversion functions into 3 Normal / Clamp /
+          Enforce versions, similarly to what was done for 32bit types already.
+          This is so that these can be called from the inline functions in
+          JSDOMConvert.h, allowing the compiler to optimize out the branches.
+        - Get rid of some unnecessary state.hadException() checks.
+
+        * bindings/js/JSDOMConvert.h:
+        Add convert&lt;&gt; specializations for integer types.
+
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::JSNodeFilter::acceptNode):
+
+        * bindings/scripts/CodeGenerator.pm:
+        - Add utility function to distinguish integer types.
+        - Have IsNumericType() using the integerType / floatingPointType
+          hashes to avoid duplication.
+        - Stop int / unsigned int from integer types as those are not
+          in Web IDL and they are not used.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GetIntegerConversionType):
+        (JSValueToNative):
+        Use convert&lt;&gt;() for converting JSValue to integer types.
+
+        * bindings/scripts/IDLParser.pm:
+        Stop allowing int / unsigned int types as those are not in Web IDL.
+
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        Rebaseline bindings tests.
+
</ins><span class="cx"> 2016-05-08  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Correct dictionary bindings handling of optional, null, and undefined
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, Optional&lt;unsigned long long&gt; version, ExceptionCodeWithMessage&amp; ec)
</del><ins>+RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, Optional&lt;uint64_t&gt; version, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::open&quot;);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     static Ref&lt;IDBFactory&gt; create(IDBClient::IDBConnectionProxy&amp;);
</span><span class="cx">     ~IDBFactory();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, Optional&lt;unsigned long long&gt; version, ExceptionCodeWithMessage&amp;);
</del><ins>+    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, Optional&lt;uint64_t&gt; version, ExceptionCodeWithMessage&amp;);
</ins><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><span class="cx">     short cmp(ScriptExecutionContext&amp;, JSC::JSValue first, JSC::JSValue second, ExceptionCodeWithMessage&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;JSCryptoOperationData.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;JSDictionary.h&quot;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -154,90 +155,90 @@
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createAesKeyGenParams(ExecState* exec, JSValue value)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createAesKeyGenParams(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value.isObject()) {
</span><del>-        throwTypeError(exec);
</del><ins>+        throwTypeError(&amp;state);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto result = std::make_unique&lt;CryptoAlgorithmAesKeyGenParams&gt;();
</span><span class="cx"> 
</span><del>-    JSValue lengthValue = getProperty(exec, value.getObject(), &quot;length&quot;);
-    if (exec-&gt;hadException())
</del><ins>+    JSValue lengthValue = getProperty(&amp;state, value.getObject(), &quot;length&quot;);
+    if (state.hadException())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    result-&gt;length = toUInt16(exec, lengthValue, EnforceRange);
</del><ins>+    result-&gt;length = convert&lt;uint16_t&gt;(state, lengthValue, EnforceRange);
</ins><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createHmacParams(ExecState* exec, JSValue value)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createHmacParams(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value.isObject()) {
</span><del>-        throwTypeError(exec);
</del><ins>+        throwTypeError(&amp;state);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSDictionary jsDictionary(exec, value.getObject());
</del><ins>+    JSDictionary jsDictionary(&amp;state, value.getObject());
</ins><span class="cx">     auto result = std::make_unique&lt;CryptoAlgorithmHmacParams&gt;();
</span><span class="cx"> 
</span><span class="cx">     if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><ins>+        ASSERT(state.hadException());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createHmacKeyParams(ExecState* exec, JSValue value)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createHmacKeyParams(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value.isObject()) {
</span><del>-        throwTypeError(exec);
</del><ins>+        throwTypeError(&amp;state);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSDictionary jsDictionary(exec, value.getObject());
</del><ins>+    JSDictionary jsDictionary(&amp;state, value.getObject());
</ins><span class="cx">     auto result = std::make_unique&lt;CryptoAlgorithmHmacKeyParams&gt;();
</span><span class="cx"> 
</span><span class="cx">     if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><ins>+        ASSERT(state.hadException());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     result-&gt;hasLength = jsDictionary.get(&quot;length&quot;, result-&gt;length);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (state.hadException())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaKeyGenParams(ExecState* exec, JSValue value)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaKeyGenParams(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value.isObject()) {
</span><del>-        throwTypeError(exec);
</del><ins>+        throwTypeError(&amp;state);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSDictionary jsDictionary(exec, value.getObject());
</del><ins>+    JSDictionary jsDictionary(&amp;state, value.getObject());
</ins><span class="cx">     auto result = std::make_unique&lt;CryptoAlgorithmRsaKeyGenParams&gt;();
</span><span class="cx"> 
</span><del>-    JSValue modulusLengthValue = getProperty(exec, value.getObject(), &quot;modulusLength&quot;);
-    if (exec-&gt;hadException())
</del><ins>+    JSValue modulusLengthValue = getProperty(&amp;state, value.getObject(), &quot;modulusLength&quot;);
+    if (state.hadException())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Why no EnforceRange? Filed as &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23779&gt;.
</span><del>-    result-&gt;modulusLength = toUInt32(exec, modulusLengthValue, NormalConversion);
-    if (exec-&gt;hadException())
</del><ins>+    result-&gt;modulusLength = convert&lt;uint32_t&gt;(state, modulusLengthValue, NormalConversion);
+    if (state.hadException())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    JSValue publicExponentValue = getProperty(exec, value.getObject(), &quot;publicExponent&quot;);
-    if (exec-&gt;hadException())
</del><ins>+    JSValue publicExponentValue = getProperty(&amp;state, value.getObject(), &quot;publicExponent&quot;);
+    if (state.hadException())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Uint8Array&gt; publicExponentArray = toUint8Array(publicExponentValue);
</span><span class="cx">     if (!publicExponentArray) {
</span><del>-        throwTypeError(exec, &quot;Expected a Uint8Array in publicExponent&quot;);
</del><ins>+        throwTypeError(&amp;state, &quot;Expected a Uint8Array in publicExponent&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx">     result-&gt;publicExponent.append(publicExponentArray-&gt;data(), publicExponentArray-&gt;byteLength());
</span><span class="lines">@@ -247,7 +248,7 @@
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaKeyParamsWithHash(ExecState*, JSValue)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaKeyParamsWithHash(ExecState&amp;, JSValue)
</ins><span class="cx"> {
</span><span class="cx">     // WebCrypto RSA algorithms currently do not take any parameters to importKey.
</span><span class="cx">     return std::make_unique&lt;CryptoAlgorithmRsaKeyParamsWithHash&gt;();
</span><span class="lines">@@ -287,18 +288,18 @@
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaSsaParams(ExecState* exec, JSValue value)
</del><ins>+static std::unique_ptr&lt;CryptoAlgorithmParameters&gt; createRsaSsaParams(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value.isObject()) {
</span><del>-        throwTypeError(exec);
</del><ins>+        throwTypeError(&amp;state);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSDictionary jsDictionary(exec, value.getObject());
</del><ins>+    JSDictionary jsDictionary(&amp;state, value.getObject());
</ins><span class="cx">     auto result = std::make_unique&lt;CryptoAlgorithmRsaSsaParams&gt;();
</span><span class="cx"> 
</span><span class="cx">     if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><ins>+        ASSERT(state.hadException());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -396,7 +397,7 @@
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="cx">         return nullptr;
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><del>-        return createRsaSsaParams(exec, value);
</del><ins>+        return createRsaSsaParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_OAEP:
</span><span class="cx">     case CryptoAlgorithmIdentifier::ECDSA:
</span><span class="lines">@@ -410,7 +411,7 @@
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="cx">         return nullptr;
</span><span class="cx">     case CryptoAlgorithmIdentifier::HMAC:
</span><del>-        return createHmacParams(exec, value);
</del><ins>+        return createHmacParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::DH:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_1:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_224:
</span><span class="lines">@@ -434,7 +435,7 @@
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="cx">         return nullptr;
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><del>-        return createRsaSsaParams(exec, value);
</del><ins>+        return createRsaSsaParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_OAEP:
</span><span class="cx">     case CryptoAlgorithmIdentifier::ECDSA:
</span><span class="lines">@@ -448,7 +449,7 @@
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="cx">         return nullptr;
</span><span class="cx">     case CryptoAlgorithmIdentifier::HMAC:
</span><del>-        return createHmacParams(exec, value);
</del><ins>+        return createHmacParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::DH:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_1:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_224:
</span><span class="lines">@@ -507,7 +508,7 @@
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_OAEP:
</span><del>-        return createRsaKeyGenParams(exec, value);
</del><ins>+        return createRsaKeyGenParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::ECDSA:
</span><span class="cx">     case CryptoAlgorithmIdentifier::ECDH:
</span><span class="cx">         setDOMException(exec, NOT_SUPPORTED_ERR);
</span><span class="lines">@@ -518,9 +519,9 @@
</span><span class="cx">     case CryptoAlgorithmIdentifier::AES_GCM:
</span><span class="cx">     case CryptoAlgorithmIdentifier::AES_CFB:
</span><span class="cx">     case CryptoAlgorithmIdentifier::AES_KW:
</span><del>-        return createAesKeyGenParams(exec, value);
</del><ins>+        return createAesKeyGenParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::HMAC:
</span><del>-        return createHmacKeyParams(exec, value);
</del><ins>+        return createHmacKeyParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::DH:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_1:
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_224:
</span><span class="lines">@@ -608,7 +609,7 @@
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_PSS:
</span><span class="cx">     case CryptoAlgorithmIdentifier::RSA_OAEP:
</span><del>-        return createRsaKeyParamsWithHash(exec, value);
</del><ins>+        return createRsaKeyParamsWithHash(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::ECDSA:
</span><span class="cx">     case CryptoAlgorithmIdentifier::ECDH:
</span><span class="cx">     case CryptoAlgorithmIdentifier::AES_CTR:
</span><span class="lines">@@ -619,7 +620,7 @@
</span><span class="cx">     case CryptoAlgorithmIdentifier::AES_KW:
</span><span class="cx">         return std::make_unique&lt;CryptoAlgorithmParameters&gt;();
</span><span class="cx">     case CryptoAlgorithmIdentifier::HMAC:
</span><del>-        return createHmacParams(exec, value);
</del><ins>+        return createHmacParams(*exec, value);
</ins><span class="cx">     case CryptoAlgorithmIdentifier::DH:
</span><span class="cx">         return std::make_unique&lt;CryptoAlgorithmParameters&gt;();
</span><span class="cx">     case CryptoAlgorithmIdentifier::SHA_1:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -366,15 +366,15 @@
</span><span class="cx">     return makeString(&quot;Value &quot;, String::numberToStringECMAScript(value), &quot; is outside the range [&quot;, String::numberToStringECMAScript(min), &quot;, &quot;, String::numberToStringECMAScript(max), &quot;]&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static double enforceRange(ExecState* exec, double x, double minimum, double maximum)
</del><ins>+static double enforceRange(ExecState&amp; state, double x, double minimum, double maximum)
</ins><span class="cx"> {
</span><span class="cx">     if (std::isnan(x) || std::isinf(x)) {
</span><del>-        exec-&gt;vm().throwException(exec, createTypeError(exec, rangeErrorString(x, minimum, maximum)));
</del><ins>+        state.vm().throwException(&amp;state, createTypeError(&amp;state, rangeErrorString(x, minimum, maximum)));
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx">     x = trunc(x);
</span><span class="cx">     if (x &lt; minimum || x &gt; maximum) {
</span><del>-        exec-&gt;vm().throwException(exec, createTypeError(exec, rangeErrorString(x, minimum, maximum)));
</del><ins>+        state.vm().throwException(&amp;state, createTypeError(&amp;state, rangeErrorString(x, minimum, maximum)));
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx">     return x;
</span><span class="lines">@@ -411,8 +411,10 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename T&gt;
</span><del>-static inline T toSmallerInt(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+static inline T toSmallerInt(ExecState&amp; state, JSValue value, IntegerConversionConfiguration configuration)
</ins><span class="cx"> {
</span><ins>+    static_assert(std::is_signed&lt;T&gt;::value &amp;&amp; std::is_integral&lt;T&gt;::value, &quot;Should only be used for signed integral types&quot;);
+
</ins><span class="cx">     typedef IntTypeLimits&lt;T&gt; LimitsTrait;
</span><span class="cx">     // Fast path if the value is already a 32-bit signed integer in the right range.
</span><span class="cx">     if (value.isInt32()) {
</span><span class="lines">@@ -423,7 +425,7 @@
</span><span class="cx">         case NormalConversion:
</span><span class="cx">             break;
</span><span class="cx">         case EnforceRange:
</span><del>-            throwTypeError(exec);
</del><ins>+            throwTypeError(&amp;state);
</ins><span class="cx">             return 0;
</span><span class="cx">         case Clamp:
</span><span class="cx">             return d &lt; LimitsTrait::minValue ? LimitsTrait::minValue : LimitsTrait::maxValue;
</span><span class="lines">@@ -432,15 +434,15 @@
</span><span class="cx">         return static_cast&lt;T&gt;(d &gt; LimitsTrait::maxValue ? d - LimitsTrait::numberOfValues : d);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     switch (configuration) {
</span><span class="cx">     case NormalConversion:
</span><span class="cx">         break;
</span><span class="cx">     case EnforceRange:
</span><del>-        return enforceRange(exec, x, LimitsTrait::minValue, LimitsTrait::maxValue);
</del><ins>+        return enforceRange(state, x, LimitsTrait::minValue, LimitsTrait::maxValue);
</ins><span class="cx">     case Clamp:
</span><span class="cx">         return std::isnan(x) ? 0 : clampTo&lt;T&gt;(x);
</span><span class="cx">     }
</span><span class="lines">@@ -455,8 +457,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename T&gt;
</span><del>-static inline T toSmallerUInt(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+static inline T toSmallerUInt(ExecState&amp; state, JSValue value, IntegerConversionConfiguration configuration)
</ins><span class="cx"> {
</span><ins>+    static_assert(std::is_unsigned&lt;T&gt;::value &amp;&amp; std::is_integral&lt;T&gt;::value, &quot;Should only be used for unsigned integral types&quot;);
+
</ins><span class="cx">     typedef IntTypeLimits&lt;T&gt; LimitsTrait;
</span><span class="cx">     // Fast path if the value is already a 32-bit unsigned integer in the right range.
</span><span class="cx">     if (value.isUInt32()) {
</span><span class="lines">@@ -467,22 +471,22 @@
</span><span class="cx">         case NormalConversion:
</span><span class="cx">             return static_cast&lt;T&gt;(d);
</span><span class="cx">         case EnforceRange:
</span><del>-            throwTypeError(exec);
</del><ins>+            throwTypeError(&amp;state);
</ins><span class="cx">             return 0;
</span><span class="cx">         case Clamp:
</span><span class="cx">             return LimitsTrait::maxValue;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     switch (configuration) {
</span><span class="cx">     case NormalConversion:
</span><span class="cx">         break;
</span><span class="cx">     case EnforceRange:
</span><del>-        return enforceRange(exec, x, 0, LimitsTrait::maxValue);
</del><ins>+        return enforceRange(state, x, 0, LimitsTrait::maxValue);
</ins><span class="cx">     case Clamp:
</span><span class="cx">         return std::isnan(x) ? 0 : clampTo&lt;T&gt;(x);
</span><span class="cx">     }
</span><span class="lines">@@ -494,95 +498,145 @@
</span><span class="cx">     return static_cast&lt;T&gt;(fmod(x, LimitsTrait::numberOfValues));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int8_t toInt8EnforceRange(JSC::ExecState&amp; state, JSValue value)
+{
+    return toSmallerInt&lt;int8_t&gt;(state, value, EnforceRange);
+}
+
+uint8_t toUInt8EnforceRange(JSC::ExecState&amp; state, JSValue value)
+{
+    return toSmallerUInt&lt;uint8_t&gt;(state, value, EnforceRange);
+}
+
+int8_t toInt8Clamp(JSC::ExecState&amp; state, JSValue value)
+{
+    return toSmallerInt&lt;int8_t&gt;(state, value, Clamp);
+}
+
+uint8_t toUInt8Clamp(JSC::ExecState&amp; state, JSValue value)
+{
+    return toSmallerUInt&lt;uint8_t&gt;(state, value, Clamp);
+}
+
</ins><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-byte
</span><del>-int8_t toInt8(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+int8_t toInt8(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    return toSmallerInt&lt;int8_t&gt;(exec, value, configuration);
</del><ins>+    return toSmallerInt&lt;int8_t&gt;(state, value, NormalConversion);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-octet
</span><del>-uint8_t toUInt8(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+uint8_t toUInt8(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    return toSmallerUInt&lt;uint8_t&gt;(exec, value, configuration);
</del><ins>+    return toSmallerUInt&lt;uint8_t&gt;(state, value, NormalConversion);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int16_t toInt16EnforceRange(ExecState&amp; state, JSValue value)
+{
+    return toSmallerInt&lt;int16_t&gt;(state, value, EnforceRange);
+}
+
+uint16_t toUInt16EnforceRange(ExecState&amp; state, JSValue value)
+{
+    return toSmallerUInt&lt;uint16_t&gt;(state, value, EnforceRange);
+}
+
+int16_t toInt16Clamp(ExecState&amp; state, JSValue value)
+{
+    return toSmallerInt&lt;int16_t&gt;(state, value, Clamp);
+}
+
+uint16_t toUInt16Clamp(ExecState&amp; state, JSValue value)
+{
+    return toSmallerUInt&lt;uint16_t&gt;(state, value, Clamp);
+}
+
</ins><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-short
</span><del>-int16_t toInt16(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+int16_t toInt16(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    return toSmallerInt&lt;int16_t&gt;(exec, value, configuration);
</del><ins>+    return toSmallerInt&lt;int16_t&gt;(state, value, NormalConversion);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-unsigned-short
</span><del>-uint16_t toUInt16(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+uint16_t toUInt16(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    return toSmallerUInt&lt;uint16_t&gt;(exec, value, configuration);
</del><ins>+    return toSmallerUInt&lt;uint16_t&gt;(state, value, NormalConversion);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-long
</span><del>-int32_t toInt32EnforceRange(ExecState* exec, JSValue value)
</del><ins>+int32_t toInt32EnforceRange(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (value.isInt32())
</span><span class="cx">         return value.asInt32();
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
</ins><span class="cx">         return 0;
</span><del>-    return enforceRange(exec, x, kMinInt32, kMaxInt32);
</del><ins>+    return enforceRange(state, x, kMinInt32, kMaxInt32);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-int32_t toInt32Clamp(ExecState* exec, JSValue value)
</del><ins>+int32_t toInt32Clamp(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (value.isInt32())
</span><span class="cx">         return value.asInt32();
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
-        return 0;
</del><ins>+    double x = value.toNumber(&amp;state);
</ins><span class="cx">     return std::isnan(x) ? 0 : clampTo&lt;int32_t&gt;(x);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint32_t toUInt32Clamp(ExecState* exec, JSValue value)
</del><ins>+uint32_t toUInt32Clamp(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (value.isUInt32())
</span><span class="cx">         return value.asUInt32();
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
-        return 0;
</del><ins>+    double x = value.toNumber(&amp;state);
</ins><span class="cx">     return std::isnan(x) ? 0 : clampTo&lt;uint32_t&gt;(x);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-unsigned-long
</span><del>-uint32_t toUInt32EnforceRange(ExecState* exec, JSValue value)
</del><ins>+uint32_t toUInt32EnforceRange(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><span class="cx">     if (value.isUInt32())
</span><span class="cx">         return value.asUInt32();
</span><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
</ins><span class="cx">         return 0;
</span><del>-    return enforceRange(exec, x, 0, kMaxUInt32);
</del><ins>+    return enforceRange(state, x, 0, kMaxUInt32);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// http://www.w3.org/TR/WebIDL/#es-long-long
-int64_t toInt64(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+int64_t toInt64EnforceRange(ExecState&amp; state, JSC::JSValue value)
</ins><span class="cx"> {
</span><del>-    if (value.isInt32())
-        return value.asInt32();
</del><ins>+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
+        return 0;
+    return enforceRange(state, x, -kJSMaxInteger, kJSMaxInteger);
+}
</ins><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+uint64_t toUInt64EnforceRange(ExecState&amp; state, JSC::JSValue value)
+{
+    double x = value.toNumber(&amp;state);
+    if (UNLIKELY(state.hadException()))
</ins><span class="cx">         return 0;
</span><ins>+    return enforceRange(state, x, 0, kJSMaxInteger);
+}
</ins><span class="cx"> 
</span><del>-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return enforceRange(exec, x, -kJSMaxInteger, kJSMaxInteger);
-    case Clamp:
-        return std::isnan(x) ? 0 : static_cast&lt;int64_t&gt;(std::min&lt;double&gt;(std::max&lt;double&gt;(x, -kJSMaxInteger), kJSMaxInteger));
-    }
</del><ins>+int64_t toInt64Clamp(ExecState&amp; state, JSC::JSValue value)
+{
+    double x = value.toNumber(&amp;state);
+    return std::isnan(x) ? 0 : static_cast&lt;int64_t&gt;(std::min&lt;double&gt;(std::max&lt;double&gt;(x, -kJSMaxInteger), kJSMaxInteger));
+}
</ins><span class="cx"> 
</span><ins>+uint64_t toUInt64Clamp(ExecState&amp; state, JSC::JSValue value)
+{
+    double x = value.toNumber(&amp;state);
+    return std::isnan(x) ? 0 : static_cast&lt;uint64_t&gt;(std::min&lt;double&gt;(std::max&lt;double&gt;(x, 0), kJSMaxInteger));
+}
+
+// http://www.w3.org/TR/WebIDL/#es-long-long
+int64_t toInt64(ExecState&amp; state, JSValue value)
+{
+    double x = value.toNumber(&amp;state);
+
</ins><span class="cx">     // Map NaNs and +/-Infinity to 0; convert finite values modulo 2^64.
</span><span class="cx">     unsigned long long n;
</span><span class="cx">     doubleToInteger(x, n);
</span><span class="lines">@@ -590,24 +644,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-unsigned-long-long
</span><del>-uint64_t toUInt64(ExecState* exec, JSValue value, IntegerConversionConfiguration configuration)
</del><ins>+uint64_t toUInt64(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    if (value.isUInt32())
-        return value.asUInt32();
</del><ins>+    double x = value.toNumber(&amp;state);
</ins><span class="cx"> 
</span><del>-    double x = value.toNumber(exec);
-    if (UNLIKELY(exec-&gt;hadException()))
-        return 0;
-
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return enforceRange(exec, x, 0, kJSMaxInteger);
-    case Clamp:
-        return std::isnan(x) ? 0 : static_cast&lt;uint64_t&gt;(std::min&lt;double&gt;(std::max&lt;double&gt;(x, 0), kJSMaxInteger));
-    }
-
</del><span class="cx">     // Map NaNs and +/-Infinity to 0; convert finite values modulo 2^64.
</span><span class="cx">     unsigned long long n;
</span><span class="cx">     doubleToInteger(x, n);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -211,24 +211,31 @@
</span><span class="cx"> 
</span><span class="cx"> enum IntegerConversionConfiguration { NormalConversion, EnforceRange, Clamp };
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT int32_t toInt32EnforceRange(JSC::ExecState*, JSC::JSValue);
-WEBCORE_EXPORT uint32_t toUInt32EnforceRange(JSC::ExecState*, JSC::JSValue);
</del><ins>+WEBCORE_EXPORT int8_t toInt8EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint8_t toUInt8EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int16_t toInt16EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint16_t toUInt16EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int32_t toInt32EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint32_t toUInt32EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int64_t toInt64EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint64_t toUInt64EnforceRange(JSC::ExecState&amp;, JSC::JSValue);
</ins><span class="cx"> 
</span><del>-WEBCORE_EXPORT int32_t toInt32Clamp(JSC::ExecState*, JSC::JSValue);
-WEBCORE_EXPORT uint32_t toUInt32Clamp(JSC::ExecState*, JSC::JSValue);
</del><ins>+WEBCORE_EXPORT int8_t toInt8Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint8_t toUInt8Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int16_t toInt16Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint16_t toUInt16Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int32_t toInt32Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint32_t toUInt32Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int64_t toInt64Clamp(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint64_t toUInt64Clamp(JSC::ExecState&amp;, JSC::JSValue);
</ins><span class="cx"> 
</span><del>-WEBCORE_EXPORT int8_t toInt8(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-WEBCORE_EXPORT uint8_t toUInt8(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
</del><ins>+WEBCORE_EXPORT int8_t toInt8(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint8_t toUInt8(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int16_t toInt16(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint16_t toUInt16(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT int64_t toInt64(JSC::ExecState&amp;, JSC::JSValue);
+WEBCORE_EXPORT uint64_t toUInt64(JSC::ExecState&amp;, JSC::JSValue);
</ins><span class="cx"> 
</span><del>-WEBCORE_EXPORT int16_t toInt16(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-WEBCORE_EXPORT uint16_t toUInt16(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-
-int32_t toInt32(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-uint32_t toUInt32(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-
-WEBCORE_EXPORT int64_t toInt64(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-WEBCORE_EXPORT uint64_t toUInt64(JSC::ExecState*, JSC::JSValue, IntegerConversionConfiguration);
-
</del><span class="cx"> // Returns a Date instance for the specified value, or NaN if the date is not a number.
</span><span class="cx"> JSC::JSValue jsDateOrNaN(JSC::ExecState*, double);
</span><span class="cx"> 
</span><span class="lines">@@ -481,38 +488,6 @@
</span><span class="cx">     return JSC::toInt32(number);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-/*
-    Convert a value to an integer as per &lt;http://www.w3.org/TR/WebIDL/&gt;.
-    The conversion fails if the value cannot be converted to a number or,
-    if EnforceRange is specified, the value is outside the range of the
-    destination integer type.
-*/
-inline int32_t toInt32(JSC::ExecState* exec, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toInt32EnforceRange(exec, value);
-    case Clamp:
-        return toInt32Clamp(exec, value);
-    }
-    return value.toInt32(exec);
-}
-
-inline uint32_t toUInt32(JSC::ExecState* exec, JSC::JSValue value, IntegerConversionConfiguration configuration)
-{
-    switch (configuration) {
-    case NormalConversion:
-        break;
-    case EnforceRange:
-        return toUInt32EnforceRange(exec, value);
-    case Clamp:
-        return toUInt32Clamp(exec, value);
-    }
-    return value.toUInt32(exec);
-}
-
</del><span class="cx"> // Validates that the passed object is a sequence type per section 4.1.13 of the WebIDL spec.
</span><span class="cx"> inline JSC::JSObject* toJSSequence(JSC::ExecState* exec, JSC::JSValue value, unsigned&amp; length)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMConverth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue);
</span><span class="cx"> template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue, ShouldAllowNonFinite);
</span><ins>+template&lt;typename T&gt; T convert(JSC::ExecState&amp;, JSC::JSValue, IntegerConversionConfiguration);
</ins><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; Optional&lt;T&gt; convertOptional(JSC::ExecState&amp;, JSC::JSValue);
</span><span class="cx"> template&lt;typename T, typename U&gt; T convertOptional(JSC::ExecState&amp;, JSC::JSValue, U&amp;&amp; defaultValue);
</span><span class="lines">@@ -73,4 +74,114 @@
</span><span class="cx">     return toNativeArray&lt;String&gt;(&amp;state, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline int8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toInt8EnforceRange(state, value);
+    case Clamp:
+        return toInt8Clamp(state, value);
+    }
+    return toInt8(state, value);
</ins><span class="cx"> }
</span><ins>+
+template&lt;&gt; inline uint8_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toUInt8EnforceRange(state, value);
+    case Clamp:
+        return toUInt8Clamp(state, value);
+    }
+    return toUInt8(state, value);
+}
+
+template&lt;&gt; inline int16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toInt16EnforceRange(state, value);
+    case Clamp:
+        return toInt16Clamp(state, value);
+    }
+    return toInt16(state, value);
+}
+
+template&lt;&gt; inline uint16_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toUInt16EnforceRange(state, value);
+    case Clamp:
+        return toUInt16Clamp(state, value);
+    }
+    return toUInt16(state, value);
+}
+
+template&lt;&gt; inline int32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toInt32EnforceRange(state, value);
+    case Clamp:
+        return toInt32Clamp(state, value);
+    }
+    return value.toInt32(&amp;state);
+}
+
+template&lt;&gt; inline uint32_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toUInt32EnforceRange(state, value);
+    case Clamp:
+        return toUInt32Clamp(state, value);
+    }
+    return value.toUInt32(&amp;state);
+}
+
+template&lt;&gt; inline int64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    if (value.isInt32())
+        return value.asInt32();
+
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toInt64EnforceRange(state, value);
+    case Clamp:
+        return toInt64Clamp(state, value);
+    }
+    return toInt64(state, value);
+}
+
+template&lt;&gt; inline uint64_t convert(JSC::ExecState&amp; state, JSC::JSValue value, IntegerConversionConfiguration configuration)
+{
+    if (value.isUInt32())
+        return value.asUInt32();
+
+    switch (configuration) {
+    case NormalConversion:
+        break;
+    case EnforceRange:
+        return toUInt64EnforceRange(state, value);
+    case Clamp:
+        return toUInt64Clamp(state, value);
+    }
+    return toUInt64(state, value);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(CONTENT_FILTERING)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;MockContentFilterSettings.h&quot;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -57,7 +58,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JSMockContentFilterSettings::setDecisionPoint(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><del>-    uint8_t nativeValue { toUInt8(&amp;state, value, EnforceRange) };
</del><ins>+    uint8_t nativeValue { convert&lt;uint8_t&gt;(state, value, EnforceRange) };
</ins><span class="cx">     if (state.hadException())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -90,7 +91,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline Decision toDecision(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><del>-    uint8_t nativeValue { toUInt8(&amp;state, value, EnforceRange) };
</del><ins>+    uint8_t nativeValue { convert&lt;uint8_t&gt;(state, value, EnforceRange) };
</ins><span class="cx">     if (state.hadException())
</span><span class="cx">         return Decision::Allow;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;JSNodeFilter.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSCallbackData.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;NodeFilter.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -43,23 +44,23 @@
</span><span class="cx"> 
</span><span class="cx">     JSLockHolder lock(m_data-&gt;globalObject()-&gt;vm());
</span><span class="cx"> 
</span><del>-    ExecState* exec = m_data-&gt;globalObject()-&gt;globalExec();
</del><ins>+    ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
</ins><span class="cx">     MarkedArgumentBuffer args;
</span><del>-    args.append(toJS(exec, m_data-&gt;globalObject(), node));
-    if (exec-&gt;hadException())
</del><ins>+    args.append(toJS(state, m_data-&gt;globalObject(), node));
+    if (state-&gt;hadException())
</ins><span class="cx">         return NodeFilter::FILTER_REJECT;
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; returnedException;
</span><del>-    JSValue value = m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::FunctionOrObject, Identifier::fromString(exec, &quot;acceptNode&quot;), returnedException);
</del><ins>+    JSValue value = m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::FunctionOrObject, Identifier::fromString(state, &quot;acceptNode&quot;), returnedException);
</ins><span class="cx">     if (returnedException) {
</span><span class="cx">         // Rethrow exception.
</span><del>-        exec-&gt;vm().throwException(exec, returnedException);
</del><ins>+        state-&gt;vm().throwException(state, returnedException);
</ins><span class="cx"> 
</span><span class="cx">         return NodeFilter::FILTER_REJECT;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    uint16_t result = toUInt16(exec, value, NormalConversion);
-    if (exec-&gt;hadException())
</del><ins>+    uint16_t result = convert&lt;uint16_t&gt;(*state, value, NormalConversion);
+    if (state-&gt;hadException())
</ins><span class="cx">         return NodeFilter::FILTER_REJECT;
</span><span class="cx"> 
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -44,18 +44,12 @@
</span><span class="cx"> 
</span><span class="cx"> my $verbose = 0;
</span><span class="cx"> 
</span><del>-my %numericTypeHash = (
</del><ins>+my %integerTypeHash = (
</ins><span class="cx">     &quot;byte&quot; =&gt; 1,
</span><del>-    &quot;double&quot; =&gt; 1,
-    &quot;float&quot; =&gt; 1,
-    &quot;int&quot; =&gt; 1,
</del><span class="cx">     &quot;long long&quot; =&gt; 1,
</span><span class="cx">     &quot;long&quot; =&gt; 1,
</span><span class="cx">     &quot;octet&quot; =&gt; 1,
</span><span class="cx">     &quot;short&quot; =&gt; 1,
</span><del>-    &quot;unrestricted double&quot; =&gt; 1,
-    &quot;unrestricted float&quot; =&gt; 1,
-    &quot;unsigned int&quot; =&gt; 1,
</del><span class="cx">     &quot;unsigned long long&quot; =&gt; 1,
</span><span class="cx">     &quot;unsigned long&quot; =&gt; 1,
</span><span class="cx">     &quot;unsigned short&quot; =&gt; 1,
</span><span class="lines">@@ -357,27 +351,35 @@
</span><span class="cx"> 
</span><span class="cx"> sub IsNumericType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return 1 if $numericTypeHash{$type};
</del><ins>+    return 1 if $integerTypeHash{$type};
+    return 1 if $floatingPointTypeHash{$type};
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsIntegerType
+{
+    my ($object, $type) = @_;
+
+    return 1 if $integerTypeHash{$type};
+    return 0;
+}
+
</ins><span class="cx"> sub IsFloatingPointType
</span><span class="cx"> {
</span><span class="cx">     my ($object, $type) = @_;
</span><ins>+
</ins><span class="cx">     return 1 if $floatingPointTypeHash{$type};
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub IsPrimitiveType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><span class="cx">     return 1 if $primitiveTypeHash{$type};
</span><del>-    return 1 if $numericTypeHash{$type};
</del><ins>+    return 1 if $object-&gt;IsNumericType($type);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -417,10 +419,10 @@
</span><span class="cx"> 
</span><span class="cx"> sub IsNonPointerType
</span><span class="cx"> {
</span><del>-    my $object = shift;
-    my $type = shift;
</del><ins>+    my ($object, $type) = @_;
</ins><span class="cx"> 
</span><del>-    return 1 if $nonPointerTypeHash{$type} or $primitiveTypeHash{$type} or $numericTypeHash{$type};
</del><ins>+    return 1 if $nonPointerTypeHash{$type};
+    return 1 if $object-&gt;IsPrimitiveType($type);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -4256,14 +4256,14 @@
</span><span class="cx">     &quot;byte&quot; =&gt; &quot;int8_t&quot;,
</span><span class="cx">     &quot;double&quot; =&gt; &quot;double&quot;,
</span><span class="cx">     &quot;float&quot; =&gt; &quot;float&quot;,
</span><del>-    &quot;long long&quot; =&gt; &quot;long long&quot;,
-    &quot;long&quot; =&gt; &quot;int&quot;,
</del><ins>+    &quot;long long&quot; =&gt; &quot;int64_t&quot;,
+    &quot;long&quot; =&gt; &quot;int32_t&quot;,
</ins><span class="cx">     &quot;octet&quot; =&gt; &quot;uint8_t&quot;,
</span><span class="cx">     &quot;short&quot; =&gt; &quot;int16_t&quot;,
</span><span class="cx">     &quot;unrestricted double&quot; =&gt; &quot;double&quot;,
</span><span class="cx">     &quot;unrestricted float&quot; =&gt; &quot;float&quot;,
</span><del>-    &quot;unsigned long long&quot; =&gt; &quot;unsigned long long&quot;,
-    &quot;unsigned long&quot; =&gt; &quot;unsigned&quot;,
</del><ins>+    &quot;unsigned long long&quot; =&gt; &quot;uint64_t&quot;,
+    &quot;unsigned long&quot; =&gt; &quot;uint32_t&quot;,
</ins><span class="cx">     &quot;unsigned short&quot; =&gt; &quot;uint16_t&quot;,
</span><span class="cx"> );
</span><span class="cx"> 
</span><span class="lines">@@ -4364,17 +4364,15 @@
</span><span class="cx">     return exists $nativeType{$type};
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-my %integerConversionFunction = (
-    &quot;byte&quot; =&gt; &quot;toInt8&quot;,
-    &quot;long long&quot; =&gt; &quot;toInt64&quot;,
-    &quot;long&quot; =&gt; &quot;toInt32&quot;,
-    &quot;octet&quot; =&gt; &quot;toUInt8&quot;,
-    &quot;short&quot; =&gt; &quot;toInt16&quot;,
-    &quot;unsigned long long&quot; =&gt; &quot;toUInt64&quot;,
-    &quot;unsigned long&quot; =&gt; &quot;toUInt32&quot;,
-    &quot;unsigned short&quot; =&gt; &quot;toUInt16&quot;,
-);
</del><ins>+sub GetIntegerConversionType
+{
+    my $signature = shift;
</ins><span class="cx"> 
</span><ins>+    return &quot;EnforceRange&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;EnforceRange&quot;};
+    return &quot;Clamp&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;Clamp&quot;};
+    return &quot;NormalConversion&quot;;
+}
+
</ins><span class="cx"> # Returns (convertString, mayThrowException).
</span><span class="cx"> sub JSValueToNative
</span><span class="cx"> {
</span><span class="lines">@@ -4382,12 +4380,11 @@
</span><span class="cx"> 
</span><span class="cx">     my $type = $signature-&gt;type;
</span><span class="cx"> 
</span><del>-    my $function = $integerConversionFunction{$type};
-    if ($function) {
-        my $conversionType = &quot;NormalConversion&quot;;
-        $conversionType = &quot;EnforceRange&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;EnforceRange&quot;};
-        $conversionType = &quot;Clamp&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;Clamp&quot;};
-        return (&quot;$function(state, $value, $conversionType)&quot;, 1);
</del><ins>+    if ($codeGenerator-&gt;IsIntegerType($type)) {
+        my $nativeType = GetNativeType($interface, $type);
+        my $conversionType = GetIntegerConversionType($signature);
+        AddToImplIncludes(&quot;JSDOMConvert.h&quot;);
+        return (&quot;convert&lt;$nativeType&gt;(*state, $value, $conversionType)&quot;, 1);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type eq &quot;DOMString&quot;) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLParserpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -342,27 +342,27 @@
</span><span class="cx"> my $nextAttribute_1 = '^(attribute|inherit|readonly)$';
</span><span class="cx"> my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$';
</span><span class="cx"> my $nextPrimitiveType_2 = '^(double|float|unrestricted)$';
</span><del>-my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte|double|float|in|int|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
-my $nextNonAnyType_1 = '^(boolean|byte|double|float|int|long|octet|short|unrestricted|unsigned)$';
-my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|int|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
</del><ins>+my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte|double|float|in|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
+my $nextNonAnyType_1 = '^(boolean|byte|double|float|long|octet|short|unrestricted|unsigned)$';
+my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextAttributeOrOperation_1 = '^(static|stringifier)$';
</span><del>-my $nextAttributeOrOperation_2 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|creator|deleter|double|float|getter|int|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</del><ins>+my $nextAttributeOrOperation_2 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|creator|deleter|double|float|getter|legacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$';
</ins><span class="cx"> my $nextUnrestrictedFloatType_1 = '^(double|float)$';
</span><span class="cx"> my $nextExtendedAttributeRest3_1 = '^(\,|::|\])$';
</span><del>-my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned)$';
-my $nextType_1 = '^(::|ByteString|DOMString|Date|any|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
+my $nextType_1 = '^(::|ByteString|DOMString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextSpecials_1 = '^(creator|deleter|getter|legacycaller|setter)$';
</span><span class="cx"> my $nextDefinitions_1 = '^(::|callback|dictionary|enum|exception|interface|partial|typedef)$';
</span><del>-my $nextExceptionMembers_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte|const|double|float|int|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextExceptionMembers_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte|const|double|float|long|object|octet|optional|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextAttributeRest_1 = '^(attribute|readonly)$';
</span><del>-my $nextInterfaceMembers_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boolean|byte|const|creator|deleter|double|float|getter|inherit|int|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
-my $nextSingleType_1 = '^(::|ByteString|DOMString|Date|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned)$';
</del><ins>+my $nextInterfaceMembers_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boolean|byte|const|creator|deleter|double|float|getter|inherit|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestricted|unsigned|void)$';
+my $nextSingleType_1 = '^(::|ByteString|DOMString|Date|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned)$';
</ins><span class="cx"> my $nextArgumentName_1 = '^(attribute|callback|const|creator|deleter|dictionary|enum|exception|getter|implements|inherit|interface|legacycaller|partial|serializer|setter|static|stringifier|typedef|unrestricted)$';
</span><span class="cx"> my $nextConstValue_1 = '^(false|true)$';
</span><span class="cx"> my $nextConstValue_2 = '^(-|Infinity|NaN)$';
</span><span class="cx"> my $nextDefinition_1 = '^(callback|interface)$';
</span><del>-my $nextAttributeOrOperationRest_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned|void)$';
-my $nextUnsignedIntegerType_1 = '^(int|long|short)$';
</del><ins>+my $nextAttributeOrOperationRest_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|double|float|long|object|octet|sequence|short|unrestricted|unsigned|void)$';
+my $nextUnsignedIntegerType_1 = '^(long|short)$';
</ins><span class="cx"> my $nextDefaultValue_1 = '^(-|Infinity|NaN|false|null|true)$';
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx">     return !returnedException;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSTestCallback::callbackRequiresThisToPass(int longParam, TestNode* testNodeParam)
</del><ins>+bool JSTestCallback::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
</ins><span class="cx"> {
</span><span class="cx">     if (!canInvokeCallback())
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -46,11 +46,11 @@
</span><span class="cx">     virtual bool callbackWithNoParam();
</span><span class="cx">     virtual bool callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam);
</span><span class="cx">     virtual bool callbackWithSerializedScriptValueParam(PassRefPtr&lt;SerializedScriptValue&gt; srzParam, const String&amp; strArg);
</span><del>-    virtual int callbackWithNonBoolReturnType(const String&amp; strArg);
-    virtual int customCallback(Class5* class5Param, Class6* class6Param);
</del><ins>+    virtual int32_t callbackWithNonBoolReturnType(const String&amp; strArg);
+    virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
</ins><span class="cx">     virtual bool callbackWithStringList(PassRefPtr&lt;DOMStringList&gt; listParam);
</span><span class="cx">     virtual bool callbackWithBoolean(bool boolParam);
</span><del>-    virtual bool callbackRequiresThisToPass(int longParam, TestNode* testNodeParam);
</del><ins>+    virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     JSTestCallback(JSC::JSObject* callback, JSDOMGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">     return !returnedException;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSTestCallbackFunction::callbackRequiresThisToPass(int longParam, TestNode* testNodeParam)
</del><ins>+bool JSTestCallbackFunction::callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam)
</ins><span class="cx"> {
</span><span class="cx">     if (!canInvokeCallback())
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -45,11 +45,11 @@
</span><span class="cx">     virtual bool callbackWithNoParam();
</span><span class="cx">     virtual bool callbackWithArrayParam(RefPtr&lt;Float32Array&gt; arrayParam);
</span><span class="cx">     virtual bool callbackWithSerializedScriptValueParam(PassRefPtr&lt;SerializedScriptValue&gt; srzParam, const String&amp; strArg);
</span><del>-    virtual int callbackWithNonBoolReturnType(const String&amp; strArg);
-    virtual int customCallback(Class5* class5Param, Class6* class6Param);
</del><ins>+    virtual int32_t callbackWithNonBoolReturnType(const String&amp; strArg);
+    virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
</ins><span class="cx">     virtual bool callbackWithStringList(PassRefPtr&lt;DOMStringList&gt; listParam);
</span><span class="cx">     virtual bool callbackWithBoolean(bool boolParam);
</span><del>-    virtual bool callbackRequiresThisToPass(int longParam, TestNode* testNodeParam);
</del><ins>+    virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     JSTestCallbackFunction(JSC::JSObject* callback, JSDOMGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;Node.h&quot;
</span><span class="cx"> #include &quot;wtf/text/AtomicString.h&quot;
</span><span class="lines">@@ -205,7 +206,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto index = toUInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto index = convert&lt;uint32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), WTF::getPtr(impl.item(WTFMove(index))));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &lt;runtime/Error.h&gt;
</span><span class="lines">@@ -294,7 +295,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto testParam = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto testParam = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -158,16 +158,16 @@
</span><span class="cx">     InputCursor&amp; cursor = globalObject-&gt;inputCursor();
</span><span class="cx">     static NeverDestroyed&lt;const AtomicString&gt; bindingName(&quot;TestNondeterministic.nondeterministicReadonlyAttr&quot;, AtomicString::ConstructFromLiteral);
</span><span class="cx">     if (cursor.isCapturing()) {
</span><del>-        int memoizedResult = castedThis-&gt;wrapped().nondeterministicReadonlyAttr();
-        cursor.appendInput&lt;MemoizedDOMResult&lt;int&gt;&gt;(bindingName.get().string(), memoizedResult, 0);
</del><ins>+        int32_t memoizedResult = castedThis-&gt;wrapped().nondeterministicReadonlyAttr();
+        cursor.appendInput&lt;MemoizedDOMResult&lt;int32_t&gt;&gt;(bindingName.get().string(), memoizedResult, 0);
</ins><span class="cx">         JSValue result = jsNumber(memoizedResult);
</span><span class="cx">         return JSValue::encode(result);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (cursor.isReplaying()) {
</span><del>-        int memoizedResult;
</del><ins>+        int32_t memoizedResult;
</ins><span class="cx">         MemoizedDOMResultBase* input = cursor.fetchInput&lt;MemoizedDOMResultBase&gt;();
</span><del>-        if (input &amp;&amp; input-&gt;convertTo&lt;int&gt;(memoizedResult)) {
</del><ins>+        if (input &amp;&amp; input-&gt;convertTo&lt;int32_t&gt;(memoizedResult)) {
</ins><span class="cx">             JSValue result = jsNumber(memoizedResult);
</span><span class="cx">             return JSValue::encode(result);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -2690,7 +2690,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;byteAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt8(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int8_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setByteAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2707,7 +2707,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;octetAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toUInt8(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;uint8_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setOctetAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2724,7 +2724,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;shortAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt16(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int16_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setShortAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2741,7 +2741,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;clampedShortAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt16(state, value, Clamp);
</del><ins>+    auto nativeValue = convert&lt;int16_t&gt;(*state, value, Clamp);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setClampedShortAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2758,7 +2758,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;enforceRangeShortAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt16(state, value, EnforceRange);
</del><ins>+    auto nativeValue = convert&lt;int16_t&gt;(*state, value, EnforceRange);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setEnforceRangeShortAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2775,7 +2775,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;unsignedShortAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toUInt16(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;uint16_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedShortAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2792,7 +2792,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;longAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setLongAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2809,7 +2809,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;longLongAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt64(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int64_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setLongLongAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2826,7 +2826,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;unsignedLongLongAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toUInt64(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;uint64_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -2983,7 +2983,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedIntegralAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, WTFMove(nativeValue));
</span><span class="lines">@@ -3000,7 +3000,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedUnsignedIntegralAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toUInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;uint32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, WTFMove(nativeValue));
</span><span class="lines">@@ -3068,7 +3068,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;reflectedCustomIntegralAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, WTFMove(nativeValue));
</span><span class="lines">@@ -3159,7 +3159,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;attrWithGetterException&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterException(WTFMove(nativeValue));
</span><span class="lines">@@ -3176,7 +3176,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;attrWithGetterExceptionWithMessage&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterExceptionWithMessage(WTFMove(nativeValue));
</span><span class="lines">@@ -3194,7 +3194,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="lines">@@ -3213,7 +3213,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCodeWithMessage ec;
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterExceptionWithMessage(WTFMove(nativeValue), ec);
</span><span class="lines">@@ -3328,7 +3328,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;withScriptStateAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptStateAttribute(*state, WTFMove(nativeValue));
</span><span class="lines">@@ -3345,7 +3345,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;withCallWithAndSetterCallWithAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setWithCallWithAndSetterCallWithAttribute(*state, activeDOMWindow(state), firstDOMWindow(state), WTFMove(nativeValue));
</span><span class="lines">@@ -3511,7 +3511,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;conditionalAttr1&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr1(WTFMove(nativeValue));
</span><span class="lines">@@ -3530,7 +3530,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;conditionalAttr2&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr2(WTFMove(nativeValue));
</span><span class="lines">@@ -3549,7 +3549,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;conditionalAttr3&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr3(WTFMove(nativeValue));
</span><span class="lines">@@ -3657,7 +3657,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;strawberry&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setBlueberry(WTFMove(nativeValue));
</span><span class="lines">@@ -3691,7 +3691,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;id&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setId(WTFMove(nativeValue));
</span><span class="lines">@@ -3721,7 +3721,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableLongSettableAttribute&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNullableLongSettableAttribute(WTFMove(nativeValue));
</span><span class="lines">@@ -3755,7 +3755,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;nullableStringValue&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setNullableStringValue(WTFMove(nativeValue));
</span><span class="lines">@@ -3865,7 +3865,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto testParam = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto testParam = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="lines">@@ -3914,7 +3914,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><span class="lines">@@ -3949,7 +3949,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto byteArg = toInt8(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto byteArg = convert&lt;int8_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><span class="lines">@@ -3984,7 +3984,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto octetArg = toUInt8(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto octetArg = convert&lt;uint8_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><span class="lines">@@ -4019,7 +4019,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><span class="lines">@@ -4054,7 +4054,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><span class="lines">@@ -4143,7 +4143,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto index = toUInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto index = convert&lt;uint32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsStringOrNull(state, impl.nullableStringSpecialMethod(WTFMove(index)));
</span><span class="lines">@@ -4177,7 +4177,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsArray(state, castedThis-&gt;globalObject(), impl.methodReturningSequence(WTFMove(longArg)));
</span><span class="lines">@@ -4543,7 +4543,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalArg&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto opt = state-&gt;argument(0).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto opt = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalArg(WTFMove(opt));
</span><span class="lines">@@ -4558,7 +4558,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalArgAndDefaultValue&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto opt = state-&gt;argument(0).isUndefined() ? 666 : toInt32(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto opt = state-&gt;argument(0).isUndefined() ? 666 : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalArgAndDefaultValue(WTFMove(opt));
</span><span class="lines">@@ -4575,10 +4575,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto nonOpt = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto nonOpt = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto opt = state-&gt;argument(1).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(1), NormalConversion);
</del><ins>+    auto opt = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithNonOptionalArgAndOptionalArg(WTFMove(nonOpt), WTFMove(opt));
</span><span class="lines">@@ -4595,13 +4595,13 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto nonOpt = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto nonOpt = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto opt1 = state-&gt;argument(1).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(1), NormalConversion);
</del><ins>+    auto opt1 = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto opt2 = state-&gt;argument(2).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(2), NormalConversion);
</del><ins>+    auto opt2 = state-&gt;argument(2).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(2), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithNonOptionalArgAndTwoOptionalArgs(WTFMove(nonOpt), WTFMove(opt1), WTFMove(opt2));
</span><span class="lines">@@ -4796,7 +4796,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalLongLong&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;long long&gt;() : toInt64(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;int64_t&gt;() : convert&lt;int64_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalLongLong(WTFMove(number));
</span><span class="lines">@@ -4811,7 +4811,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalLongLongIsZero&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto number = toInt64(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto number = convert&lt;int64_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalLongLongIsZero(WTFMove(number));
</span><span class="lines">@@ -4826,7 +4826,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalUnsignedLongLong&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;unsigned long long&gt;() : toUInt64(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;uint64_t&gt;() : convert&lt;uint64_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUnsignedLongLong(WTFMove(number));
</span><span class="lines">@@ -4841,7 +4841,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalUnsignedLongLongIsZero&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto number = toUInt64(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto number = convert&lt;uint64_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUnsignedLongLongIsZero(WTFMove(number));
</span><span class="lines">@@ -4989,7 +4989,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto nonCallback = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto nonCallback = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isObject()))
</span><span class="lines">@@ -5044,7 +5044,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto nonCallback = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto nonCallback = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isFunction()))
</span><span class="lines">@@ -5169,7 +5169,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><del>-    auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(1), NormalConversion);
</del><ins>+    auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg));
</span><span class="lines">@@ -5203,7 +5203,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto longArg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(longArg));
</span><span class="lines">@@ -5305,7 +5305,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto arrayArg = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(0));
</del><ins>+    auto arrayArg = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="lines">@@ -5408,7 +5408,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><del>-    auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(1), NormalConversion);
</del><ins>+    auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg));
</span><span class="lines">@@ -5437,7 +5437,7 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(ExecState* state)
</span><span class="cx"> {
</span><del>-    auto arg = state-&gt;argument(0).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto arg = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsNumber(TestObj::classMethodWithOptional(WTFMove(arg)));
</span><span class="lines">@@ -5456,7 +5456,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto arg = toInt32(state, state-&gt;argument(0), NormalConversion);
</del><ins>+    auto arg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj::overloadedMethod1(WTFMove(arg));
</span><span class="lines">@@ -5508,10 +5508,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto objArgsShort = toUInt16(state, state-&gt;argument(0), Clamp);
</del><ins>+    auto objArgsShort = convert&lt;uint16_t&gt;(*state, state-&gt;argument(0), Clamp);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto objArgsLong = toUInt32(state, state-&gt;argument(1), Clamp);
</del><ins>+    auto objArgsLong = convert&lt;uint32_t&gt;(*state, state-&gt;argument(1), Clamp);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.classMethodWithClamp(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="lines">@@ -5528,10 +5528,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto objArgsShort = toUInt16(state, state-&gt;argument(0), EnforceRange);
</del><ins>+    auto objArgsShort = convert&lt;uint16_t&gt;(*state, state-&gt;argument(0), EnforceRange);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto objArgsLong = toUInt32(state, state-&gt;argument(1), EnforceRange);
</del><ins>+    auto objArgsLong = convert&lt;uint32_t&gt;(*state, state-&gt;argument(1), EnforceRange);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.classMethodWithEnforceRange(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="lines">@@ -5548,7 +5548,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto unsignedLongSequence = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(0));
</del><ins>+    auto unsignedLongSequence = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithUnsignedLongSequence(WTFMove(unsignedLongSequence));
</span><span class="lines">@@ -5607,10 +5607,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto arrayArg = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(0));
</del><ins>+    auto arrayArg = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto nullableArrayArg = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(1));
</del><ins>+    auto nullableArrayArg = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(1));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithAndWithoutNullableSequence(WTFMove(arrayArg), WTFMove(nullableArrayArg));
</span><span class="lines">@@ -5627,10 +5627,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto arrayArg = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(0));
</del><ins>+    auto arrayArg = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto nullableArrayArg = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(1));
</del><ins>+    auto nullableArrayArg = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(1));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithAndWithoutNullableSequence2(WTFMove(arrayArg), WTFMove(nullableArrayArg));
</span><span class="lines">@@ -5773,7 +5773,7 @@
</span><span class="cx">     auto a = convert&lt;float&gt;(*state, state-&gt;argument(1), ShouldAllowNonFinite::Yes);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto b = toInt32(state, state-&gt;argument(2), NormalConversion);
</del><ins>+    auto b = convert&lt;int32_t&gt;(*state, state-&gt;argument(2), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsBoolean(impl.strictFunction(WTFMove(str), WTFMove(a), WTFMove(b), ec));
</span><span class="lines">@@ -5798,7 +5798,7 @@
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="cx">         return throwVMTypeError(state);
</span><del>-    auto a = toNativeArray&lt;unsigned&gt;(state, state-&gt;argument(1));
</del><ins>+    auto a = toNativeArray&lt;uint32_t&gt;(state, state-&gt;argument(1));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsBoolean(impl.strictFunctionWithSequence(*objArg, WTFMove(a), ec));
</span><span class="lines">@@ -5823,7 +5823,7 @@
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(0));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="cx">         return throwVMTypeError(state);
</span><del>-    auto array = toNativeArray&lt;int&gt;(state, state-&gt;argument(1));
</del><ins>+    auto array = toNativeArray&lt;int32_t&gt;(state, state-&gt;argument(1));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsBoolean(impl.strictFunctionWithArray(*objArg, WTFMove(array), ec));
</span><span class="lines">@@ -5908,7 +5908,7 @@
</span><span class="cx">     auto a = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto b = toInt32(state, state-&gt;argument(1), NormalConversion);
</del><ins>+    auto b = convert&lt;int32_t&gt;(*state, state-&gt;argument(1), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.any(WTFMove(a), WTFMove(b));
</span><span class="lines">@@ -5990,7 +5990,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;testPromiseFunctionWithOptionalIntArgument&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto a = state-&gt;argument(0).isUndefined() ? Optional&lt;int&gt;() : toInt32(state, state-&gt;uncheckedArgument(0), NormalConversion);
</del><ins>+    auto a = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.testPromiseFunctionWithOptionalIntArgument(WTFMove(a), DeferredWrapper(state, castedThis-&gt;globalObject(), promiseDeferred));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx"> static inline EncodedJSValue constructJSTestOverloadedConstructors5(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsConstructor*&gt;(state-&gt;callee());
</span><del>-    Vector&lt;int&gt; longArgs = toNativeArguments&lt;int&gt;(state, 0);
</del><ins>+    Vector&lt;int32_t&gt; longArgs = toNativeArguments&lt;int32_t&gt;(state, 0);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     RefPtr&lt;TestOverloadedConstructors&gt; object = TestOverloadedConstructors::create(longArgs);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (200555 => 200556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-08 16:54:09 UTC (rev 200555)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-08 18:29:04 UTC (rev 200556)
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestTypedefs&quot;, &quot;unsignedLongLongAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toUInt64(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;uint64_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="lines">@@ -388,7 +388,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestTypedefs&quot;, &quot;attrWithGetterException&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterException(WTFMove(nativeValue));
</span><span class="lines">@@ -406,7 +406,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    auto nativeValue = toInt32(state, value, NormalConversion);
</del><ins>+    auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="lines">@@ -464,7 +464,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestTypedefs&quot;, &quot;func&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto x = toNativeArray&lt;int&gt;(state, state-&gt;argument(0));
</del><ins>+    auto x = toNativeArray&lt;int32_t&gt;(state, state-&gt;argument(0));
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.func(WTFMove(x));
</span><span class="lines">@@ -544,10 +544,10 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>-    auto arg1 = toUInt64(state, state-&gt;argument(0), Clamp);
</del><ins>+    auto arg1 = convert&lt;uint64_t&gt;(*state, state-&gt;argument(0), Clamp);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto arg2 = state-&gt;argument(1).isUndefined() ? Optional&lt;unsigned long long&gt;() : toUInt64(state, state-&gt;uncheckedArgument(1), Clamp);
</del><ins>+    auto arg2 = state-&gt;argument(1).isUndefined() ? Optional&lt;uint64_t&gt;() : convert&lt;uint64_t&gt;(*state, state-&gt;uncheckedArgument(1), Clamp);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2));
</span></span></pre>
</div>
</div>

</body>
</html>