<!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>[195138] 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/195138">195138</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-15 11:30:45 -0800 (Fri, 15 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[INTL] Implement Date.prototype.toLocaleString in ECMA-402
https://bugs.webkit.org/show_bug.cgi?id=147611

Patch by Andy VanWagoner &lt;thetalecrafter@gmail.com&gt; on 2016-01-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Expose dateProtoFuncGetTime as thisTimeValue for builtins.
Remove unused code in DateTimeFormat toDateTimeOptions, and make the
function specific to the call in initializeDateTimeFormat. Properly
throw when the options parameter is null.
Add toLocaleString in builtin JavaScript, with it's own specific branch
of toDateTimeOptions.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/DatePrototype.js: Added.
(toLocaleString.toDateTimeOptionsAnyAll):
(toLocaleString):
* runtime/CommonIdentifiers.h:
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::finishCreation):
* runtime/DatePrototype.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::toDateTimeOptions): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

LayoutTests:

* js/intl-datetimeformat-expected.txt: Added test for null options.
* js/date-toLocaleString-expected.txt: Added.
* js/date-toLocaleString.html: Added.
* js/script-tests/intl-datetimeformat.js: Added test for null options.
* js/script-tests/date-toLocaleString.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsintldatetimeformatexpectedtxt">trunk/LayoutTests/js/intl-datetimeformat-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsintldatetimeformatjs">trunk/LayoutTests/js/script-tests/intl-datetimeformat.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreDerivedSourcesmake">trunk/Source/JavaScriptCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDatePrototypecpp">trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDatePrototypeh">trunk/Source/JavaScriptCore/runtime/DatePrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatcpp">trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsdatetoLocaleStringexpectedtxt">trunk/LayoutTests/js/date-toLocaleString-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdatetoLocaleStringhtml">trunk/LayoutTests/js/date-toLocaleString.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsdatetoLocaleStringjs">trunk/LayoutTests/js/script-tests/date-toLocaleString.js</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsDatePrototypejs">trunk/Source/JavaScriptCore/builtins/DatePrototype.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/LayoutTests/ChangeLog        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-01-15  Andy VanWagoner  &lt;thetalecrafter@gmail.com&gt;
+
+        [INTL] Implement Date.prototype.toLocaleString in ECMA-402
+        https://bugs.webkit.org/show_bug.cgi?id=147611
+
+        Reviewed by Benjamin Poulain.
+
+        * js/intl-datetimeformat-expected.txt: Added test for null options.
+        * js/date-toLocaleString-expected.txt: Added.
+        * js/date-toLocaleString.html: Added.
+        * js/script-tests/intl-datetimeformat.js: Added test for null options.
+        * js/script-tests/date-toLocaleString.js: Added.
+
</ins><span class="cx"> 2016-01-15  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Switch out from ES6 arrow function syntax to allow the test to work with an older WebKit.
</span></span></pre></div>
<a id="trunkLayoutTestsjsdatetoLocaleStringexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/date-toLocaleString-expected.txt (0 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/date-toLocaleString-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/date-toLocaleString-expected.txt        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+This test checks the behavior of Date.prototype.toLocaleString as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Date.prototype.toLocaleString.length is 0
+PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').enumerable is false
+PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').configurable is true
+PASS Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').writable is true
+PASS Date.prototype.toLocaleString.call(new Date) did not throw exception.
+PASS Date.prototype.toLocaleString.call() threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(undefined) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(null) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(0) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(NaN) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(Infinity) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call('1') threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call({}) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call([]) threw exception TypeError: Type error.
+PASS Date.prototype.toLocaleString.call(Symbol()) threw exception TypeError: Type error.
+PASS typeof new Date().toLocaleString() === 'string' is true
+PASS new Date(NaN).toLocaleString() is &quot;Invalid Date&quot;
+PASS new Date().toLocaleString('i') threw exception RangeError: invalid language tag: i.
+PASS new Date(0).toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }) is &quot;一九七〇/一/一 上午一二:〇〇:〇〇&quot;
+PASS new Date(0).toLocaleString('en', { timeZone: 'UTC' }) is &quot;1/1/1970, 12:00:00 AM&quot;
+PASS new Date(0).toLocaleString('en', null) threw exception TypeError: null is not an object.
+PASS new Date(0).toLocaleString('en', { timeZone: 'UTC', hour:'numeric', minute:'2-digit' }) is &quot;12:00 AM&quot;
+PASS new Date(0).toLocaleString('en', { timeZone: 'UTC', year:'numeric', month:'long' }) is &quot;January 1970&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdatetoLocaleStringhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/date-toLocaleString.html (0 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/date-toLocaleString.html                                (rev 0)
+++ trunk/LayoutTests/js/date-toLocaleString.html        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/date-toLocaleString.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsintldatetimeformatexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/intl-datetimeformat-expected.txt (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/intl-datetimeformat-expected.txt        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/LayoutTests/js/intl-datetimeformat-expected.txt        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> PASS Intl.DateTimeFormat.prototype.resolvedOptions() === Intl.DateTimeFormat.prototype.resolvedOptions() is false
</span><span class="cx"> PASS Intl.DateTimeFormat.prototype.resolvedOptions.call(5) threw exception TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that's not an object initialized as a DateTimeFormat.
</span><span class="cx"> PASS Intl.DateTimeFormat('$') threw exception RangeError: invalid language tag: $.
</span><del>-PASS Intl.DateTimeFormat('en', null) did not throw exception.
</del><ins>+PASS Intl.DateTimeFormat('en', null) threw exception TypeError: null is not an object (evaluating 'Intl.DateTimeFormat('en', null)').
</ins><span class="cx"> PASS Intl.DateTimeFormat('en').resolvedOptions().weekday is undefined
</span><span class="cx"> PASS Intl.DateTimeFormat('en').resolvedOptions().era is undefined
</span><span class="cx"> PASS Intl.DateTimeFormat('en').resolvedOptions().month is 'numeric'
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsdatetoLocaleStringjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/date-toLocaleString.js (0 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/date-toLocaleString.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/date-toLocaleString.js        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+description(&quot;This test checks the behavior of Date.prototype.toLocaleString as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).&quot;);
+
+shouldBe(&quot;Date.prototype.toLocaleString.length&quot;, &quot;0&quot;);
+shouldBeFalse(&quot;Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').enumerable&quot;);
+shouldBeTrue(&quot;Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').configurable&quot;);
+shouldBeTrue(&quot;Object.getOwnPropertyDescriptor(Date.prototype, 'toLocaleString').writable&quot;);
+
+// Test thisTimeValue abrupt completion.
+shouldNotThrow(&quot;Date.prototype.toLocaleString.call(new Date)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call()&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(undefined)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(null)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(0)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(NaN)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(Infinity)&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call('1')&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call({})&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call([])&quot;);
+shouldThrow(&quot;Date.prototype.toLocaleString.call(Symbol())&quot;);
+
+shouldBeTrue(&quot;typeof new Date().toLocaleString() === 'string'&quot;);
+
+shouldBeEqualToString(&quot;new Date(NaN).toLocaleString()&quot;, &quot;Invalid Date&quot;);
+
+// Test for DateTimeFormat behavior.
+// Test that locale parameter is passed through properly.
+shouldThrow(&quot;new Date().toLocaleString('i')&quot;);
+shouldBeEqualToString(&quot;new Date(0).toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' })&quot;, &quot;一九七〇/一/一 上午一二:〇〇:〇〇&quot;);
+
+// Defaults to mdy, hms
+shouldBeEqualToString(&quot;new Date(0).toLocaleString('en', { timeZone: 'UTC' })&quot;, &quot;1/1/1970, 12:00:00 AM&quot;);
+
+// Test that options parameter is passed through properly.
+shouldThrow(&quot;new Date(0).toLocaleString('en', null)&quot;, &quot;'TypeError: null is not an object'&quot;);
+shouldBeEqualToString(&quot;new Date(0).toLocaleString('en', { timeZone: 'UTC', hour:'numeric', minute:'2-digit' })&quot;, &quot;12:00 AM&quot;);
+shouldBeEqualToString(&quot;new Date(0).toLocaleString('en', { timeZone: 'UTC', year:'numeric', month:'long' })&quot;, &quot;January 1970&quot;);
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsintldatetimeformatjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/intl-datetimeformat.js (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/intl-datetimeformat.js        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/LayoutTests/js/script-tests/intl-datetimeformat.js        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> shouldThrow(&quot;Intl.DateTimeFormat.prototype.resolvedOptions.call(5)&quot;, &quot;'TypeError: Intl.DateTimeFormat.prototype.resolvedOptions called on value that\\'s not an object initialized as a DateTimeFormat'&quot;);
</span><span class="cx"> 
</span><span class="cx"> shouldThrow(&quot;Intl.DateTimeFormat('$')&quot;, &quot;'RangeError: invalid language tag: $'&quot;);
</span><del>-shouldNotThrow(&quot;Intl.DateTimeFormat('en', null)&quot;);
</del><ins>+shouldThrow(&quot;Intl.DateTimeFormat('en', null)&quot;, '&quot;TypeError: null is not an object (evaluating \'Intl.DateTimeFormat(\'en\', null)\')&quot;');
</ins><span class="cx"> 
</span><span class="cx"> // Defaults to month, day, year.
</span><span class="cx"> shouldBe(&quot;Intl.DateTimeFormat('en').resolvedOptions().weekday&quot;, &quot;undefined&quot;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -1222,6 +1222,7 @@
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
</span><ins>+    ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
</ins><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
</span><span class="cx">     ${JAVASCRIPTCORE_DIR}/builtins/GlobalObject.js
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2016-01-15  Andy VanWagoner  &lt;thetalecrafter@gmail.com&gt;
+
+        [INTL] Implement Date.prototype.toLocaleString in ECMA-402
+        https://bugs.webkit.org/show_bug.cgi?id=147611
+
+        Reviewed by Benjamin Poulain.
+
+        Expose dateProtoFuncGetTime as thisTimeValue for builtins.
+        Remove unused code in DateTimeFormat toDateTimeOptions, and make the
+        function specific to the call in initializeDateTimeFormat. Properly
+        throw when the options parameter is null.
+        Add toLocaleString in builtin JavaScript, with it's own specific branch
+        of toDateTimeOptions.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * builtins/DatePrototype.js: Added.
+        (toLocaleString.toDateTimeOptionsAnyAll):
+        (toLocaleString):
+        * runtime/CommonIdentifiers.h:
+        * runtime/DatePrototype.cpp:
+        (JSC::DatePrototype::finishCreation):
+        * runtime/DatePrototype.h:
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::toDateTimeOptionsAnyDate):
+        (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
+        (JSC::toDateTimeOptions): Deleted.
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+
</ins><span class="cx"> 2016-01-15  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         [mips] Implemented emitFunctionPrologue/Epilogue
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/DerivedSources.make (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/DerivedSources.make        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/DerivedSources.make        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     $(JavaScriptCore)/builtins/ArrayConstructor.js \
</span><span class="cx">     $(JavaScriptCore)/builtins/ArrayIteratorPrototype.js \
</span><span class="cx">     $(JavaScriptCore)/builtins/ArrayPrototype.js \
</span><ins>+    $(JavaScriptCore)/builtins/DatePrototype.js \
</ins><span class="cx">     $(JavaScriptCore)/builtins/FunctionPrototype.js \
</span><span class="cx">     $(JavaScriptCore)/builtins/GeneratorPrototype.js \
</span><span class="cx">     $(JavaScriptCore)/builtins/GlobalObject.js \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -3702,6 +3702,7 @@
</span><span class="cx">                 A1D792FA1B43864B004516F5 /* IntlNumberFormatPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlNumberFormatPrototype.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlNumberFormatPrototype.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1E0451B1C25B4B100BB663C /* StringPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StringPrototype.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A1FE1EB01C2C537E00A289FF /* DatePrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = DatePrototype.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JavaScriptCallFrame.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptCallFrame.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A503FA15188E0FB000110F14 /* JSJavaScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSJavaScriptCallFrame.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6797,6 +6798,7 @@
</span><span class="cx">                                 A7D801A21880D66E0026C39B /* BuiltinExecutables.h */,
</span><span class="cx">                                 A75EE9B018AAB7E200AAD043 /* BuiltinNames.h */,
</span><span class="cx">                                 41DEA1311B9F3154006D65DD /* BuiltinUtils.h */,
</span><ins>+                                A1FE1EB01C2C537E00A289FF /* DatePrototype.js */,
</ins><span class="cx">                                 A7A979C418BE8D9E002C3733 /* FunctionPrototype.js */,
</span><span class="cx">                                 70B7918F1C0244EC002481E2 /* GeneratorPrototype.js */,
</span><span class="cx">                                 7CF9BC5A1B65D9A3009DB1EF /* GlobalObject.js */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsDatePrototypejs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/builtins/DatePrototype.js (0 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/DatePrototype.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/builtins/DatePrototype.js        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+/*
+ * Copyright (C) 2015 Andy VanWagoner &lt;thetalecrafter@gmail.com&gt;.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// @conditional=ENABLE(INTL)
+
+function toLocaleString(/* locales, options */)
+{
+    &quot;use strict&quot;;
+
+    function toDateTimeOptionsAnyAll(opts)
+    {
+        // ToDateTimeOptions abstract operation (ECMA-402 2.0)
+        // http://ecma-international.org/publications/standards/Ecma-402.htm
+
+        // 1. If options is undefined, then let options be null, else let options be ToObject(options).
+        // 2. ReturnIfAbrupt(options).
+        var optObj;
+        if (opts === undefined)
+            optObj = null;
+        else if (opts === null)
+            throw new @TypeError(&quot;null is not an object&quot;);
+        else
+            optObj = @Object(opts);
+
+        // 3. Let options be ObjectCreate(options).
+        var options = @Object.create(optObj);
+
+        // 4. Let needDefaults be true.
+        // 5. If required is &quot;date&quot; or &quot;any&quot;,
+        // a. For each of the property names &quot;weekday&quot;, &quot;year&quot;, &quot;month&quot;, &quot;day&quot;:
+        // i. Let prop be the property name.
+        // ii. Let value be Get(options, prop).
+        // iii. ReturnIfAbrupt(value).
+        // iv. If value is not undefined, then let needDefaults be false.
+        // 6. If required is &quot;time&quot; or &quot;any&quot;,
+        // a. For each of the property names &quot;hour&quot;, &quot;minute&quot;, &quot;second&quot;:
+        // i. Let prop be the property name.
+        // ii. Let value be Get(options, prop).
+        // iii. ReturnIfAbrupt(value).
+        // iv. If value is not undefined, then let needDefaults be false.
+        // Check optObj instead of options to reduce lookups up the prototype chain.
+        var needsDefaults = !optObj || (
+            optObj.weekday === undefined &amp;&amp;
+            optObj.year === undefined &amp;&amp;
+            optObj.month === undefined &amp;&amp;
+            optObj.day === undefined &amp;&amp;
+            optObj.hour === undefined &amp;&amp;
+            optObj.minute === undefined &amp;&amp;
+            optObj.second === undefined
+        );
+
+        // 7. If needDefaults is true and defaults is either &quot;date&quot; or &quot;all&quot;, then a. For each of the property names &quot;year&quot;, &quot;month&quot;, &quot;day&quot;:
+        // i. Let status be CreateDatePropertyOrThrow(options, prop, &quot;numeric&quot;).
+        // ii. ReturnIfAbrupt(status).
+        // 8. If needDefaults is true and defaults is either &quot;time&quot; or &quot;all&quot;, then
+        // a. For each of the property names &quot;hour&quot;, &quot;minute&quot;, &quot;second&quot;:
+        // i. Let status be CreateDatePropertyOrThrow(options, prop, &quot;numeric&quot;).
+        // ii. ReturnIfAbrupt(status).
+        if (needsDefaults) {
+            options.year = &quot;numeric&quot;;
+            options.month = &quot;numeric&quot;;
+            options.day = &quot;numeric&quot;;
+            options.hour = &quot;numeric&quot;;
+            options.minute = &quot;numeric&quot;;
+            options.second = &quot;numeric&quot;;
+        }
+
+        // 9. Return options.
+        return options;
+    }
+
+    // 13.3.1 Date.prototype.toLocaleString ([locales [, options ]]) (ECMA-402 2.0)
+    // http://ecma-international.org/publications/standards/Ecma-402.htm
+
+    // 1. Let x be thisTimeValue(this value).
+    // 2. ReturnIfAbrupt(x).
+    var value = @thisTimeValue.@call(this);
+
+    // 3. If x is NaN, return &quot;Invalid Date&quot;.
+    if (@isNaN(value))
+        return &quot;Invalid Date&quot;;
+
+    // 4. Let options be ToDateTimeOptions(options, &quot;any&quot;, &quot;all&quot;).
+    // 5. ReturnIfAbrupt(options).
+    var options = toDateTimeOptionsAnyAll(arguments[1]);
+
+    // 6. Let dateFormat be Construct(%DateTimeFormat%, «locales, options»).
+    // 7. ReturnIfAbrupt(dateFormat).
+    var locales = arguments[0];
+    var dateFormat = new @DateTimeFormat(locales, options);
+
+    // 8. Return FormatDateTime(dateFormat, x).
+    return dateFormat.format(value);
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -357,6 +357,7 @@
</span><span class="cx">     macro(Collator) \
</span><span class="cx">     macro(DateTimeFormat) \
</span><span class="cx">     macro(NumberFormat) \
</span><ins>+    macro(thisTimeValue) \
</ins><span class="cx">     macro(newTargetLocal) \
</span><span class="cx">     macro(derivedConstructor) \
</span><span class="cx">     macro(isBoundFunction) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDatePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -27,8 +27,10 @@
</span><span class="cx"> #include &quot;DateConversion.h&quot;
</span><span class="cx"> #include &quot;DateInstance.h&quot;
</span><span class="cx"> #include &quot;Error.h&quot;
</span><ins>+#include &quot;JSCBuiltins.h&quot;
</ins><span class="cx"> #include &quot;JSDateMath.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><ins>+#include &quot;JSObject.h&quot;
</ins><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;Lookup.h&quot;
</span><span class="cx"> #include &quot;ObjectPrototype.h&quot;
</span><span class="lines">@@ -78,7 +80,6 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState*);
</span><del>-EncodedJSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState*);
</del><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState*);
</span><span class="lines">@@ -485,11 +486,17 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DatePrototype::finishCreation(VM&amp; vm, JSGlobalObject*)
</del><ins>+void DatePrototype::finishCreation(VM&amp; vm, JSGlobalObject* globalObject)
</ins><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx"> 
</span><ins>+#if ENABLE(INTL)
+    JSC_BUILTIN_FUNCTION(&quot;toLocaleString&quot;, datePrototypeToLocaleStringCodeGenerator, DontEnum);
+#else
+    UNUSED_PARAM(globalObject);
+#endif // ENABLE(INTL)
+
</ins><span class="cx">     // The constructor will be added later, after DateConstructor has been built.
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDatePrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DatePrototype.h (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DatePrototype.h        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/runtime/DatePrototype.h        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx">     void finishCreation(VM&amp;, JSGlobalObject*);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState*);
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // DatePrototype_h
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -51,9 +51,6 @@
</span><span class="cx"> static const size_t indexOfExtensionKeyCa = 0;
</span><span class="cx"> static const size_t indexOfExtensionKeyNu = 1;
</span><span class="cx"> 
</span><del>-enum class DateTimeOptionRequired { Date, Time, Any };
-enum class DateTimeOptionDefaults { Date, Time, All };
-
</del><span class="cx"> IntlDateTimeFormat* IntlDateTimeFormat::create(VM&amp; vm, IntlDateTimeFormatConstructor* constructor)
</span><span class="cx"> {
</span><span class="cx">     IntlDateTimeFormat* format = new (NotNull, allocateCell&lt;IntlDateTimeFormat&gt;(vm.heap)) IntlDateTimeFormat(vm, constructor-&gt;dateTimeFormatStructure());
</span><span class="lines">@@ -221,7 +218,7 @@
</span><span class="cx">     return keyLocaleData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSObject* toDateTimeOptions(ExecState&amp; exec, JSValue originalOptions, const DateTimeOptionRequired required, const DateTimeOptionDefaults defaults)
</del><ins>+static JSObject* toDateTimeOptionsAnyDate(ExecState&amp; exec, JSValue originalOptions)
</ins><span class="cx"> {
</span><span class="cx">     // 12.1.1 ToDateTimeOptions abstract operation (ECMA-402 2.0)
</span><span class="cx">     VM&amp; vm = exec.vm();
</span><span class="lines">@@ -230,7 +227,7 @@
</span><span class="cx">     // 2. ReturnIfAbrupt(options).
</span><span class="cx">     // 3. Let options be ObjectCreate(options).
</span><span class="cx">     JSObject* options;
</span><del>-    if (originalOptions.isUndefinedOrNull())
</del><ins>+    if (originalOptions.isUndefined())
</ins><span class="cx">         options = constructEmptyObject(&amp;exec, exec.lexicalGlobalObject()-&gt;nullPrototypeObjectStructure());
</span><span class="cx">     else {
</span><span class="cx">         JSObject* originalToObject = originalOptions.toObject(&amp;exec);
</span><span class="lines">@@ -243,99 +240,85 @@
</span><span class="cx">     bool needDefaults = true;
</span><span class="cx"> 
</span><span class="cx">     // 5. If required is &quot;date&quot; or &quot;any&quot;,
</span><del>-    if (required == DateTimeOptionRequired::Date || required == DateTimeOptionRequired::Any) {
-        // a. For each of the property names &quot;weekday&quot;, &quot;year&quot;, &quot;month&quot;, &quot;day&quot;:
-        // i. Let prop be the property name.
-        // ii. Let value be Get(options, prop).
-        // iii. ReturnIfAbrupt(value).
-        // iv. If value is not undefined, then let needDefaults be false.
-        JSValue weekday = options-&gt;get(&amp;exec, vm.propertyNames-&gt;weekday);
-        if (exec.hadException())
-            return nullptr;
-        if (!weekday.isUndefined())
-            needDefaults = false;
</del><ins>+    // Always &quot;any&quot;.
</ins><span class="cx"> 
</span><del>-        JSValue year = options-&gt;get(&amp;exec, vm.propertyNames-&gt;year);
-        if (exec.hadException())
-            return nullptr;
-        if (!year.isUndefined())
-            needDefaults = false;
</del><ins>+    // a. For each of the property names &quot;weekday&quot;, &quot;year&quot;, &quot;month&quot;, &quot;day&quot;:
+    // i. Let prop be the property name.
+    // ii. Let value be Get(options, prop).
+    // iii. ReturnIfAbrupt(value).
+    // iv. If value is not undefined, then let needDefaults be false.
+    JSValue weekday = options-&gt;get(&amp;exec, vm.propertyNames-&gt;weekday);
+    if (exec.hadException())
+        return nullptr;
+    if (!weekday.isUndefined())
+        needDefaults = false;
</ins><span class="cx"> 
</span><del>-        JSValue month = options-&gt;get(&amp;exec, vm.propertyNames-&gt;month);
-        if (exec.hadException())
-            return nullptr;
-        if (!month.isUndefined())
-            needDefaults = false;
</del><ins>+    JSValue year = options-&gt;get(&amp;exec, vm.propertyNames-&gt;year);
+    if (exec.hadException())
+        return nullptr;
+    if (!year.isUndefined())
+        needDefaults = false;
</ins><span class="cx"> 
</span><del>-        JSValue day = options-&gt;get(&amp;exec, vm.propertyNames-&gt;day);
-        if (exec.hadException())
-            return nullptr;
-        if (!day.isUndefined())
-            needDefaults = false;
-    }
</del><ins>+    JSValue month = options-&gt;get(&amp;exec, vm.propertyNames-&gt;month);
+    if (exec.hadException())
+        return nullptr;
+    if (!month.isUndefined())
+        needDefaults = false;
</ins><span class="cx"> 
</span><ins>+    JSValue day = options-&gt;get(&amp;exec, vm.propertyNames-&gt;day);
+    if (exec.hadException())
+        return nullptr;
+    if (!day.isUndefined())
+        needDefaults = false;
+
</ins><span class="cx">     // 6. If required is &quot;time&quot; or &quot;any&quot;,
</span><del>-    if (required == DateTimeOptionRequired::Time || required == DateTimeOptionRequired::Any) {
-        // a. For each of the property names &quot;hour&quot;, &quot;minute&quot;, &quot;second&quot;:
-        // i. Let prop be the property name.
-        // ii. Let value be Get(options, prop).
-        // iii. ReturnIfAbrupt(value).
-        // iv. If value is not undefined, then let needDefaults be false.
-        JSValue hour = options-&gt;get(&amp;exec, vm.propertyNames-&gt;hour);
-        if (exec.hadException())
-            return nullptr;
-        if (!hour.isUndefined())
-            needDefaults = false;
</del><ins>+    // Always &quot;any&quot;.
</ins><span class="cx"> 
</span><del>-        JSValue minute = options-&gt;get(&amp;exec, vm.propertyNames-&gt;minute);
-        if (exec.hadException())
-            return nullptr;
-        if (!minute.isUndefined())
-            needDefaults = false;
</del><ins>+    // a. For each of the property names &quot;hour&quot;, &quot;minute&quot;, &quot;second&quot;:
+    // i. Let prop be the property name.
+    // ii. Let value be Get(options, prop).
+    // iii. ReturnIfAbrupt(value).
+    // iv. If value is not undefined, then let needDefaults be false.
+    JSValue hour = options-&gt;get(&amp;exec, vm.propertyNames-&gt;hour);
+    if (exec.hadException())
+        return nullptr;
+    if (!hour.isUndefined())
+        needDefaults = false;
</ins><span class="cx"> 
</span><del>-        JSValue second = options-&gt;get(&amp;exec, vm.propertyNames-&gt;second);
-        if (exec.hadException())
-            return nullptr;
-        if (!second.isUndefined())
-            needDefaults = false;
-    }
</del><ins>+    JSValue minute = options-&gt;get(&amp;exec, vm.propertyNames-&gt;minute);
+    if (exec.hadException())
+        return nullptr;
+    if (!minute.isUndefined())
+        needDefaults = false;
</ins><span class="cx"> 
</span><ins>+    JSValue second = options-&gt;get(&amp;exec, vm.propertyNames-&gt;second);
+    if (exec.hadException())
+        return nullptr;
+    if (!second.isUndefined())
+        needDefaults = false;
+
</ins><span class="cx">     // 7. If needDefaults is true and defaults is either &quot;date&quot; or &quot;all&quot;, then
</span><del>-    if (needDefaults &amp;&amp; (defaults == DateTimeOptionDefaults::Date || defaults == DateTimeOptionDefaults::All)) {
</del><ins>+    // Defaults is always &quot;date&quot;.
+    if (needDefaults) {
</ins><span class="cx">         // a. For each of the property names &quot;year&quot;, &quot;month&quot;, &quot;day&quot;:
</span><span class="cx">         // i. Let status be CreateDatePropertyOrThrow(options, prop, &quot;numeric&quot;).
</span><span class="cx">         // ii. ReturnIfAbrupt(status).
</span><del>-        options-&gt;putDirect(vm, vm.propertyNames-&gt;year, jsString(&amp;exec, &quot;numeric&quot;));
</del><ins>+        options-&gt;putDirect(vm, vm.propertyNames-&gt;year, jsNontrivialString(&amp;exec, ASCIILiteral(&quot;numeric&quot;)));
</ins><span class="cx">         if (exec.hadException())
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><del>-        options-&gt;putDirect(vm, vm.propertyNames-&gt;month, jsString(&amp;exec, &quot;numeric&quot;));
</del><ins>+        options-&gt;putDirect(vm, vm.propertyNames-&gt;month, jsNontrivialString(&amp;exec, ASCIILiteral(&quot;numeric&quot;)));
</ins><span class="cx">         if (exec.hadException())
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><del>-        options-&gt;putDirect(vm, vm.propertyNames-&gt;day, jsString(&amp;exec, &quot;numeric&quot;));
</del><ins>+        options-&gt;putDirect(vm, vm.propertyNames-&gt;day, jsNontrivialString(&amp;exec, ASCIILiteral(&quot;numeric&quot;)));
</ins><span class="cx">         if (exec.hadException())
</span><span class="cx">             return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 8. If needDefaults is true and defaults is either &quot;time&quot; or &quot;all&quot;, then
</span><del>-    if (needDefaults &amp;&amp; (defaults == DateTimeOptionDefaults::Time || defaults == DateTimeOptionDefaults::All)) {
-        // a. For each of the property names &quot;hour&quot;, &quot;minute&quot;, &quot;second&quot;:
-        // i. Let status be CreateDatePropertyOrThrow(options, prop, &quot;numeric&quot;).
-        // ii. ReturnIfAbrupt(status).
-        options-&gt;putDirect(vm, vm.propertyNames-&gt;hour, jsString(&amp;exec, &quot;numeric&quot;));
-        if (exec.hadException())
-            return nullptr;
</del><ins>+    // Defaults is always &quot;date&quot;. Ignore this branch.
</ins><span class="cx"> 
</span><del>-        options-&gt;putDirect(vm, vm.propertyNames-&gt;minute, jsString(&amp;exec, &quot;numeric&quot;));
-        if (exec.hadException())
-            return nullptr;
-
-        options-&gt;putDirect(vm, vm.propertyNames-&gt;second, jsString(&amp;exec, &quot;numeric&quot;));
-        if (exec.hadException())
-            return nullptr;
-    }
-
</del><span class="cx">     // 9. Return options.
</span><span class="cx">     return options;
</span><span class="cx"> }
</span><span class="lines">@@ -451,7 +434,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 5. Let options be ToDateTimeOptions(options, &quot;any&quot;, &quot;date&quot;).
</span><del>-    JSObject* options = toDateTimeOptions(exec, originalOptions, DateTimeOptionRequired::Any, DateTimeOptionDefaults::Date);
</del><ins>+    JSObject* options = toDateTimeOptionsAnyDate(exec, originalOptions);
</ins><span class="cx">     // 6. ReturnIfAbrupt(options).
</span><span class="cx">     if (exec.hadException())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (195137 => 195138)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-01-15 18:59:50 UTC (rev 195137)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-01-15 19:30:45 UTC (rev 195138)
</span><span class="lines">@@ -519,6 +519,7 @@
</span><span class="cx">     JSFunction* privateFuncIsBoundFunction = JSFunction::create(vm, this, 0, String(), isBoundFunction);
</span><span class="cx">     JSFunction* privateFuncHasInstanceBoundFunction = JSFunction::create(vm, this, 0, String(), hasInstanceBoundFunction);
</span><span class="cx">     JSFunction* privateFuncInstanceOf = JSFunction::create(vm, this, 0, String(), objectPrivateFuncInstanceOf);
</span><ins>+    JSFunction* privateFuncThisTimeValue = JSFunction::create(vm, this, 0, String(), dateProtoFuncGetTime);
</ins><span class="cx"> 
</span><span class="cx">     GlobalPropertyInfo staticGlobals[] = {
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;NaN, jsNaN(), DontEnum | DontDelete | ReadOnly),
</span><span class="lines">@@ -577,6 +578,7 @@
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().InspectorInstrumentationPrivateName(), InspectorInstrumentationObject::create(vm, this, InspectorInstrumentationObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;MapPrivateName, mapConstructor, DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().generatorResumePrivateName(), JSFunction::createBuiltinFunction(vm, generatorPrototypeGeneratorResumeCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</span><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().thisTimeValuePrivateName(), privateFuncThisTimeValue, DontEnum | DontDelete | ReadOnly),
</ins><span class="cx"> #if ENABLE(INTL)
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().CollatorPrivateName(), intl-&gt;getDirect(vm, vm.propertyNames-&gt;Collator), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().DateTimeFormatPrivateName(), intl-&gt;getDirect(vm, vm.propertyNames-&gt;DateTimeFormat), DontEnum | DontDelete | ReadOnly),
</span></span></pre>
</div>
</div>

</body>
</html>