<!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>[173839] 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/173839">173839</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-09-22 09:53:37 -0700 (Mon, 22 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Simple ES6 feature: Number constructor extras
https://bugs.webkit.org/show_bug.cgi?id=131707
Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-09-22
Reviewed by Darin Adler.
Source/JavaScriptCore:
* runtime/CommonIdentifiers.h: Added new identifiers.
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertySlot):
(JSC::NumberConstructor::isFunction): Added.
(JSC::numberConstructorEpsilonValue): Added.
(JSC::numberConstructorNegInfinity): Added.
(JSC::numberConstructorPosInfinity): Added.
(JSC::numberConstructorMaxValue): Added.
(JSC::numberConstructorMinValue): Added.
(JSC::numberConstructorMaxSafeInteger): Added.
(JSC::numberConstructorMinSafeInteger): Added.
(JSC::numberConstructorFuncIsFinite): Added.
(JSC::numberConstructorFuncIsInteger): Added.
(JSC::numberConstructorFuncIsNaN): Added.
(JSC::numberConstructorFuncIsSafeInteger): Added.
* runtime/NumberConstructor.h:
LayoutTests:
* js/Object-getOwnPropertyNames-expected.txt:
* js/number-constructor-expected.txt: Added.
* js/number-constructor.html: Added.
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/number-constructor.js: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsObjectgetOwnPropertyNamesexpectedtxt">trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsObjectgetOwnPropertyNamesjs">trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNumberConstructorcpp">trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNumberConstructorh">trunk/Source/JavaScriptCore/runtime/NumberConstructor.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsnumberconstructorexpectedtxt">trunk/LayoutTests/js/number-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsnumberconstructorhtml">trunk/LayoutTests/js/number-constructor.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsnumberconstructorjs">trunk/LayoutTests/js/script-tests/number-constructor.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/LayoutTests/ChangeLog        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-09-22 Diego Pino Garcia <dpino@igalia.com>
+
+ Simple ES6 feature: Number constructor extras
+ https://bugs.webkit.org/show_bug.cgi?id=131707
+
+ Reviewed by Darin Adler.
+
+ * js/Object-getOwnPropertyNames-expected.txt:
+ * js/number-constructor-expected.txt: Added.
+ * js/number-constructor.html: Added.
+ * js/script-tests/Object-getOwnPropertyNames.js:
+ * js/script-tests/number-constructor.js: Added.
+
</ins><span class="cx"> 2014-09-17 Philippe Normand <pnormand@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GStreamer] Cannot play Vimeo video
</span></span></pre></div>
<a id="trunkLayoutTestsjsObjectgetOwnPropertyNamesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'contains', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf']
</span><del>-PASS getSortedOwnPropertyNames(Number) is ['MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'length', 'name', 'prototype']
</del><ins>+PASS getSortedOwnPropertyNames(Number) is ['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']
</ins><span class="cx"> PASS getSortedOwnPropertyNames(Number.prototype) is ['clz', 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Date) is ['UTC', 'length', 'name', 'now', 'parse', 'prototype']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Date.prototype) is ['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf']
</span></span></pre></div>
<a id="trunkLayoutTestsjsnumberconstructorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/number-constructor-expected.txt (0 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/number-constructor-expected.txt         (rev 0)
+++ trunk/LayoutTests/js/number-constructor-expected.txt        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+This test case tests the Number constructor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Number.isFinite(0) is true
+PASS Number.isFinite(-0) is true
+PASS Number.isFinite(1) is true
+PASS Number.isFinite(-1) is true
+PASS Number.isFinite(1.0) is true
+PASS Number.isFinite(1.1) is true
+PASS Number.isFinite(-1.0) is true
+PASS Number.isFinite(-1.1) is true
+PASS Number.isFinite(Number.MAX_SAFE_INTEGER) is true
+PASS Number.isFinite(Number.MIN_SAFE_INTEGER) is true
+PASS Number.isFinite(Number.MAX_VALUE) is true
+PASS Number.isFinite(Number.MIN_VALUE) is true
+PASS Number.isFinite() is false
+PASS Number.isFinite({}) is false
+PASS Number.isFinite([]) is false
+PASS Number.isFinite(true) is false
+PASS Number.isFinite(false) is false
+PASS Number.isFinite(null) is false
+PASS Number.isFinite(undefined) is false
+PASS Number.isFinite(Number.NaN) is false
+PASS Number.isFinite(Number.POSITIVE_INFINITY) is false
+PASS Number.isFinite(Number.NEGATIVE_INFINITY) is false
+PASS Number.isInteger(0) is true
+PASS Number.isInteger(-0) is true
+PASS Number.isInteger(1) is true
+PASS Number.isInteger(-1) is true
+PASS Number.isInteger(1.0) is true
+PASS Number.isInteger(-1.0) is true
+PASS Number.isInteger(Number.MAX_SAFE_INTEGER) is true
+PASS Number.isInteger(Number.MIN_SAFE_INTEGER) is true
+PASS Number.isInteger(Number.MAX_VALUE) is true
+PASS Number.isInteger(Number.MIN_VALUE) is false
+PASS Number.isInteger(1.1) is false
+PASS Number.isInteger(-1.1) is false
+PASS Number.isInteger() is false
+PASS Number.isInteger({}) is false
+PASS Number.isInteger([]) is false
+PASS Number.isInteger(true) is false
+PASS Number.isInteger(false) is false
+PASS Number.isInteger(null) is false
+PASS Number.isInteger(undefined) is false
+PASS Number.isInteger(Number.NaN) is false
+PASS Number.isInteger(Number.POSITIVE_INFINITY) is false
+PASS Number.isInteger(Number.NEGATIVE_INFINITY) is false
+PASS Number.isNaN(Number.NaN) is true
+PASS Number.isNaN(0) is false
+PASS Number.isNaN(-0) is false
+PASS Number.isNaN(1) is false
+PASS Number.isNaN(-1) is false
+PASS Number.isNaN(1.0) is false
+PASS Number.isNaN(1.1) is false
+PASS Number.isNaN(-1.0) is false
+PASS Number.isNaN(-1.1) is false
+PASS Number.isNaN() is false
+PASS Number.isNaN({}) is false
+PASS Number.isNaN([]) is false
+PASS Number.isNaN(false) is false
+PASS Number.isNaN(false) is false
+PASS Number.isNaN(null) is false
+PASS Number.isNaN(undefined) is false
+PASS Number.isNaN(Number.POSITIVE_INFINITY) is false
+PASS Number.isNaN(Number.NEGATIVE_INFINITY) is false
+PASS Number.isNaN(Number.MAX_SAFE_INTEGER) is false
+PASS Number.isNaN(Number.MIN_SAFE_INTEGER) is false
+PASS Number.isNaN(Number.MAX_VALUE) is false
+PASS Number.isNaN(Number.MIN_VALUE) is false
+PASS Number.isSafeInteger(0) is true
+PASS Number.isSafeInteger(-0) is true
+PASS Number.isSafeInteger(1) is true
+PASS Number.isSafeInteger(-1) is true
+PASS Number.isSafeInteger(1.0) is true
+PASS Number.isSafeInteger(-1.0) is true
+PASS Number.isSafeInteger(Number.MAX_SAFE_INTEGER) is true
+PASS Number.isSafeInteger(Number.MAX_SAFE_INTEGER - 1) is true
+PASS Number.isSafeInteger(Number.MIN_SAFE_INTEGER) is true
+PASS Number.isSafeInteger(Number.MIN_SAFE_INTEGER + 1) is true
+PASS Number.isSafeInteger(1.1) is false
+PASS Number.isSafeInteger(-1.1) is false
+PASS Number.isSafeInteger() is false
+PASS Number.isSafeInteger({}) is false
+PASS Number.isSafeInteger([]) is false
+PASS Number.isSafeInteger(false) is false
+PASS Number.isSafeInteger(false) is false
+PASS Number.isSafeInteger(null) is false
+PASS Number.isSafeInteger(undefined) is false
+PASS Number.isSafeInteger(Number.NaN) is false
+PASS Number.isSafeInteger(Number.MAX_VALUE) is false
+PASS Number.isSafeInteger(Number.MIN_VALUE) is false
+PASS Number.isSafeInteger(Number.POSITIVE_INFINITY) is false
+PASS Number.isSafeInteger(Number.NEGATIVE_INFINITY) is false
+PASS Number.isSafeInteger(Number.MAX_SAFE_INTEGER + 1) is false
+PASS Number.isSafeInteger(Number.MIN_SAFE_INTEGER - 1) is false
+PASS Number.parseFloat("0") is 0
+PASS Number.parseFloat("-0") is -0
+PASS Number.parseFloat("1") is 1
+PASS Number.parseFloat("-1") is -1
+PASS Number.parseFloat("1.1") is 1.1
+PASS Number.parseFloat("-1.1") is -1.1
+PASS Number.parseFloat("10E6") is 10E6
+PASS Number.parseFloat("0xA") is 0
+PASS Number.parseFloat("050") is 50
+PASS Number.parseFloat(050) is 40
+PASS Number.parseFloat("0x20") is 0
+PASS Number.parseFloat(0x20) is 32
+PASS Number.parseFloat() is NaN
+PASS Number.parseFloat({}) is NaN
+PASS Number.parseFloat([]) is NaN
+PASS Number.parseFloat(false) is NaN
+PASS Number.parseFloat(false) is NaN
+PASS Number.parseFloat(null) is NaN
+PASS Number.parseFloat(Number.NaN) is NaN
+PASS Number.parseFloat("1.7976931348623157E308") is 1.7976931348623157e+308
+PASS Number.parseFloat("1.80E308") is Infinity
+PASS Number.parseFloat("5E-324") is 5e-324
+PASS Number.parseFloat("5E-325") is 0
+PASS Number.parseFloat("20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") is 2e+307
+PASS Number.parseFloat("200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") is Infinity
+PASS Number.parseInt("0") is 0
+PASS Number.parseInt("-0") is -0
+PASS Number.parseInt("1") is 1
+PASS Number.parseInt("-1") is -1
+PASS Number.parseInt("1.1") is 1
+PASS Number.parseInt("-1.1") is -1
+PASS Number.parseInt("10E6") is 10
+PASS Number.parseInt("0xA") is 10
+PASS Number.parseInt("050") is 50
+PASS Number.parseInt("050", 8) is 40
+PASS Number.parseInt(050) is 40
+PASS Number.parseInt("0x20") is 32
+PASS Number.parseInt("0x20", 16) is 32
+PASS Number.parseInt("20", 16) is 32
+PASS Number.parseInt(0x20) is 32
+PASS Number.parseInt() is NaN
+PASS Number.parseInt({}) is NaN
+PASS Number.parseInt([]) is NaN
+PASS Number.parseInt(false) is NaN
+PASS Number.parseInt(false) is NaN
+PASS Number.parseInt(null) is NaN
+PASS Number.parseInt(Number.NaN) is NaN
+PASS Number.parseInt("1.7976931348623157E308") is 1
+PASS Number.parseInt("1.80E308") is 1
+PASS Number.parseInt("5E-324") is 5
+PASS Number.parseInt("5E-325") is 5
+PASS Number.parseInt("20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") is 2e+307
+PASS Number.parseInt("200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") is Infinity
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsnumberconstructorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/number-constructor.html (0 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/number-constructor.html         (rev 0)
+++ trunk/LayoutTests/js/number-constructor.html        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+ <script src="script-tests/number-constructor.js"></script>
+ <script src="../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsObjectgetOwnPropertyNamesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> "String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'contains', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'replace', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']",
</span><span class="cx"> "Boolean": "['length', 'name', 'prototype']",
</span><span class="cx"> "Boolean.prototype": "['constructor', 'toString', 'valueOf']",
</span><del>- "Number": "['MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'length', 'name', 'prototype']",
</del><ins>+ "Number": "['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']",
</ins><span class="cx"> "Number.prototype": "['clz', 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']",
</span><span class="cx"> "Date": "['UTC', 'length', 'name', 'now', 'parse', 'prototype']",
</span><span class="cx"> "Date.prototype": "['constructor', 'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds', 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset', 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'toDateString', 'toGMTString', 'toISOString', 'toJSON', 'toLocaleDateString', 'toLocaleString', 'toLocaleTimeString', 'toString', 'toTimeString', 'toUTCString', 'valueOf']",
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsnumberconstructorjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/number-constructor.js (0 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/number-constructor.js         (rev 0)
+++ trunk/LayoutTests/js/script-tests/number-constructor.js        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+description('This test case tests the Number constructor.');
+
+// isFinite
+shouldBeTrue('Number.isFinite(0)');
+shouldBeTrue('Number.isFinite(-0)');
+shouldBeTrue('Number.isFinite(1)');
+shouldBeTrue('Number.isFinite(-1)');
+shouldBeTrue('Number.isFinite(1.0)');
+shouldBeTrue('Number.isFinite(1.1)');
+shouldBeTrue('Number.isFinite(-1.0)');
+shouldBeTrue('Number.isFinite(-1.1)');
+shouldBeTrue('Number.isFinite(Number.MAX_SAFE_INTEGER)');
+shouldBeTrue('Number.isFinite(Number.MIN_SAFE_INTEGER)');
+shouldBeTrue('Number.isFinite(Number.MAX_VALUE)');
+shouldBeTrue('Number.isFinite(Number.MIN_VALUE)');
+shouldBeFalse('Number.isFinite()');
+shouldBeFalse('Number.isFinite({})');
+shouldBeFalse('Number.isFinite([])');
+shouldBeFalse('Number.isFinite(true)');
+shouldBeFalse('Number.isFinite(false)');
+shouldBeFalse('Number.isFinite(null)');
+shouldBeFalse('Number.isFinite(undefined)');
+shouldBeFalse('Number.isFinite(Number.NaN)');
+shouldBeFalse('Number.isFinite(Number.POSITIVE_INFINITY)');
+shouldBeFalse('Number.isFinite(Number.NEGATIVE_INFINITY)');
+
+// isInteger
+shouldBeTrue('Number.isInteger(0)');
+shouldBeTrue('Number.isInteger(-0)');
+shouldBeTrue('Number.isInteger(1)');
+shouldBeTrue('Number.isInteger(-1)');
+shouldBeTrue('Number.isInteger(1.0)');
+shouldBeTrue('Number.isInteger(-1.0)');
+shouldBeTrue('Number.isInteger(Number.MAX_SAFE_INTEGER)');
+shouldBeTrue('Number.isInteger(Number.MIN_SAFE_INTEGER)');
+shouldBeTrue('Number.isInteger(Number.MAX_VALUE)');
+shouldBeFalse('Number.isInteger(Number.MIN_VALUE)');
+shouldBeFalse('Number.isInteger(1.1)');
+shouldBeFalse('Number.isInteger(-1.1)');
+shouldBeFalse('Number.isInteger()');
+shouldBeFalse('Number.isInteger({})');
+shouldBeFalse('Number.isInteger([])');
+shouldBeFalse('Number.isInteger(true)');
+shouldBeFalse('Number.isInteger(false)');
+shouldBeFalse('Number.isInteger(null)');
+shouldBeFalse('Number.isInteger(undefined)');
+shouldBeFalse('Number.isInteger(Number.NaN)');
+shouldBeFalse('Number.isInteger(Number.POSITIVE_INFINITY)');
+shouldBeFalse('Number.isInteger(Number.NEGATIVE_INFINITY)');
+
+// isNaN
+shouldBeTrue('Number.isNaN(Number.NaN)');
+shouldBeFalse('Number.isNaN(0)');
+shouldBeFalse('Number.isNaN(-0)');
+shouldBeFalse('Number.isNaN(1)');
+shouldBeFalse('Number.isNaN(-1)');
+shouldBeFalse('Number.isNaN(1.0)');
+shouldBeFalse('Number.isNaN(1.1)');
+shouldBeFalse('Number.isNaN(-1.0)');
+shouldBeFalse('Number.isNaN(-1.1)');
+shouldBeFalse('Number.isNaN()');
+shouldBeFalse('Number.isNaN({})');
+shouldBeFalse('Number.isNaN([])');
+shouldBeFalse('Number.isNaN(false)');
+shouldBeFalse('Number.isNaN(false)');
+shouldBeFalse('Number.isNaN(null)');
+shouldBeFalse('Number.isNaN(undefined)');
+shouldBeFalse('Number.isNaN(Number.POSITIVE_INFINITY)');
+shouldBeFalse('Number.isNaN(Number.NEGATIVE_INFINITY)');
+shouldBeFalse('Number.isNaN(Number.MAX_SAFE_INTEGER)');
+shouldBeFalse('Number.isNaN(Number.MIN_SAFE_INTEGER)');
+shouldBeFalse('Number.isNaN(Number.MAX_VALUE)');
+shouldBeFalse('Number.isNaN(Number.MIN_VALUE)');
+
+// isSafeInteger
+shouldBeTrue('Number.isSafeInteger(0)');
+shouldBeTrue('Number.isSafeInteger(-0)');
+shouldBeTrue('Number.isSafeInteger(1)');
+shouldBeTrue('Number.isSafeInteger(-1)');
+shouldBeTrue('Number.isSafeInteger(1.0)');
+shouldBeTrue('Number.isSafeInteger(-1.0)');
+shouldBeTrue('Number.isSafeInteger(Number.MAX_SAFE_INTEGER)');
+shouldBeTrue('Number.isSafeInteger(Number.MAX_SAFE_INTEGER - 1)');
+shouldBeTrue('Number.isSafeInteger(Number.MIN_SAFE_INTEGER)');
+shouldBeTrue('Number.isSafeInteger(Number.MIN_SAFE_INTEGER + 1)');
+shouldBeFalse('Number.isSafeInteger(1.1)');
+shouldBeFalse('Number.isSafeInteger(-1.1)');
+shouldBeFalse('Number.isSafeInteger()');
+shouldBeFalse('Number.isSafeInteger({})');
+shouldBeFalse('Number.isSafeInteger([])');
+shouldBeFalse('Number.isSafeInteger(false)');
+shouldBeFalse('Number.isSafeInteger(false)');
+shouldBeFalse('Number.isSafeInteger(null)');
+shouldBeFalse('Number.isSafeInteger(undefined)');
+shouldBeFalse('Number.isSafeInteger(Number.NaN)');
+shouldBeFalse('Number.isSafeInteger(Number.MAX_VALUE)');
+shouldBeFalse('Number.isSafeInteger(Number.MIN_VALUE)');
+shouldBeFalse('Number.isSafeInteger(Number.POSITIVE_INFINITY)');
+shouldBeFalse('Number.isSafeInteger(Number.NEGATIVE_INFINITY)');
+shouldBeFalse('Number.isSafeInteger(Number.MAX_SAFE_INTEGER + 1)');
+shouldBeFalse('Number.isSafeInteger(Number.MIN_SAFE_INTEGER - 1)');
+
+// parseFloat
+shouldBe('Number.parseFloat("0")', '0');
+shouldBe('Number.parseFloat("-0")', '-0');
+shouldBe('Number.parseFloat("1")', '1');
+shouldBe('Number.parseFloat("-1")', '-1');
+shouldBe('Number.parseFloat("1.1")', '1.1');
+shouldBe('Number.parseFloat("-1.1")', '-1.1');
+shouldBe('Number.parseFloat("10E6")', '10E6');
+shouldBe('Number.parseFloat("0xA")', '0');
+shouldBe('Number.parseFloat("050")', '50');
+shouldBe('Number.parseFloat(050)', '40');
+shouldBe('Number.parseFloat("0x20")', '0');
+shouldBe('Number.parseFloat(0x20)', '32');
+shouldBe('Number.parseFloat()', 'NaN');
+shouldBe('Number.parseFloat({})', 'NaN');
+shouldBe('Number.parseFloat([])', 'NaN');
+shouldBe('Number.parseFloat(false)', 'NaN');
+shouldBe('Number.parseFloat(false)', 'NaN');
+shouldBe('Number.parseFloat(null)', 'NaN');
+shouldBe('Number.parseFloat(Number.NaN)', 'NaN');
+shouldBe('Number.parseFloat("1.7976931348623157E308")', '1.7976931348623157e+308');
+shouldBe('Number.parseFloat("1.80E308")', "Infinity");
+shouldBe('Number.parseFloat("5E-324")', '5e-324');
+shouldBe('Number.parseFloat("5E-325")', '0');
+shouldBe('Number.parseFloat("20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")', '2e+307');
+shouldBe('Number.parseFloat("200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")', 'Infinity');
+
+// parseInt
+shouldBe('Number.parseInt("0")', '0');
+shouldBe('Number.parseInt("-0")', '-0');
+shouldBe('Number.parseInt("1")', '1');
+shouldBe('Number.parseInt("-1")', '-1');
+shouldBe('Number.parseInt("1.1")', '1');
+shouldBe('Number.parseInt("-1.1")', '-1');
+shouldBe('Number.parseInt("10E6")', '10');
+shouldBe('Number.parseInt("0xA")', '10');
+shouldBe('Number.parseInt("050")', '50');
+shouldBe('Number.parseInt("050", 8)', '40');
+shouldBe('Number.parseInt(050)', '40');
+shouldBe('Number.parseInt("0x20")', '32');
+shouldBe('Number.parseInt("0x20", 16)', '32');
+shouldBe('Number.parseInt("20", 16)', '32');
+shouldBe('Number.parseInt(0x20)', '32');
+shouldBe('Number.parseInt()', 'NaN');
+shouldBe('Number.parseInt({})', 'NaN');
+shouldBe('Number.parseInt([])', 'NaN');
+shouldBe('Number.parseInt(false)', 'NaN');
+shouldBe('Number.parseInt(false)', 'NaN');
+shouldBe('Number.parseInt(null)', 'NaN');
+shouldBe('Number.parseInt(Number.NaN)', 'NaN');
+shouldBe('Number.parseInt("1.7976931348623157E308")', '1');
+shouldBe('Number.parseInt("1.80E308")', '1');
+shouldBe('Number.parseInt("5E-324")', '5');
+shouldBe('Number.parseInt("5E-325")', '5');
+shouldBe('Number.parseInt("20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")', '2e+307');
+shouldBe('Number.parseInt("200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")', 'Infinity');
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-09-22 Diego Pino Garcia <dpino@igalia.com>
+
+ Simple ES6 feature: Number constructor extras
+ https://bugs.webkit.org/show_bug.cgi?id=131707
+
+ Reviewed by Darin Adler.
+
+ * runtime/CommonIdentifiers.h: Added new identifiers.
+ * runtime/NumberConstructor.cpp:
+ (JSC::NumberConstructor::getOwnPropertySlot):
+ (JSC::NumberConstructor::isFunction): Added.
+ (JSC::numberConstructorEpsilonValue): Added.
+ (JSC::numberConstructorNegInfinity): Added.
+ (JSC::numberConstructorPosInfinity): Added.
+ (JSC::numberConstructorMaxValue): Added.
+ (JSC::numberConstructorMinValue): Added.
+ (JSC::numberConstructorMaxSafeInteger): Added.
+ (JSC::numberConstructorMinSafeInteger): Added.
+ (JSC::numberConstructorFuncIsFinite): Added.
+ (JSC::numberConstructorFuncIsInteger): Added.
+ (JSC::numberConstructorFuncIsNaN): Added.
+ (JSC::numberConstructorFuncIsSafeInteger): Added.
+ * runtime/NumberConstructor.h:
+
</ins><span class="cx"> 2014-09-21 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> FTL should store the four bytes of the cell header using a 32-bit store rather than four 8-bit stores
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -118,7 +118,11 @@
</span><span class="cx"> macro(input) \
</span><span class="cx"> macro(instructionCount) \
</span><span class="cx"> macro(isArray) \
</span><ins>+ macro(isFinite) \
+ macro(isInteger) \
+ macro(isNaN) \
</ins><span class="cx"> macro(isPrototypeOf) \
</span><ins>+ macro(isSafeInteger) \
</ins><span class="cx"> macro(isView) \
</span><span class="cx"> macro(isWatchpoint) \
</span><span class="cx"> macro(jettisonReason) \
</span><span class="lines">@@ -140,6 +144,8 @@
</span><span class="cx"> macro(osrExitSites) \
</span><span class="cx"> macro(osrExits) \
</span><span class="cx"> macro(parse) \
</span><ins>+ macro(parseFloat) \
+ macro(parseInt) \
</ins><span class="cx"> macro(postMessage) \
</span><span class="cx"> macro(profiledBytecodes) \
</span><span class="cx"> macro(propertyIsEnumerable) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNumberConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -26,14 +26,22 @@
</span><span class="cx"> #include "NumberObject.h"
</span><span class="cx"> #include "NumberPrototype.h"
</span><span class="cx"> #include "JSCInlines.h"
</span><ins>+#include "JSGlobalObjectFunctions.h"
</ins><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><ins>+static EncodedJSValue numberConstructorEpsilonValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</ins><span class="cx"> static EncodedJSValue numberConstructorNaNValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><span class="cx"> static EncodedJSValue numberConstructorNegInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><span class="cx"> static EncodedJSValue numberConstructorPosInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><span class="cx"> static EncodedJSValue numberConstructorMaxValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><span class="cx"> static EncodedJSValue numberConstructorMinValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
</span><ins>+static EncodedJSValue numberConstructorMaxSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue numberConstructorMinSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName);
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsFinite(ExecState*);
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsInteger(ExecState*);
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsNaN(ExecState*);
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsSafeInteger(ExecState*);
</ins><span class="cx">
</span><span class="cx"> } // namespace JSC
</span><span class="cx">
</span><span class="lines">@@ -47,11 +55,20 @@
</span><span class="cx">
</span><span class="cx"> /* Source for NumberConstructor.lut.h
</span><span class="cx"> @begin numberConstructorTable
</span><del>- NaN numberConstructorNaNValue DontEnum|DontDelete|ReadOnly
- NEGATIVE_INFINITY numberConstructorNegInfinity DontEnum|DontDelete|ReadOnly
- POSITIVE_INFINITY numberConstructorPosInfinity DontEnum|DontDelete|ReadOnly
- MAX_VALUE numberConstructorMaxValue DontEnum|DontDelete|ReadOnly
- MIN_VALUE numberConstructorMinValue DontEnum|DontDelete|ReadOnly
</del><ins>+ EPSILON numberConstructorEpsilonValue DontEnum|DontDelete|ReadOnly
+ NaN numberConstructorNaNValue DontEnum|DontDelete|ReadOnly
+ NEGATIVE_INFINITY numberConstructorNegInfinity DontEnum|DontDelete|ReadOnly
+ POSITIVE_INFINITY numberConstructorPosInfinity DontEnum|DontDelete|ReadOnly
+ MAX_VALUE numberConstructorMaxValue DontEnum|DontDelete|ReadOnly
+ MIN_VALUE numberConstructorMinValue DontEnum|DontDelete|ReadOnly
+ MAX_SAFE_INTEGER numberConstructorMaxSafeInteger DontEnum|DontDelete|ReadOnly
+ MIN_SAFE_INTEGER numberConstructorMinSafeInteger DontEnum|DontDelete|ReadOnly
+ isFinite numberConstructorFuncIsFinite DontEnum|Function 1
+ isInteger numberConstructorFuncIsInteger DontEnum|Function 1
+ isNaN numberConstructorFuncIsNaN DontEnum|Function 1
+ isSafeInteger numberConstructorFuncIsSafeInteger DontEnum|Function 1
+ parseFloat globalFuncParseFloat DontEnum|Function 1
+ parseInt globalFuncParseInt DontEnum|Function 2
</ins><span class="cx"> @end
</span><span class="cx"> */
</span><span class="cx">
</span><span class="lines">@@ -74,34 +91,72 @@
</span><span class="cx">
</span><span class="cx"> bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
</span><span class="cx"> {
</span><del>- return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, numberConstructorTable, jsCast<NumberConstructor*>(object), propertyName, slot);
</del><ins>+ if (isFunction(exec->vm(), propertyName.uid())) {
+ return getStaticFunctionSlot<InternalFunction>(exec, numberConstructorTable,
+ jsCast<NumberConstructor*>(object), propertyName, slot);
+ }
+ return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, numberConstructorTable,
+ jsCast<NumberConstructor*>(object), propertyName, slot);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+bool ALWAYS_INLINE NumberConstructor::isFunction(VM& vm, AtomicStringImpl* propertyName)
+{
+ return propertyName == vm.propertyNames->isFinite
+ || propertyName == vm.propertyNames->isInteger
+ || propertyName == vm.propertyNames->isNaN
+ || propertyName == vm.propertyNames->isSafeInteger
+ || propertyName == vm.propertyNames->parseFloat
+ || propertyName == vm.propertyNames->parseInt;
+}
+
+// ECMA-262 20.1.2.1
+static EncodedJSValue numberConstructorEpsilonValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
+{
+ return JSValue::encode(jsDoubleNumber((std::numeric_limits<double>::epsilon())));
+}
+
+// ECMA-262 20.1.2.8
</ins><span class="cx"> static EncodedJSValue numberConstructorNaNValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
</span><span class="cx"> {
</span><span class="cx"> return JSValue::encode(jsNaN());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.9
</ins><span class="cx"> static EncodedJSValue numberConstructorNegInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName)
</span><span class="cx"> {
</span><del>- return JSValue::encode(jsNumber(-std::numeric_limits<double>::infinity()));
</del><ins>+ return JSValue::encode(jsDoubleNumber(-std::numeric_limits<double>::infinity()));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.14
</ins><span class="cx"> static EncodedJSValue numberConstructorPosInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName)
</span><span class="cx"> {
</span><del>- return JSValue::encode(jsNumber(std::numeric_limits<double>::infinity()));
</del><ins>+ return JSValue::encode(jsDoubleNumber(std::numeric_limits<double>::infinity()));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.7
</ins><span class="cx"> static EncodedJSValue numberConstructorMaxValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
</span><span class="cx"> {
</span><del>- return JSValue::encode(jsNumber(1.7976931348623157E+308));
</del><ins>+ return JSValue::encode(jsDoubleNumber(1.7976931348623157E+308));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.11
</ins><span class="cx"> static EncodedJSValue numberConstructorMinValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
</span><span class="cx"> {
</span><del>- return JSValue::encode(jsNumber(5E-324));
</del><ins>+ return JSValue::encode(jsDoubleNumber(5E-324));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.6
+static EncodedJSValue numberConstructorMaxSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName)
+{
+ return JSValue::encode(jsDoubleNumber(9007199254740991.0));
+}
+
+// ECMA-262 20.1.2.7
+static EncodedJSValue numberConstructorMinSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName)
+{
+ return JSValue::encode(jsDoubleNumber(-9007199254740991.0));
+}
+
</ins><span class="cx"> // ECMA 15.7.1
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* exec)
</span><span class="cx"> {
</span><span class="lines">@@ -129,4 +184,50 @@
</span><span class="cx"> return CallTypeHost;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// ECMA-262 20.1.2.2
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsFinite(ExecState* exec)
+{
+ JSValue argument = exec->argument(0);
+ return JSValue::encode(jsBoolean(argument.isNumber() && (argument.isInt32() || std::isfinite(argument.asDouble()))));
+}
+
+// ECMA-262 20.1.2.3
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsInteger(ExecState* exec)
+{
+ JSValue argument = exec->argument(0);
+ bool isInteger;
+ if (argument.isInt32())
+ isInteger = true;
+ else if (!argument.isDouble())
+ isInteger = false;
+ else {
+ double number = argument.asDouble();
+ isInteger = std::isfinite(number) && trunc(number) == number;
+ }
+ return JSValue::encode(jsBoolean(isInteger));
+}
+
+// ECMA-262 20.1.2.4
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsNaN(ExecState* exec)
+{
+ JSValue argument = exec->argument(0);
+ return JSValue::encode(jsBoolean(argument.isDouble() && std::isnan(argument.asDouble())));
+}
+
+// ECMA-262 20.1.2.5
+static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsSafeInteger(ExecState* exec)
+{
+ JSValue argument = exec->argument(0);
+ bool isInteger;
+ if (argument.isInt32())
+ isInteger = true;
+ else if (!argument.isDouble())
+ isInteger = false;
+ else {
+ double number = argument.asDouble();
+ isInteger = trunc(number) == number && std::abs(number) <= 9007199254740991.0;
+ }
+ return JSValue::encode(jsBoolean(isInteger));
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNumberConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/NumberConstructor.h (173838 => 173839)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NumberConstructor.h        2014-09-22 15:51:24 UTC (rev 173838)
+++ trunk/Source/JavaScriptCore/runtime/NumberConstructor.h        2014-09-22 16:53:37 UTC (rev 173839)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> NumberConstructor(VM&, Structure*);
</span><span class="cx"> static ConstructType getConstructData(JSCell*, ConstructData&);
</span><span class="cx"> static CallType getCallData(JSCell*, CallData&);
</span><ins>+ static bool isFunction(VM&, AtomicStringImpl* propertyName);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre>
</div>
</div>
</body>
</html>