<!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<>() 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 <cdumez@apple.com>
+
+ 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 <beidson@apple.com>
</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 "PASS" messages, followed by "TEST COMPLETE".
</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 "PASS" messages, followed by "TEST COMPLETE".
</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("context.putImageData({}, 0, 0)", "'TypeError: Type error'");
</span><del>-shouldThrow("context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, NaN, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, NaN, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, NaN, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, NaN)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, undefined, 0, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, undefined, 0, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, undefined, 0, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, undefined, 0, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, undefined, 0)", "'TypeError: Type error'");
-shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, undefined)", "'TypeError: Type error'");
</del><ins>+shouldThrow("context.putImageData(buffer, NaN, 0, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, NaN, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, NaN, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, NaN, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, NaN, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, NaN)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, Infinity, 0, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, Infinity, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, Infinity, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, Infinity, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, Infinity, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, Infinity)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, undefined, 0, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, undefined, 0, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, undefined, 0, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, undefined, 0, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, undefined, 0)", "'TypeError: The provided value is non-finite'");
+shouldThrow("context.putImageData(buffer, 0, 0, 0, 0, 0, undefined)", "'TypeError: The provided value is non-finite'");
</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("canvas");
</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 "PASS" messages, followed by "TEST COMPLETE".
</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 "PASS" messages, followed by "TEST COMPLETE".
</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("ctx.createImageData(Infinity, Infinity)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(Infinity, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(-Infinity, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(10, Infinity)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(10, -Infinity)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(NaN, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.createImageData(10, NaN)", '"TypeError: Type error"');
</del><ins>+shouldThrow("ctx.createImageData(Infinity, Infinity)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(Infinity, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(-Infinity, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(10, Infinity)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(10, -Infinity)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(NaN, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.createImageData(10, NaN)", '"TypeError: The provided value is non-finite"');
</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("ctx.getImageData(NaN, 10, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, NaN, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, NaN, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, 10, NaN)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(Infinity, 10, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, Infinity, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, Infinity, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, 10, Infinity)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(undefined, 10, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, undefined, 10, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, undefined, 10)", '"TypeError: Type error"');
-shouldThrow("ctx.getImageData(10, 10, 10, undefined)", '"TypeError: Type error"');
</del><ins>+shouldThrow("ctx.getImageData(NaN, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, NaN, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, NaN, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, 10, NaN)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(Infinity, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, Infinity, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, Infinity, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, 10, Infinity)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(undefined, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, undefined, 10, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, undefined, 10)", '"TypeError: The provided value is non-finite"');
+shouldThrow("ctx.getImageData(10, 10, 10, undefined)", '"TypeError: The provided value is non-finite"');
</ins><span class="cx"> shouldThrow("ctx.getImageData(10, 10, 0, 10)", '"Error: IndexSizeError: DOM Exception 1"');
</span><span class="cx"> shouldThrow("ctx.getImageData(10, 10, 10, 0)", '"Error: IndexSizeError: DOM Exception 1"');
</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("ctx.createLinearGradient(0, 0, 100, NaN)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, 0, 100, Infinity)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, 0, 100, -Infinity)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, 0, NaN, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, 0, Infinity, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, 0, -Infinity, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, NaN, 100, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, Infinity, 100, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(0, -Infinity, 100, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(NaN, 0, 100, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(Infinity, 0, 100, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createLinearGradient(-Infinity, 0, 100, 100)", "'TypeError: Type error'");
</del><ins>+shouldThrow("ctx.createLinearGradient(0, 0, 100, NaN)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, 0, 100, Infinity)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, 0, 100, -Infinity)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, 0, NaN, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, 0, Infinity, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, 0, -Infinity, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, NaN, 100, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, Infinity, 100, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(0, -Infinity, 100, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(NaN, 0, 100, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(Infinity, 0, 100, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createLinearGradient(-Infinity, 0, 100, 100)", "'TypeError: The provided value is non-finite'");
</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("ctx.createRadialGradient(0, 0, 100, 0, 0, NaN)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, NaN, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, NaN, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, NaN, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, NaN, 100, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100)", "'TypeError: Type error'");
-shouldThrow("ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100)", "'TypeError: Type error'");
</del><ins>+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, 0, NaN)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, 0, Infinity)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, 0, -Infinity)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, NaN, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, Infinity, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, 0, -Infinity, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, NaN, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, Infinity, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, 100, -Infinity, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, NaN, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, Infinity, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, NaN, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, Infinity, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(0, -Infinity, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(NaN, 0, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(Infinity, 0, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
+shouldThrow("ctx.createRadialGradient(-Infinity, 0, 100, 0, 0, 100)", "'TypeError: The provided value is non-finite'");
</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 <cdumez@apple.com>
+
+ 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<>() 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 <dino@apple.com>
</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& state)
</span><span class="cx"> {
</span><del>- throwTypeError(state, "Value is not a sequence");
</del><ins>+ throwTypeError(state, ASCIILiteral("Value is not a sequence"));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void throwNonFiniteTypeError(ExecState& state)
+{
+ throwTypeError(&state, ASCIILiteral("The provided value is non-finite"));
+}
+
</ins><span class="cx"> bool throwSetterTypeError(JSC::ExecState& state, const char* interfaceName, const char* attributeName)
</span><span class="cx"> {
</span><span class="cx"> throwTypeError(state, makeString("The ", interfaceName, '.', attributeName, " setter can only be used on instances of ", 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&, const char* interfaceName, const char* attributeName, const char* expectedType);
</span><span class="cx"> WEBCORE_EXPORT void throwSequenceTypeError(JSC::ExecState&);
</span><span class="cx"> WEBCORE_EXPORT bool throwSetterTypeError(JSC::ExecState&, const char* interfaceName, const char* attributeName);
</span><ins>+WEBCORE_EXPORT void throwNonFiniteTypeError(JSC::ExecState&);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT JSC::EncodedJSValue throwArgumentMustBeEnumError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedValues);
</span><span class="cx"> JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState&, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName);
</span></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 "JSDOMBinding.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> template<typename T> T build(JSC::ExecState&, JSC::JSValue);
</span><span class="cx"> template<typename T, unsigned characterCount> T build(JSC::ExecState&, JSC::JSValue, const char (&propertyName)[characterCount]);
</span><ins>+enum class ShouldAllowNonFinite { No, Yes };
+template<typename T> T build(JSC::ExecState&, JSC::JSValue, ShouldAllowNonFinite);
</ins><span class="cx">
</span><span class="cx"> template<typename T, unsigned characterCount> inline T build(JSC::ExecState& state, JSC::JSValue value, const char (&propertyName)[characterCount])
</span><span class="cx"> {
</span><span class="cx"> return build<T>(state, value.get(&state, JSC::Identifier::fromString(&state, propertyName)));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename T> inline T build(JSC::ExecState& state, JSC::JSValue value, ShouldAllowNonFinite allowNonFinite)
+{
+ static_assert(std::is_same<T, float>::value || std::is_same<T, double>::value, "Should be called with converting to float or double");
+ double number = value.toNumber(&state);
+ if (allowNonFinite == ShouldAllowNonFinite::No && UNLIKELY(!std::isfinite(number)))
+ throwNonFiniteTypeError(state);
+ return static_cast<T>(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"> "unsigned short" => 1,
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+my %floatingPointTypeHash = (
+ "float" => 1,
+ "unrestricted float" => 1,
+ "double" => 1,
+ "unrestricted double" => 1,
+);
+
</ins><span class="cx"> my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 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, " }\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($type eq "double" or $type eq "float") {
- push(@implContent, " if (UNLIKELY(!std::isfinite(nativeValue))) {\n");
- push(@implContent, " throwVMTypeError(state);\n");
- push(@implContent, " return false;\n");
- push(@implContent, " }\n");
- }
-
</del><span class="cx"> if ($svgPropertyOrListPropertyType) {
</span><span class="cx"> if ($svgPropertyType) {
</span><span class="cx"> push(@implContent, " if (impl.isReadOnly()) {\n");
</span><span class="lines">@@ -3798,11 +3791,6 @@
</span><span class="cx"> if ($codeGenerator->IsTypedArrayType($argType) and $argType ne "ArrayBuffer") {
</span><span class="cx"> $value = $shouldPassByReference ? "$name.releaseNonNull()" : "WTFMove($name)";
</span><span class="cx"> }
</span><del>-
- if ($argType eq "double" or $argType eq "float") {
- push(@$outputArray, " if (UNLIKELY(!std::isfinite($name)))\n");
- push(@$outputArray, " return throwVMTypeError(state);\n");
- }
</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 "any";
</span><span class="cx">
</span><span class="cx"> return ("$value.toBoolean(state)", 1) if $type eq "boolean";
</span><del>- return ("$value.toNumber(state)", 1) if $type eq "double" or $type eq "unrestricted double";
- return ("$value.toFloat(state)", 1) if $type eq "float" or $type eq "unrestricted float";
</del><ins>+
+ if ($codeGenerator->IsFloatingPointType($type)) {
+ AddToImplIncludes("JSDOMBuild.h");
+ return ("build<double>(*state, $value, ShouldAllowNonFinite::No)", 1) if $type eq "double";
+ return ("build<double>(*state, $value, ShouldAllowNonFinite::Yes)", 1) if $type eq "unrestricted double";
+ return ("build<float>(*state, $value, ShouldAllowNonFinite::No)", 1) if $type eq "float";
+ return ("build<float>(*state, $value, ShouldAllowNonFinite::Yes)", 1) if $type eq "unrestricted float";
+ die "Unhandled floating point type: " . $type;
+ }
+
</ins><span class="cx"> return ("valueToDate(state, $value)", 1) if $type eq "Date";
</span><span class="cx">
</span><span class="cx"> return ("to$type($value)", 1) if $codeGenerator->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, "TestObj", "strictFloat");
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto nativeValue = value.toFloat(state);
</del><ins>+ auto nativeValue = build<float>(*state, value, ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->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, "TestObj", "methodWithOptionalDoubleIsNaN");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = state->argument(0).toNumber(state);
</del><ins>+ auto number = build<double>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->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, "TestObj", "methodWithOptionalFloatIsNaN");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- auto number = state->argument(0).toFloat(state);
</del><ins>+ auto number = build<float>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->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->argument(0).toWTFString(state);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- auto a = state->argument(1).toFloat(state);
</del><ins>+ auto a = build<float>(*state, state->argument(1), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto b = toInt32(state, state->argument(2), NormalConversion);
</span><span class="lines">@@ -5784,7 +5784,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto head = state->argument(0).toNumber(state);
</del><ins>+ auto head = build<double>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> Vector<double> tail = toNativeArguments<double>(state, 1);
</span><span class="lines">@@ -5827,7 +5827,7 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 2))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto a = state->argument(0).toFloat(state);
</del><ins>+ auto a = build<float>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto b = toInt32(state, state->argument(1), NormalConversion);
</span><span class="lines">@@ -5871,11 +5871,9 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto a = state->argument(0).toFloat(state);
</del><ins>+ auto a = build<float>(*state, state->argument(0), ShouldAllowNonFinite::No);
</ins><span class="cx"> if (UNLIKELY(state->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->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& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto a = state->argument(0).toFloat(state);
</del><ins>+ auto a = build<float>(*state, state->argument(0), ShouldAllowNonFinite::No);
</ins><span class="cx"> if (UNLIKELY(state->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->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 "DOMStringList.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><ins>+#include "JSDOMBuild.h"
</ins><span class="cx"> #include "JSDOMConstructor.h"
</span><span class="cx"> #include "JSDOMStringList.h"
</span><span class="cx"> #include "JSSVGPoint.h"
</span><span class="lines">@@ -480,19 +481,19 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 3))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- auto width = state->argument(0).toFloat(state);
</del><ins>+ auto width = build<float>(*state, state->argument(0), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- auto height = state->argument(1).toFloat(state);
</del><ins>+ auto height = build<float>(*state, state->argument(1), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- auto blur = state->argument(2).toFloat(state);
</del><ins>+ auto blur = build<float>(*state, state->argument(2), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> auto color = state->argument(3).isUndefined() ? String() : state->uncheckedArgument(3).toWTFString(state);
</span><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- auto alpha = state->argument(4).isUndefined() ? Optional<float>() : state->uncheckedArgument(4).toFloat(state);
</del><ins>+ auto alpha = state->argument(4).isUndefined() ? Optional<float>() : build<float>(*state, state->uncheckedArgument(4), ShouldAllowNonFinite::Yes);
</ins><span class="cx"> if (UNLIKELY(state->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>