<!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>[212378] 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/212378">212378</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-02-15 10:23:33 -0800 (Wed, 15 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Expose Symbol.toPrimitive / valueOf on Location instances
https://bugs.webkit.org/show_bug.cgi?id=168295
Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
LayoutTests/imported/w3c:
Import test coverage from upstream web-platform-tests.
* web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt: Added.
* web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html: Added.
* web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log:
Source/JavaScriptCore:
Cache origin objectProtoValueOf function on JSGlobalObject.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::objectProtoValueOfFunction):
Source/WebCore:
Expose Symbol.toPrimitive / valueOf on Location instances as per:
- https://html.spec.whatwg.org/#the-location-interface
Firefox and Chrome already comply with the specification.
Tests: fast/dom/location-valueOf-after-object-prototype-update.html
fast/dom/location-valueOf-after-object-prototype-update2.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
LayoutTests:
Add test coverage for cases where the Object prototype has been updated before
the Location object is constructed.
* fast/dom/location-valueOf-after-object-prototype-update-expected.txt: Added.
* fast/dom/location-valueOf-after-object-prototype-update.html: Added.
* fast/dom/location-valueOf-after-object-prototype-update2-expected.txt: Added.
* fast/dom/location-valueOf-after-object-prototype-update2.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacew3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdateexpectedtxt">trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdatehtml">trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update.html</a></li>
<li><a href="#trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdate2expectedtxt">trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdate2html">trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationsymboltoprimitiveexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationsymboltoprimitivehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationvalueofexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationvalueofhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/LayoutTests/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-02-15 Chris Dumez <cdumez@apple.com>
+
+ Expose Symbol.toPrimitive / valueOf on Location instances
+ https://bugs.webkit.org/show_bug.cgi?id=168295
+
+ Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
+
+ Add test coverage for cases where the Object prototype has been updated before
+ the Location object is constructed.
+
+ * fast/dom/location-valueOf-after-object-prototype-update-expected.txt: Added.
+ * fast/dom/location-valueOf-after-object-prototype-update.html: Added.
+ * fast/dom/location-valueOf-after-object-prototype-update2-expected.txt: Added.
+ * fast/dom/location-valueOf-after-object-prototype-update2.html: Added.
+
</ins><span class="cx"> 2017-02-15 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Mark media/modern-media-controls/media-controller/media-controller-resize.html as flaky.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update-expected.txt (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update-expected.txt        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Tests the value of location.valueOf after Object.prototype.valueOf has been deleted.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS location.valueOf is objectProtoValueOf
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update.html (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update.html        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Tests the value of location.valueOf after Object.prototype.valueOf has been deleted.");
+
+var objectProtoValueOf = Object.prototype.valueOf;
+delete Object.prototype.valueOf;
+shouldBe("location.valueOf", "objectProtoValueOf");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdate2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2-expected.txt (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2-expected.txt        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Tests the value of location.valueOf after Object.prototype.valueOf has been replaced.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS location.valueOf is objectProtoValueOf
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomlocationvalueOfafterobjectprototypeupdate2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2.html (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/location-valueOf-after-object-prototype-update2.html        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Tests the value of location.valueOf after Object.prototype.valueOf has been replaced.");
+
+var objectProtoValueOf = Object.prototype.valueOf;
+delete Object.prototype.valueOf;
+Object.defineProperty(Object.prototype, "valueOf", {value: 3});
+shouldBe("location.valueOf", "objectProtoValueOf");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-02-15 Chris Dumez <cdumez@apple.com>
+
+ Expose Symbol.toPrimitive / valueOf on Location instances
+ https://bugs.webkit.org/show_bug.cgi?id=168295
+
+ Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
+
+ Import test coverage from upstream web-platform-tests.
+
+ * web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt: Added.
+ * web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html: Added.
+ * web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt: Added.
+ * web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html: Added.
+ * web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log:
+
</ins><span class="cx"> 2017-02-15 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationsymboltoprimitiveexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive-expected.txt        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Location Symbol.toPrimitive
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationsymboltoprimitivehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<title>Location Symbol.toPrimitive</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(() => {
+ assert_equals(location[Symbol.toPrimitive], undefined)
+ const prop = Object.getOwnPropertyDescriptor(location, Symbol.toPrimitive)
+ assert_false(prop.enumerable)
+ assert_false(prop.writable)
+ assert_false(prop.configurable)
+})
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationvalueofexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof-expected.txt        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Location valueOf
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacelocationvalueofhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html (0 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+<!DOCTYPE html>
+<title>Location valueOf</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(() => {
+ assert_equals(location.valueOf, Object.prototype.valueOf)
+ assert_equals(typeof location.valueOf.call(5), "object")
+ const prop = Object.getOwnPropertyDescriptor(location, "valueOf")
+ assert_false(prop.enumerable)
+ assert_false(prop.writable)
+ assert_false(prop.configurable)
+})
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlbrowsershistorythelocationinterfacew3cimportlog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-setting.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-stringifier.html
</span><ins>+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
+/LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
</ins><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_assign_about_blank.html
</span><span class="cx"> /LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_hash.html
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/Source/JavaScriptCore/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-02-15 Chris Dumez <cdumez@apple.com>
+
+ Expose Symbol.toPrimitive / valueOf on Location instances
+ https://bugs.webkit.org/show_bug.cgi?id=168295
+
+ Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
+
+ Cache origin objectProtoValueOf function on JSGlobalObject.
+
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::init):
+ * runtime/JSGlobalObject.h:
+ (JSC::JSGlobalObject::objectProtoValueOfFunction):
+
</ins><span class="cx"> 2017-02-15 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> [JSC] Drop PassRefPtr
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -458,6 +458,7 @@
</span><span class="cx"> m_objectPrototype->putDirectNonIndexAccessor(vm, vm.propertyNames->underscoreProto, protoAccessor, Accessor | DontEnum);
</span><span class="cx"> m_functionPrototype->structure()->setPrototypeWithoutTransition(vm, m_objectPrototype.get());
</span><span class="cx"> m_objectStructureForObjectConstructor.set(vm, this, vm.prototypeMap.emptyObjectStructureForPrototype(this, m_objectPrototype.get(), JSFinalObject::defaultInlineCapacity()));
</span><ins>+ m_objectProtoValueOfFunction.set(vm, this, jsCast<JSFunction*>(objectPrototype()->getDirect(vm, vm.propertyNames->valueOf)));
</ins><span class="cx">
</span><span class="cx"> JSFunction* thrower = JSFunction::create(vm, this, 0, String(), globalFuncThrowTypeErrorArgumentsCalleeAndCaller);
</span><span class="cx"> GetterSetter* getterSetter = GetterSetter::create(vm, this);
</span><span class="lines">@@ -1193,6 +1194,7 @@
</span><span class="cx"> thisObject->m_arrayProtoValuesFunction.visit(visitor);
</span><span class="cx"> thisObject->m_initializePromiseFunction.visit(visitor);
</span><span class="cx"> thisObject->m_iteratorProtocolFunction.visit(visitor);
</span><ins>+ visitor.append(thisObject->m_objectProtoValueOfFunction);
</ins><span class="cx"> visitor.append(thisObject->m_newPromiseCapabilityFunction);
</span><span class="cx"> visitor.append(thisObject->m_functionProtoHasInstanceSymbolFunction);
</span><span class="cx"> thisObject->m_throwTypeErrorGetterSetter.visit(visitor);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -261,6 +261,7 @@
</span><span class="cx"> LazyProperty<JSGlobalObject, JSFunction> m_arrayProtoValuesFunction;
</span><span class="cx"> LazyProperty<JSGlobalObject, JSFunction> m_initializePromiseFunction;
</span><span class="cx"> LazyProperty<JSGlobalObject, JSFunction> m_iteratorProtocolFunction;
</span><ins>+ WriteBarrier<JSFunction> m_objectProtoValueOfFunction;
</ins><span class="cx"> WriteBarrier<JSFunction> m_newPromiseCapabilityFunction;
</span><span class="cx"> WriteBarrier<JSFunction> m_functionProtoHasInstanceSymbolFunction;
</span><span class="cx"> LazyProperty<JSGlobalObject, GetterSetter> m_throwTypeErrorGetterSetter;
</span><span class="lines">@@ -508,6 +509,7 @@
</span><span class="cx"> JSFunction* arrayProtoValuesFunction() const { return m_arrayProtoValuesFunction.get(this); }
</span><span class="cx"> JSFunction* initializePromiseFunction() const { return m_initializePromiseFunction.get(this); }
</span><span class="cx"> JSFunction* iteratorProtocolFunction() const { return m_iteratorProtocolFunction.get(this); }
</span><ins>+ JSFunction* objectProtoValueOfFunction() const { return m_objectProtoValueOfFunction.get(); }
</ins><span class="cx"> JSFunction* newPromiseCapabilityFunction() const { return m_newPromiseCapabilityFunction.get(); }
</span><span class="cx"> JSFunction* functionProtoHasInstanceSymbolFunction() const { return m_functionProtoHasInstanceSymbolFunction.get(); }
</span><span class="cx"> JSObject* regExpProtoExecFunction() const { return m_regExpProtoExec.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/Source/WebCore/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-02-15 Chris Dumez <cdumez@apple.com>
+
+ Expose Symbol.toPrimitive / valueOf on Location instances
+ https://bugs.webkit.org/show_bug.cgi?id=168295
+
+ Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
+
+ Expose Symbol.toPrimitive / valueOf on Location instances as per:
+ - https://html.spec.whatwg.org/#the-location-interface
+
+ Firefox and Chrome already comply with the specification.
+
+ Tests: fast/dom/location-valueOf-after-object-prototype-update.html
+ fast/dom/location-valueOf-after-object-prototype-update2.html
+ imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
+ imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+
</ins><span class="cx"> 2017-02-15 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove WebIOSEvent interface
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (212377 => 212378)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-02-15 18:22:13 UTC (rev 212377)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2017-02-15 18:23:33 UTC (rev 212378)
</span><span class="lines">@@ -3429,6 +3429,11 @@
</span><span class="cx"> push(@implContent, " ASSERT(inherits(vm, info()));\n\n");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if ($interfaceName eq "Location") {
+ push(@implContent, " putDirect(vm, vm.propertyNames->valueOf, globalObject()->objectProtoValueOfFunction(), DontDelete | ReadOnly | DontEnum);\n");
+ push(@implContent, " putDirect(vm, vm.propertyNames->toPrimitiveSymbol, jsUndefined(), DontDelete | ReadOnly | DontEnum);\n");
+ }
+
</ins><span class="cx"> # Support for RuntimeEnabled attributes on instances.
</span><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="cx"> next unless NeedsRuntimeCheck($attribute);
</span></span></pre>
</div>
</div>
</body>
</html>