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

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

<h3>Log Message</h3>
<pre>Clean up converting from JSValue to float / double in the bindings generator
https://bugs.webkit.org/show_bug.cgi?id=157407

Reviewed by Darin Adler.

Source/WebCore:

Clean up converting from JSValue to float / double in the bindings generator:
- Handle all aspects of converting to float / double inside JSValueToNative()
  instead of relying partly on the call sites.
- Add a build&lt;&gt;() template function to JSDOMBuild.h that is now
  called from the bindings to convert to float / double and deal with
  non-finite values.
- Provide a better message with the TypeError that is thrown for non-finite
  values.

No new tests, rebaselined existing tests.

* bindings/js/JSDOMBinding.cpp:
(WebCore::throwSequenceTypeError):
(WebCore::throwNonFiniteTypeError):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMBuild.h:
(WebCore::build):
* bindings/scripts/CodeGenerator.pm:
(IsFloatingPointType):
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
(GenerateImplementation): Deleted.
(GenerateParametersCheck): Deleted.
(GenerateReturnParameters): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjStrictFloat):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionAny):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionSetShadow):

LayoutTests:

Rebaseline the tests now that we provide a more useful exception message.

* fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt:
* fast/canvas/canvas-getImageData-invalid-expected.txt:
* fast/canvas/canvas-putImageData-expected.txt:
* fast/canvas/canvas-putImageData.js:
* fast/canvas/linearGradient-infinite-values-expected.txt:
* fast/canvas/radialGradient-infinite-values-expected.txt:
* fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js:
* fast/canvas/script-tests/canvas-getImageData-invalid.js:
* fast/canvas/script-tests/linearGradient-infinite-values.js:
* fast/canvas/script-tests/radialGradient-infinite-values.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvas2dimageDatacreatenonfiniteexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasgetImageDatainvalidexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-getImageData-invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasputImageDataexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasputImageDatajs">trunk/LayoutTests/fast/canvas/canvas-putImageData.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvaslinearGradientinfinitevaluesexpectedtxt">trunk/LayoutTests/fast/canvas/linearGradient-infinite-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvasradialGradientinfinitevaluesexpectedtxt">trunk/LayoutTests/fast/canvas/radialGradient-infinite-values-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvasresourcescanvas2dimageDatacreatenonfinitejs">trunk/LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvasscripttestscanvasgetImageDatainvalidjs">trunk/LayoutTests/fast/canvas/script-tests/canvas-getImageData-invalid.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvasscripttestslinearGradientinfinitevaluesjs">trunk/LayoutTests/fast/canvas/script-tests/linearGradient-infinite-values.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvasscripttestsradialGradientinfinitevaluesjs">trunk/LayoutTests/fast/canvas/script-tests/radialGradient-infinite-values.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorebindingsjsJSDOMBuildh">trunk/Source/WebCore/bindings/js/JSDOMBuild.h</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="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.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="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/ChangeLog        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-05-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Clean up converting from JSValue to float / double in the bindings generator
+        https://bugs.webkit.org/show_bug.cgi?id=157407
+
+        Reviewed by Darin Adler.
+
+        Rebaseline the tests now that we provide a more useful exception message.
+
+        * fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt:
+        * fast/canvas/canvas-getImageData-invalid-expected.txt:
+        * fast/canvas/canvas-putImageData-expected.txt:
+        * fast/canvas/canvas-putImageData.js:
+        * fast/canvas/linearGradient-infinite-values-expected.txt:
+        * fast/canvas/radialGradient-infinite-values-expected.txt:
+        * fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js:
+        * fast/canvas/script-tests/canvas-getImageData-invalid.js:
+        * fast/canvas/script-tests/linearGradient-infinite-values.js:
+        * fast/canvas/script-tests/radialGradient-infinite-values.js:
+
</ins><span class="cx"> 2016-05-06  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed IDB test gardening.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvas2dimageDatacreatenonfiniteexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite-expected.txt        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3,13 +3,13 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS ctx.createImageData(Infinity, Infinity) threw exception TypeError: Type error.
-PASS ctx.createImageData(Infinity, 10) threw exception TypeError: Type error.
-PASS ctx.createImageData(-Infinity, 10) threw exception TypeError: Type error.
-PASS ctx.createImageData(10, Infinity) threw exception TypeError: Type error.
-PASS ctx.createImageData(10, -Infinity) threw exception TypeError: Type error.
-PASS ctx.createImageData(NaN, 10) threw exception TypeError: Type error.
-PASS ctx.createImageData(10, NaN) threw exception TypeError: Type error.
</del><ins>+PASS ctx.createImageData(Infinity, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(Infinity, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(-Infinity, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(10, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(10, -Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(NaN, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createImageData(10, NaN) threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasgetImageDatainvalidexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-getImageData-invalid-expected.txt (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-getImageData-invalid-expected.txt        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/canvas-getImageData-invalid-expected.txt        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3,18 +3,18 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS ctx.getImageData(NaN, 10, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, NaN, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, NaN, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, 10, NaN) threw exception TypeError: Type error.
-PASS ctx.getImageData(Infinity, 10, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, Infinity, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, Infinity, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, 10, Infinity) threw exception TypeError: Type error.
-PASS ctx.getImageData(undefined, 10, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, undefined, 10, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, undefined, 10) threw exception TypeError: Type error.
-PASS ctx.getImageData(10, 10, 10, undefined) threw exception TypeError: Type error.
</del><ins>+PASS ctx.getImageData(NaN, 10, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, NaN, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, NaN, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, 10, NaN) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(Infinity, 10, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, Infinity, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, Infinity, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, 10, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(undefined, 10, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, undefined, 10, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, undefined, 10) threw exception TypeError: The provided value is non-finite.
+PASS ctx.getImageData(10, 10, 10, undefined) threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> PASS ctx.getImageData(10, 10, 0, 10) threw exception Error: IndexSizeError: DOM Exception 1.
</span><span class="cx"> PASS ctx.getImageData(10, 10, 10, 0) threw exception Error: IndexSizeError: DOM Exception 1.
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasputImageDataexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/canvas-putImageData-expected.txt        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -145,24 +145,24 @@
</span><span class="cx"> PASS getPixel(1,1) is [0,128,0,255]
</span><span class="cx"> PASS getPixel(9,9) is [0,128,0,255]
</span><span class="cx"> PASS context.putImageData({}, 0, 0) threw exception TypeError: Type error.
</span><del>-PASS context.putImageData(buffer, NaN, 0, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, NaN, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, NaN, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, NaN, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, NaN, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, 0, NaN) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, undefined, 0, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, undefined, 0, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, undefined, 0, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, undefined, 0, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, undefined, 0) threw exception TypeError: Type error.
-PASS context.putImageData(buffer, 0, 0, 0, 0, 0, undefined) threw exception TypeError: Type error.
</del><ins>+PASS context.putImageData(buffer, NaN, 0, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, NaN, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, NaN, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, NaN, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, NaN, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, 0, NaN) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, undefined, 0, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, undefined, 0, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, undefined, 0, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, undefined, 0, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, undefined, 0) threw exception TypeError: The provided value is non-finite.
+PASS context.putImageData(buffer, 0, 0, 0, 0, 0, undefined) threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasputImageDatajs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-putImageData.js (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-putImageData.js        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/canvas-putImageData.js        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -202,24 +202,24 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> shouldThrow(&quot;context.putImageData({}, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
</span><del>-shouldThrow(&quot;context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, NaN, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, NaN, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, NaN, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, NaN)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, undefined, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, undefined, 0, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, undefined, 0, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, undefined, 0, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, undefined, 0)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, undefined)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, NaN, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, NaN, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, NaN, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, NaN)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, undefined, 0, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, undefined, 0, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, undefined, 0, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, undefined, 0, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, undefined, 0)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;context.putImageData(buffer, 0, 0, 0, 0, 0, undefined)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</ins><span class="cx"> 
</span><span class="cx"> // Ensure we don't mess up bounds clipping checks
</span><span class="cx"> var rectcanvas = document.createElement(&quot;canvas&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaslinearGradientinfinitevaluesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/linearGradient-infinite-values-expected.txt (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/linearGradient-infinite-values-expected.txt        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/linearGradient-infinite-values-expected.txt        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3,18 +3,18 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS ctx.createLinearGradient(0, 0, 100, NaN) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, 0, 100, Infinity) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, 0, 100, -Infinity) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, 0, NaN, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, 0, Infinity, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, 0, -Infinity, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, NaN, 100, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, Infinity, 100, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(0, -Infinity, 100, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(NaN, 0, 100, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(Infinity, 0, 100, 100) threw exception TypeError: Type error.
-PASS ctx.createLinearGradient(-Infinity, 0, 100, 100) threw exception TypeError: Type error.
</del><ins>+PASS ctx.createLinearGradient(0, 0, 100, NaN) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, 0, 100, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, 0, 100, -Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, 0, NaN, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, 0, Infinity, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, 0, -Infinity, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, NaN, 100, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, Infinity, 100, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(0, -Infinity, 100, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(NaN, 0, 100, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(Infinity, 0, 100, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createLinearGradient(-Infinity, 0, 100, 100) threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvasradialGradientinfinitevaluesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/radialGradient-infinite-values-expected.txt (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/radialGradient-infinite-values-expected.txt        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/radialGradient-infinite-values-expected.txt        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3,24 +3,24 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS ctx.createRadialGradient(0, 0, 100, 0, 0, NaN) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, 0, NaN, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, NaN, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, NaN, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, NaN, 100, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100) threw exception TypeError: Type error.
-PASS ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100) threw exception TypeError: Type error.
</del><ins>+PASS ctx.createRadialGradient(0, 0, 100, 0, 0, NaN) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, 0, NaN, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, NaN, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, NaN, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, NaN, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
+PASS ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100) threw exception TypeError: The provided value is non-finite.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvasresourcescanvas2dimageDatacreatenonfinitejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/resources/canvas-2d-imageData-create-nonfinite.js        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3,10 +3,10 @@
</span><span class="cx"> var canvas = document.getElementById('canvas');
</span><span class="cx"> var ctx = canvas.getContext('2d');
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;ctx.createImageData(Infinity, Infinity)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(Infinity, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(-Infinity, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(10, Infinity)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(10, -Infinity)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(NaN, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.createImageData(10, NaN)&quot;, '&quot;TypeError: Type error&quot;');
</del><ins>+shouldThrow(&quot;ctx.createImageData(Infinity, Infinity)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(Infinity, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(-Infinity, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(10, Infinity)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(10, -Infinity)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(NaN, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.createImageData(10, NaN)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcanvasscripttestscanvasgetImageDatainvalidjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/script-tests/canvas-getImageData-invalid.js (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/script-tests/canvas-getImageData-invalid.js        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/script-tests/canvas-getImageData-invalid.js        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -2,17 +2,17 @@
</span><span class="cx"> 
</span><span class="cx"> ctx = document.createElement('canvas').getContext('2d');
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;ctx.getImageData(NaN, 10, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, NaN, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, NaN, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, 10, NaN)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(Infinity, 10, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, Infinity, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, Infinity, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, 10, Infinity)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(undefined, 10, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, undefined, 10, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, undefined, 10)&quot;, '&quot;TypeError: Type error&quot;');
-shouldThrow(&quot;ctx.getImageData(10, 10, 10, undefined)&quot;, '&quot;TypeError: Type error&quot;');
</del><ins>+shouldThrow(&quot;ctx.getImageData(NaN, 10, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, NaN, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, NaN, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, 10, NaN)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(Infinity, 10, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, Infinity, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, Infinity, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, 10, Infinity)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(undefined, 10, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, undefined, 10, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, undefined, 10)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
+shouldThrow(&quot;ctx.getImageData(10, 10, 10, undefined)&quot;, '&quot;TypeError: The provided value is non-finite&quot;');
</ins><span class="cx"> shouldThrow(&quot;ctx.getImageData(10, 10, 0, 10)&quot;, '&quot;Error: IndexSizeError: DOM Exception 1&quot;');
</span><span class="cx"> shouldThrow(&quot;ctx.getImageData(10, 10, 10, 0)&quot;, '&quot;Error: IndexSizeError: DOM Exception 1&quot;');
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvasscripttestslinearGradientinfinitevaluesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/script-tests/linearGradient-infinite-values.js (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/script-tests/linearGradient-infinite-values.js        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/script-tests/linearGradient-infinite-values.js        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -4,15 +4,15 @@
</span><span class="cx"> 
</span><span class="cx"> var ctx = document.createElement('canvas').getContext('2d');
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, NaN)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, Infinity)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, -Infinity)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, 0, NaN, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, 0, Infinity, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, 0, -Infinity, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, NaN, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, Infinity, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(0, -Infinity, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(NaN, 0, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(Infinity, 0, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createLinearGradient(-Infinity, 0, 100, 100)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, NaN)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, Infinity)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, 0, 100, -Infinity)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, 0, NaN, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, 0, Infinity, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, 0, -Infinity, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, NaN, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, Infinity, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(0, -Infinity, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(NaN, 0, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(Infinity, 0, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createLinearGradient(-Infinity, 0, 100, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcanvasscripttestsradialGradientinfinitevaluesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/script-tests/radialGradient-infinite-values.js (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/script-tests/radialGradient-infinite-values.js        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/LayoutTests/fast/canvas/script-tests/radialGradient-infinite-values.js        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -4,21 +4,21 @@
</span><span class="cx"> 
</span><span class="cx"> var ctx = document.createElement('canvas').getContext('2d');
</span><span class="cx"> 
</span><del>-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, NaN)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, NaN, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, NaN, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, NaN, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, NaN, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
-shouldThrow(&quot;ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: Type error'&quot;);
</del><ins>+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, NaN)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, NaN, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, NaN, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, NaN, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, NaN, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
+shouldThrow(&quot;ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100)&quot;, &quot;'TypeError: The provided value is non-finite'&quot;);
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/ChangeLog        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-05-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Clean up converting from JSValue to float / double in the bindings generator
+        https://bugs.webkit.org/show_bug.cgi?id=157407
+
+        Reviewed by Darin Adler.
+
+        Clean up converting from JSValue to float / double in the bindings generator:
+        - Handle all aspects of converting to float / double inside JSValueToNative()
+          instead of relying partly on the call sites.
+        - Add a build&lt;&gt;() template function to JSDOMBuild.h that is now
+          called from the bindings to convert to float / double and deal with
+          non-finite values.
+        - Provide a better message with the TypeError that is thrown for non-finite
+          values.
+
+        No new tests, rebaselined existing tests.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::throwSequenceTypeError):
+        (WebCore::throwNonFiniteTypeError):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSDOMBuild.h:
+        (WebCore::build):
+        * bindings/scripts/CodeGenerator.pm:
+        (IsFloatingPointType):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative):
+        (GenerateImplementation): Deleted.
+        (GenerateParametersCheck): Deleted.
+        (GenerateReturnParameters): Deleted.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::setJSTestObjStrictFloat):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
+        (WebCore::jsTestObjPrototypeFunctionStrictFunction):
+        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
+        (WebCore::jsTestObjPrototypeFunctionAny):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
+
</ins><span class="cx"> 2016-05-06  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Regions, Shapes and Tracks don't need runtime features
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -788,9 +788,14 @@
</span><span class="cx"> 
</span><span class="cx"> void throwSequenceTypeError(JSC::ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    throwTypeError(state, &quot;Value is not a sequence&quot;);
</del><ins>+    throwTypeError(state, ASCIILiteral(&quot;Value is not a sequence&quot;));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void throwNonFiniteTypeError(ExecState&amp; state)
+{
+    throwTypeError(&amp;state, ASCIILiteral(&quot;The provided value is non-finite&quot;));
+}
+
</ins><span class="cx"> bool throwSetterTypeError(JSC::ExecState&amp; state, const char* interfaceName, const char* attributeName)
</span><span class="cx"> {
</span><span class="cx">     throwTypeError(state, makeString(&quot;The &quot;, interfaceName, '.', attributeName, &quot; setter can only be used on instances of &quot;, interfaceName));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> void throwAttributeTypeError(JSC::ExecState&amp;, const char* interfaceName, const char* attributeName, const char* expectedType);
</span><span class="cx"> WEBCORE_EXPORT void throwSequenceTypeError(JSC::ExecState&amp;);
</span><span class="cx"> WEBCORE_EXPORT bool throwSetterTypeError(JSC::ExecState&amp;, const char* interfaceName, const char* attributeName);
</span><ins>+WEBCORE_EXPORT void throwNonFiniteTypeError(JSC::ExecState&amp;);
</ins><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentMustBeEnumError(JSC::ExecState&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedValues);
</span><span class="cx"> JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState&amp;, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBuildh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBuild.h (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBuild.h        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/js/JSDOMBuild.h        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -26,14 +26,27 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;JSDOMBinding.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; T build(JSC::ExecState&amp;, JSC::JSValue);
</span><span class="cx"> template&lt;typename T, unsigned characterCount&gt; T build(JSC::ExecState&amp;, JSC::JSValue, const char (&amp;propertyName)[characterCount]);
</span><ins>+enum class ShouldAllowNonFinite { No, Yes };
+template&lt;typename T&gt; T build(JSC::ExecState&amp;, JSC::JSValue, ShouldAllowNonFinite);
</ins><span class="cx"> 
</span><span class="cx"> template&lt;typename T, unsigned characterCount&gt; inline T build(JSC::ExecState&amp; state, JSC::JSValue value, const char (&amp;propertyName)[characterCount])
</span><span class="cx"> {
</span><span class="cx">     return build&lt;T&gt;(state, value.get(&amp;state, JSC::Identifier::fromString(&amp;state, propertyName)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; inline T build(JSC::ExecState&amp; state, JSC::JSValue value, ShouldAllowNonFinite allowNonFinite)
+{
+    static_assert(std::is_same&lt;T, float&gt;::value || std::is_same&lt;T, double&gt;::value, &quot;Should be called with converting to float or double&quot;);
+    double number = value.toNumber(&amp;state);
+    if (allowNonFinite == ShouldAllowNonFinite::No &amp;&amp; UNLIKELY(!std::isfinite(number)))
+        throwNonFiniteTypeError(state);
+    return static_cast&lt;T&gt;(number);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -61,6 +61,13 @@
</span><span class="cx">     &quot;unsigned short&quot; =&gt; 1,
</span><span class="cx"> );
</span><span class="cx"> 
</span><ins>+my %floatingPointTypeHash = (
+    &quot;float&quot; =&gt; 1,
+    &quot;unrestricted float&quot; =&gt; 1,
+    &quot;double&quot; =&gt; 1,
+    &quot;unrestricted double&quot; =&gt; 1,
+);
+
</ins><span class="cx"> my %primitiveTypeHash = ( &quot;boolean&quot; =&gt; 1, &quot;void&quot; =&gt; 1, &quot;Date&quot; =&gt; 1 );
</span><span class="cx"> 
</span><span class="cx"> # WebCore types used directly in IDL files.
</span><span class="lines">@@ -357,6 +364,13 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsFloatingPointType
+{
+    my ($object, $type) = @_;
+    return 1 if $floatingPointTypeHash{$type};
+    return 0;
+}
+
</ins><span class="cx"> sub IsPrimitiveType
</span><span class="cx"> {
</span><span class="cx">     my $object = shift;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -2928,13 +2928,6 @@
</span><span class="cx">                     push(@implContent, &quot;    }\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ($type eq &quot;double&quot; or $type eq &quot;float&quot;) {
-                    push(@implContent, &quot;    if (UNLIKELY(!std::isfinite(nativeValue))) {\n&quot;);
-                    push(@implContent, &quot;        throwVMTypeError(state);\n&quot;);
-                    push(@implContent, &quot;        return false;\n&quot;);
-                    push(@implContent, &quot;    }\n&quot;);
-                }
-
</del><span class="cx">                 if ($svgPropertyOrListPropertyType) {
</span><span class="cx">                     if ($svgPropertyType) {
</span><span class="cx">                         push(@implContent, &quot;    if (impl.isReadOnly()) {\n&quot;);
</span><span class="lines">@@ -3798,11 +3791,6 @@
</span><span class="cx">             if ($codeGenerator-&gt;IsTypedArrayType($argType) and $argType ne &quot;ArrayBuffer&quot;) {
</span><span class="cx">                $value = $shouldPassByReference ? &quot;$name.releaseNonNull()&quot; : &quot;WTFMove($name)&quot;;
</span><span class="cx">             }
</span><del>-
-            if ($argType eq &quot;double&quot; or $argType eq &quot;float&quot;) {
-                push(@$outputArray, &quot;    if (UNLIKELY(!std::isfinite($name)))\n&quot;);
-                push(@$outputArray, &quot;        return throwVMTypeError(state);\n&quot;);
-            }
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         push(@arguments, $value);
</span><span class="lines">@@ -4414,8 +4402,16 @@
</span><span class="cx">     return ($value, 0) if $type eq &quot;any&quot;;
</span><span class="cx"> 
</span><span class="cx">     return (&quot;$value.toBoolean(state)&quot;, 1) if $type eq &quot;boolean&quot;;
</span><del>-    return (&quot;$value.toNumber(state)&quot;, 1) if $type eq &quot;double&quot; or $type eq &quot;unrestricted double&quot;;
-    return (&quot;$value.toFloat(state)&quot;, 1) if $type eq &quot;float&quot; or $type eq &quot;unrestricted float&quot;;
</del><ins>+
+    if ($codeGenerator-&gt;IsFloatingPointType($type)) {
+        AddToImplIncludes(&quot;JSDOMBuild.h&quot;);
+        return (&quot;build&lt;double&gt;(*state, $value, ShouldAllowNonFinite::No)&quot;, 1) if $type eq &quot;double&quot;;
+        return (&quot;build&lt;double&gt;(*state, $value, ShouldAllowNonFinite::Yes)&quot;, 1) if $type eq &quot;unrestricted double&quot;;
+        return (&quot;build&lt;float&gt;(*state, $value, ShouldAllowNonFinite::No)&quot;, 1) if $type eq &quot;float&quot;;
+        return (&quot;build&lt;float&gt;(*state, $value, ShouldAllowNonFinite::Yes)&quot;, 1) if $type eq &quot;unrestricted float&quot;;
+        die &quot;Unhandled floating point type: &quot; . $type;
+    }
+
</ins><span class="cx">     return (&quot;valueToDate(state, $value)&quot;, 1) if $type eq &quot;Date&quot;;
</span><span class="cx"> 
</span><span class="cx">     return (&quot;to$type($value)&quot;, 1) if $codeGenerator-&gt;IsTypedArrayType($type);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -3630,7 +3630,7 @@
</span><span class="cx">         return throwSetterTypeError(*state, &quot;TestObj&quot;, &quot;strictFloat&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    auto nativeValue = value.toFloat(state);
</del><ins>+    auto nativeValue = build&lt;float&gt;(*state, value, ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><span class="cx">     impl.setStrictFloat(WTFMove(nativeValue));
</span><span class="lines">@@ -4688,7 +4688,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalDoubleIsNaN&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).toNumber(state);
</del><ins>+    auto number = build&lt;double&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalDoubleIsNaN(WTFMove(number));
</span><span class="lines">@@ -4703,7 +4703,7 @@
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithOptionalFloatIsNaN&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).toFloat(state);
</del><ins>+    auto number = build&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalFloatIsNaN(WTFMove(number));
</span><span class="lines">@@ -5692,7 +5692,7 @@
</span><span class="cx">     auto str = state-&gt;argument(0).toWTFString(state);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto a = state-&gt;argument(1).toFloat(state);
</del><ins>+    auto a = build&lt;float&gt;(*state, state-&gt;argument(1), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto b = toInt32(state, state-&gt;argument(2), NormalConversion);
</span><span class="lines">@@ -5784,7 +5784,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 head = state-&gt;argument(0).toNumber(state);
</del><ins>+    auto head = build&lt;double&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;double&gt; tail = toNativeArguments&lt;double&gt;(state, 1);
</span><span class="lines">@@ -5827,7 +5827,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 a = state-&gt;argument(0).toFloat(state);
</del><ins>+    auto a = build&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto b = toInt32(state, state-&gt;argument(1), NormalConversion);
</span><span class="lines">@@ -5871,11 +5871,9 @@
</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 a = state-&gt;argument(0).toFloat(state);
</del><ins>+    auto a = build&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::No);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    if (UNLIKELY(!std::isfinite(a)))
-        return throwVMTypeError(state);
</del><span class="cx">     impl.testPromiseFunctionWithFloatArgument(WTFMove(a), DeferredWrapper(state, castedThis-&gt;globalObject(), promiseDeferred));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -5937,11 +5935,9 @@
</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 a = state-&gt;argument(0).toFloat(state);
</del><ins>+    auto a = build&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::No);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    if (UNLIKELY(!std::isfinite(a)))
-        return throwVMTypeError(state);
</del><span class="cx">     impl.testPromiseOverloadedFunction(WTFMove(a), DeferredWrapper(state, castedThis-&gt;globalObject(), promiseDeferred));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (200527 => 200528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-06 22:06:29 UTC (rev 200527)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-06 22:23:29 UTC (rev 200528)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;DOMStringList.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><ins>+#include &quot;JSDOMBuild.h&quot;
</ins><span class="cx"> #include &quot;JSDOMConstructor.h&quot;
</span><span class="cx"> #include &quot;JSDOMStringList.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><span class="lines">@@ -480,19 +481,19 @@
</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 width = state-&gt;argument(0).toFloat(state);
</del><ins>+    auto width = build&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto height = state-&gt;argument(1).toFloat(state);
</del><ins>+    auto height = build&lt;float&gt;(*state, state-&gt;argument(1), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto blur = state-&gt;argument(2).toFloat(state);
</del><ins>+    auto blur = build&lt;float&gt;(*state, state-&gt;argument(2), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto color = state-&gt;argument(3).isUndefined() ? String() : state-&gt;uncheckedArgument(3).toWTFString(state);
</span><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    auto alpha = state-&gt;argument(4).isUndefined() ? Optional&lt;float&gt;() : state-&gt;uncheckedArgument(4).toFloat(state);
</del><ins>+    auto alpha = state-&gt;argument(4).isUndefined() ? Optional&lt;float&gt;() : build&lt;float&gt;(*state, state-&gt;uncheckedArgument(4), ShouldAllowNonFinite::Yes);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha));
</span></span></pre>
</div>
</div>

</body>
</html>