<!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>[191815] 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/191815">191815</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2015-10-30 14:37:25 -0700 (Fri, 30 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ES6] Add support for toStringTag
https://bugs.webkit.org/show_bug.cgi?id=150696

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch adds support for Symbol.toStringTag. This is a simple
feature, if an object passed to Object.prototype.toString() has a
toStringTag we use the tag in the string rather than the class info.
Added a test that checks this works for all the default supported classes
along with the corresponding prototype and custom cases.

* runtime/ArrayIteratorPrototype.cpp:
(JSC::ArrayIteratorPrototype::finishCreation):
* runtime/CommonIdentifiers.h:
* runtime/JSArrayBufferPrototype.cpp:
(JSC::JSArrayBufferPrototype::finishCreation):
* runtime/JSDataViewPrototype.cpp:
(JSC::JSDataViewPrototype::finishCreation):
* runtime/JSDataViewPrototype.h:
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
* runtime/JSONObject.cpp:
(JSC::JSONObject::finishCreation):
* runtime/JSPromisePrototype.cpp:
(JSC::JSPromisePrototype::finishCreation):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewProtoGetterFuncToStringTag):
(JSC::JSTypedArrayViewPrototype::finishCreation):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* runtime/SmallStrings.cpp:
(JSC::SmallStrings::SmallStrings):
(JSC::SmallStrings::initializeCommonStrings):
(JSC::SmallStrings::visitStrongReferences):
* runtime/SmallStrings.h:
(JSC::SmallStrings::objectStringStart):
* runtime/StringIteratorPrototype.cpp:
(JSC::StringIteratorPrototype::finishCreation):
* runtime/SymbolPrototype.cpp:
(JSC::SymbolPrototype::finishCreation):
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):
* tests/modules/namespace.js:
* tests/stress/symbol-tostringtag.js: Added.
(toStr):
(strName):
(classes.string_appeared_here):

LayoutTests:

Symbol now has toStringTag as a member. Since Object.prototype.toString()
now does a [[Get]] on the object being stringed there are new console
error messages when accessing another window's properties.

* http/tests/history/cross-origin-replace-history-object-child-expected.txt:
* http/tests/security/cross-frame-access-custom-expected.txt:
* http/tests/security/cross-frame-access-history-get-expected.txt:
* http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestshistorycrossoriginreplacehistoryobjectchildexpectedtxt">trunk/LayoutTests/http/tests/history/cross-origin-replace-history-object-child-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccesscustomexpectedtxt">trunk/LayoutTests/http/tests/security/cross-frame-access-custom-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccesshistorygetexpectedtxt">trunk/LayoutTests/http/tests/security/cross-frame-access-history-get-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccessobjectsetPrototypeOfexpectedtxt">trunk/LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt</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="#trunkSourceJavaScriptCoreruntimeArrayIteratorPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayIteratorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSDataViewPrototypeh">trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp">trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSONObjectcpp">trunk/Source/JavaScriptCore/runtime/JSONObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPromisePrototypecpp">trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapIteratorPrototypecpp">trunk/Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapPrototypecpp">trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMathObjectcpp">trunk/Source/JavaScriptCore/runtime/MathObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectPrototypecpp">trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSetIteratorPrototypecpp">trunk/Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSetPrototypecpp">trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSmallStringscpp">trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSmallStringsh">trunk/Source/JavaScriptCore/runtime/SmallStrings.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringIteratorPrototypecpp">trunk/Source/JavaScriptCore/runtime/StringIteratorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolPrototypecpp">trunk/Source/JavaScriptCore/runtime/SymbolPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakMapPrototypecpp">trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakSetPrototypecpp">trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsmodulesnamespacejs">trunk/Source/JavaScriptCore/tests/modules/namespace.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoretestsstresssymboltostringtagjs">trunk/Source/JavaScriptCore/tests/stress/symbol-tostringtag.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/ChangeLog        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-10-30  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        [ES6] Add support for toStringTag
+        https://bugs.webkit.org/show_bug.cgi?id=150696
+
+        Reviewed by Geoffrey Garen.
+
+        Symbol now has toStringTag as a member. Since Object.prototype.toString()
+        now does a [[Get]] on the object being stringed there are new console
+        error messages when accessing another window's properties.
+
+        * http/tests/history/cross-origin-replace-history-object-child-expected.txt:
+        * http/tests/security/cross-frame-access-custom-expected.txt:
+        * http/tests/security/cross-frame-access-history-get-expected.txt:
+        * http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt:
+        * js/Object-getOwnPropertyNames-expected.txt:
+        * js/script-tests/Object-getOwnPropertyNames.js:
+
</ins><span class="cx"> 2015-10-30  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http/tests/notifications/legacy/events.html flakily asserts on mac-wk2, updating expectations
</span></span></pre></div>
<a id="trunkLayoutTestshttptestshistorycrossoriginreplacehistoryobjectchildexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/history/cross-origin-replace-history-object-child-expected.txt (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/history/cross-origin-replace-history-object-child-expected.txt        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/http/tests/history/cross-origin-replace-history-object-child-expected.txt        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -1,7 +1,9 @@
</span><span class="cx"> CONSOLE MESSAGE: line 30: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 24: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> ALERT: Child window's history object before attempt to clear: [object History]
</span><span class="cx"> ALERT: About to shadow child window's history object: [object History]
</span><span class="cx"> ALERT: Shadowed child window's history object: 
</span><span class="cx"> CONSOLE MESSAGE: line 18: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 18: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> ALERT: Child window's history object after attempt to clear: [object History]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccesscustomexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-custom-expected.txt (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-custom-expected.txt        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-custom-expected.txt        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -16,6 +16,7 @@
</span><span class="cx"> CONSOLE MESSAGE: line 81: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 82: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 81: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 107: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> ----- tests for getting/setting interesting properties -----
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccesshistorygetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-history-get-expected.txt (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-history-get-expected.txt        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-history-get-expected.txt        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> CONSOLE MESSAGE: line 55: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 107: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> CONSOLE MESSAGE: line 55: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 55: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 55: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccessobjectsetPrototypeOfexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -1,7 +1,9 @@
</span><span class="cx"> CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 23: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 25: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 24: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 25: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> This tests that you can't set the prototype of the window or history objects cross-origin using Object.setPrototypeOf().
</span><span class="cx"> 
</span><span class="cx"> PASS: targetWindow instanceof Array should be 'false' and is.
</span></span></pre></div>
<a id="trunkLayoutTestsjsObjectgetOwnPropertyNamesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> PASS getSortedOwnPropertyNames(Error.prototype) is ['constructor', 'message', 'name', 'toString']
</span><span class="cx"> PASS getSortedOwnPropertyNames(Math) is ['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']
</span><span class="cx"> PASS getSortedOwnPropertyNames(JSON) is ['parse', 'stringify']
</span><del>-PASS getSortedOwnPropertyNames(Symbol) is ['for', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'unscopables']
</del><ins>+PASS getSortedOwnPropertyNames(Symbol) is ['for', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'toStringTag', 'unscopables']
</ins><span class="cx"> PASS getSortedOwnPropertyNames(Symbol.prototype) is ['constructor', 'toString', 'valueOf']
</span><span class="cx"> PASS globalPropertyNames.indexOf('NaN') != -1 is true
</span><span class="cx"> PASS globalPropertyNames.indexOf('Infinity') != -1 is true
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsObjectgetOwnPropertyNamesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     &quot;Error.prototype&quot;: &quot;['constructor', 'message', 'name', 'toString']&quot;,
</span><span class="cx">     &quot;Math&quot;: &quot;['E','LN10','LN2','LOG10E','LOG2E','PI','SQRT1_2','SQRT2','abs','acos','acosh','asin','asinh','atan','atan2','atanh','cbrt','ceil','clz32','cos','cosh','exp','expm1','floor','fround','hypot','imul','log','log10','log1p','log2','max','min','pow','random','round','sign','sin','sinh','sqrt','tan','tanh','trunc']&quot;,
</span><span class="cx">     &quot;JSON&quot;: &quot;['parse', 'stringify']&quot;,
</span><del>-    &quot;Symbol&quot;: &quot;['for', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'unscopables']&quot;,
</del><ins>+    &quot;Symbol&quot;: &quot;['for', 'iterator', 'keyFor', 'length', 'name', 'prototype', 'toStringTag', 'unscopables']&quot;,
</ins><span class="cx">     &quot;Symbol.prototype&quot;: &quot;['constructor', 'toString', 'valueOf']&quot;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-10-30  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        [ES6] Add support for toStringTag
+        https://bugs.webkit.org/show_bug.cgi?id=150696
+
+        Reviewed by Geoffrey Garen.
+
+        This patch adds support for Symbol.toStringTag. This is a simple
+        feature, if an object passed to Object.prototype.toString() has a
+        toStringTag we use the tag in the string rather than the class info.
+        Added a test that checks this works for all the default supported classes
+        along with the corresponding prototype and custom cases.
+
+        * runtime/ArrayIteratorPrototype.cpp:
+        (JSC::ArrayIteratorPrototype::finishCreation):
+        * runtime/CommonIdentifiers.h:
+        * runtime/JSArrayBufferPrototype.cpp:
+        (JSC::JSArrayBufferPrototype::finishCreation):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::JSDataViewPrototype::finishCreation):
+        * runtime/JSDataViewPrototype.h:
+        * runtime/JSModuleNamespaceObject.cpp:
+        (JSC::JSModuleNamespaceObject::finishCreation):
+        * runtime/JSONObject.cpp:
+        (JSC::JSONObject::finishCreation):
+        * runtime/JSPromisePrototype.cpp:
+        (JSC::JSPromisePrototype::finishCreation):
+        * runtime/JSTypedArrayViewPrototype.cpp:
+        (JSC::typedArrayViewProtoGetterFuncToStringTag):
+        (JSC::JSTypedArrayViewPrototype::finishCreation):
+        * runtime/MapIteratorPrototype.cpp:
+        (JSC::MapIteratorPrototype::finishCreation):
+        * runtime/MapPrototype.cpp:
+        (JSC::MapPrototype::finishCreation):
+        * runtime/MathObject.cpp:
+        (JSC::MathObject::finishCreation):
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncToString):
+        * runtime/SetIteratorPrototype.cpp:
+        (JSC::SetIteratorPrototype::finishCreation):
+        * runtime/SetPrototype.cpp:
+        (JSC::SetPrototype::finishCreation):
+        * runtime/SmallStrings.cpp:
+        (JSC::SmallStrings::SmallStrings):
+        (JSC::SmallStrings::initializeCommonStrings):
+        (JSC::SmallStrings::visitStrongReferences):
+        * runtime/SmallStrings.h:
+        (JSC::SmallStrings::objectStringStart):
+        * runtime/StringIteratorPrototype.cpp:
+        (JSC::StringIteratorPrototype::finishCreation):
+        * runtime/SymbolPrototype.cpp:
+        (JSC::SymbolPrototype::finishCreation):
+        * runtime/WeakMapPrototype.cpp:
+        (JSC::WeakMapPrototype::finishCreation):
+        * runtime/WeakSetPrototype.cpp:
+        (JSC::WeakSetPrototype::finishCreation):
+        * tests/modules/namespace.js:
+        * tests/stress/symbol-tostringtag.js: Added.
+        (toStr):
+        (strName):
+        (classes.string_appeared_here):
+
</ins><span class="cx"> 2015-10-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Do not show JavaScriptCore builtins in inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayIteratorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayIteratorPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayIteratorPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/ArrayIteratorPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Array Iterator&quot;), DontEnum | ReadOnly);
</ins><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -256,12 +256,12 @@
</span><span class="cx">     macro(search) \
</span><span class="cx">     macro(species) \
</span><span class="cx">     macro(split) \
</span><del>-    macro(toPrimitive) \
-    macro(toStringTag)
</del><ins>+    macro(toPrimitive)
</ins><span class="cx"> 
</span><span class="cx"> #define JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(macro) \
</span><span class="cx">     macro(iterator) \
</span><del>-    macro(unscopables)
</del><ins>+    macro(unscopables) \
+    macro(toStringTag)
</ins><span class="cx"> 
</span><span class="cx"> #define JSC_COMMON_BYTECODE_INTRINSICS_EACH_NAME(macro) \
</span><span class="cx">     macro(putByValDirect) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;slice, arrayBufferProtoFuncSlice, DontEnum, 2);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;ArrayBuffer&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSArrayBufferPrototype* JSArrayBufferPrototype::create(VM&amp; vm, JSGlobalObject* globalObject, Structure* structure)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -99,6 +99,12 @@
</span><span class="cx">     return prototype;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JSDataViewPrototype::finishCreation(JSC::VM&amp; vm)
+{
+    Base::finishCreation(vm);
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;DataView&quot;), DontEnum | ReadOnly);
+}
+
</ins><span class="cx"> Structure* JSDataViewPrototype::createStructure(
</span><span class="cx">     VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSDataViewPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.h (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.h        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.h        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx"> protected:
</span><span class="cx">     JSDataViewPrototype(VM&amp;, Structure*);
</span><span class="cx"> 
</span><ins>+    void finishCreation(VM&amp;);
+
</ins><span class="cx"> public:
</span><span class="cx">     static JSDataViewPrototype* create(VM&amp;, Structure*);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_moduleRecord.set(vm, this, moduleRecord);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;iteratorSymbol, moduleNamespaceObjectSymbolIterator, DontEnum, 0);
</span><ins>+    putDirect(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Module&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> 
</span><span class="cx">     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-getprototypeof
</span><span class="cx">     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-setprototypeof-v
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSONObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSONObject.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;JSON&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // PropertyNameForFunctionCall objects must be on the stack, since the JSValue that they create is not marked.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPromisePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> void JSPromisePrototype::finishCreation(VM&amp; vm, Structure*)
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Promise&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSPromisePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -200,6 +200,40 @@
</span><span class="cx">     CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(typedArrayViewProtoFuncValues);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static EncodedJSValue JSC_HOST_CALL typedArrayViewProtoGetterFuncToStringTag(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    if (!thisValue.isObject())
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view but was not an object&quot;));
+
+    VM&amp; vm = exec-&gt;vm();
+    switch (thisValue.getObject()-&gt;classInfo()-&gt;typedArrayStorageType) {
+    case TypeUint8Clamped:
+        return JSValue::encode(jsString(&amp;vm, &quot;Uint8ClampedArray&quot;));
+    case TypeInt32:
+        return JSValue::encode(jsString(&amp;vm, &quot;Int32Array&quot;));
+    case TypeUint32:
+        return JSValue::encode(jsString(&amp;vm, &quot;Uint32Array&quot;));
+    case TypeFloat64:
+        return JSValue::encode(jsString(&amp;vm, &quot;Float64Array&quot;));
+    case TypeFloat32:
+        return JSValue::encode(jsString(&amp;vm, &quot;Float32Array&quot;));
+    case TypeInt8:
+        return JSValue::encode(jsString(&amp;vm, &quot;Int8Array&quot;));
+    case TypeUint8:
+        return JSValue::encode(jsString(&amp;vm, &quot;Uint8Array&quot;));
+    case TypeInt16:
+        return JSValue::encode(jsString(&amp;vm, &quot;Int16Array&quot;));
+    case TypeUint16:
+        return JSValue::encode(jsString(&amp;vm, &quot;Uint16Array&quot;));
+    case NotTypedArray:
+    case TypeDataView:
+        return throwVMError(exec, createTypeError(exec, &quot;Receiver should be a typed array view&quot;));
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
+
</ins><span class="cx"> #undef CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION
</span><span class="cx"> 
</span><span class="cx"> JSTypedArrayViewPrototype::JSTypedArrayViewPrototype(VM&amp; vm, Structure* structure)
</span><span class="lines">@@ -239,6 +273,7 @@
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;subarray, typedArrayViewProtoFuncSubarray, DontEnum, 2);
</span><span class="cx">     JSC_BUILTIN_FUNCTION(vm.propertyNames-&gt;toLocaleString, typedArrayPrototypeToLocaleStringCodeGenerator, DontEnum);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;toString, arrayProtoFuncToString, DontEnum, 0);
</span><ins>+    JSC_NATIVE_GETTER(vm.propertyNames-&gt;toStringTagSymbol, typedArrayViewProtoGetterFuncToStringTag, DontEnum | ReadOnly);
</ins><span class="cx"> 
</span><span class="cx">     JSFunction* valuesFunction = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;values.string(), typedArrayViewProtoFuncValues);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapIteratorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/MapIteratorPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> 
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;next, MapIteratorPrototypeFuncNext, DontEnum, 0);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Map Iterator&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL MapIteratorPrototypeFuncNext(CallFrame* callFrame)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx">     JSFunction* entries = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;entries.string(), mapProtoFuncEntries);
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;entries, entries, DontEnum);
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;iteratorSymbol, entries, DontEnum);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Map&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> 
</span><span class="cx">     GetterSetter* accessor = GetterSetter::create(vm, globalObject);
</span><span class="cx">     JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;size.string(), mapProtoFuncSize);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMathObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MathObject.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx">     putDirectWithoutTransition(vm, Identifier::fromString(&amp;vm, &quot;PI&quot;), jsNumber(piDouble), DontDelete | DontEnum | ReadOnly);
</span><span class="cx">     putDirectWithoutTransition(vm, Identifier::fromString(&amp;vm, &quot;SQRT1_2&quot;), jsNumber(sqrt(0.5)), DontDelete | DontEnum | ReadOnly);
</span><span class="cx">     putDirectWithoutTransition(vm, Identifier::fromString(&amp;vm, &quot;SQRT2&quot;), jsNumber(sqrt(2.0)), DontDelete | DontEnum | ReadOnly);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Math&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> 
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier::fromString(&amp;vm, &quot;abs&quot;), 1, mathProtoFuncAbs, AbsIntrinsic, DontEnum);
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier::fromString(&amp;vm, &quot;acos&quot;), 1, mathProtoFuncACos, NoIntrinsic, DontEnum);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;PropertySlot.h&quot;
</ins><span class="cx"> #include &quot;StructureRareDataInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -243,6 +244,15 @@
</span><span class="cx">         return JSValue::encode(thisValue.isUndefined() ? vm.smallStrings.undefinedObjectString() : vm.smallStrings.nullObjectString());
</span><span class="cx">     JSObject* thisObject = thisValue.toObject(exec);
</span><span class="cx"> 
</span><ins>+    JSValue stringTag = thisObject-&gt;get(exec, exec-&gt;propertyNames().toStringTagSymbol);
+    if (stringTag.isString()) {
+        JSRopeString::RopeBuilder ropeBuilder(vm);
+        ropeBuilder.append(vm.smallStrings.objectStringStart());
+        ropeBuilder.append(jsCast&lt;JSString*&gt;(stringTag));
+        ropeBuilder.append(vm.smallStrings.singleCharacterString(']'));
+        return JSValue::encode(ropeBuilder.release());
+    }
+
</ins><span class="cx">     JSString* result = thisObject-&gt;structure(vm)-&gt;objectToStringValue();
</span><span class="cx">     if (!result) {
</span><span class="cx">         String newString = WTF::tryMakeString(&quot;[object &quot;, thisObject-&gt;methodTable(exec-&gt;vm())-&gt;className(thisObject), &quot;]&quot;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSetIteratorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/SetIteratorPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> 
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;next, SetIteratorPrototypeFuncNext, DontEnum, 0);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Set Iterator&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL SetIteratorPrototypeFuncNext(CallFrame* callFrame)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSetPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;values, values, DontEnum);
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;keys, values, DontEnum);
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;iteratorSymbol, values, DontEnum);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Set&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> 
</span><span class="cx">     GetterSetter* accessor = GetterSetter::create(vm, globalObject);
</span><span class="cx">     JSFunction* function = JSFunction::create(vm, globalObject, 0, vm.propertyNames-&gt;size.string(), setProtoFuncSize);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSmallStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #define JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE(name) , m_##name(0)
</span><span class="cx">     JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE)
</span><span class="cx"> #undef JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE
</span><ins>+    , m_objectStringStart(nullptr)
</ins><span class="cx">     , m_nullObjectString(nullptr)
</span><span class="cx">     , m_undefinedObjectString(nullptr)
</span><span class="cx">     , m_needsToBeVisited(true)
</span><span class="lines">@@ -84,6 +85,7 @@
</span><span class="cx"> #define JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE(name) initialize(&amp;vm, m_##name, #name);
</span><span class="cx">     JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE)
</span><span class="cx"> #undef JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE
</span><ins>+    initialize(&amp;vm, m_objectStringStart, &quot;[object &quot;);
</ins><span class="cx">     initialize(&amp;vm, m_nullObjectString, &quot;[object Null]&quot;);
</span><span class="cx">     initialize(&amp;vm, m_undefinedObjectString, &quot;[object Undefined]&quot;);
</span><span class="cx"> }
</span><span class="lines">@@ -97,6 +99,7 @@
</span><span class="cx"> #define JSC_COMMON_STRINGS_ATTRIBUTE_VISIT(name) visitor.appendUnbarrieredPointer(&amp;m_##name);
</span><span class="cx">     JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_VISIT)
</span><span class="cx"> #undef JSC_COMMON_STRINGS_ATTRIBUTE_VISIT
</span><ins>+    visitor.appendUnbarrieredPointer(&amp;m_objectStringStart);
</ins><span class="cx">     visitor.appendUnbarrieredPointer(&amp;m_nullObjectString);
</span><span class="cx">     visitor.appendUnbarrieredPointer(&amp;m_undefinedObjectString);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSmallStringsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SmallStrings.h (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SmallStrings.h        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/SmallStrings.h        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -109,6 +109,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    JSString* objectStringStart() const { return m_objectStringStart; }
</ins><span class="cx">     JSString* nullObjectString() const { return m_nullObjectString; }
</span><span class="cx">     JSString* undefinedObjectString() const { return m_undefinedObjectString; }
</span><span class="cx"> 
</span><span class="lines">@@ -131,6 +132,7 @@
</span><span class="cx"> #define JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION(name) JSString* m_##name;
</span><span class="cx">     JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION)
</span><span class="cx"> #undef JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION
</span><ins>+    JSString* m_objectStringStart;
</ins><span class="cx">     JSString* m_nullObjectString;
</span><span class="cx">     JSString* m_undefinedObjectString;
</span><span class="cx">     JSString* m_singleCharacterStrings[singleCharacterStringCount];
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringIteratorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringIteratorPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringIteratorPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/StringIteratorPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;String Iterator&quot;), DontEnum | ReadOnly);
</ins><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/SymbolPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;JSString.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -58,6 +59,7 @@
</span><span class="cx"> void SymbolPrototype::finishCreation(VM&amp; vm)
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><ins>+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;Symbol&quot;), DontEnum | ReadOnly);
</ins><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakMapPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;get, protoFuncWeakMapGet, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;has, protoFuncWeakMapHas, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;set, protoFuncWeakMapSet, DontEnum, 2);
</span><ins>+
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;WeakMap&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static WeakMapData* getWeakMapData(CallFrame* callFrame, JSValue value)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakSetPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;deleteKeyword, protoFuncWeakSetDelete, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;has, protoFuncWeakSetHas, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(vm.propertyNames-&gt;add, protoFuncWeakSetAdd, DontEnum, 1);
</span><ins>+
+    putDirectWithoutTransition(vm, vm.propertyNames-&gt;toStringTagSymbol, jsString(&amp;vm, &quot;WeakSet&quot;), DontEnum | ReadOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static WeakMapData* getWeakMapData(CallFrame* callFrame, JSValue value)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsmodulesnamespacejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/modules/namespace.js (191814 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/modules/namespace.js        2015-10-30 21:34:42 UTC (rev 191814)
+++ trunk/Source/JavaScriptCore/tests/modules/namespace.js        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -55,8 +55,9 @@
</span><span class="cx"> 
</span><span class="cx"> // These names should be shown in the code point order.
</span><span class="cx"> shouldBe(JSON.stringify(Object.getOwnPropertyNames(namespace)), `[&quot;Cappuccino&quot;,&quot;Cocoa&quot;,&quot;Matcha&quot;,&quot;Mocha&quot;,&quot;default&quot;]`);
</span><del>-shouldBe(Object.getOwnPropertySymbols(namespace).length, 1);
</del><ins>+shouldBe(Object.getOwnPropertySymbols(namespace).length, 2);
</ins><span class="cx"> shouldBe(Object.getOwnPropertySymbols(namespace)[0], Symbol.iterator);
</span><ins>+shouldBe(Object.getOwnPropertySymbols(namespace)[1], Symbol.toStringTag);
</ins><span class="cx"> 
</span><span class="cx"> shouldBe(typeof namespace[Symbol.iterator], 'function');
</span><span class="cx"> var array = Array.from(namespace);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresssymboltostringtagjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/symbol-tostringtag.js (0 => 191815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/symbol-tostringtag.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/symbol-tostringtag.js        2015-10-30 21:37:25 UTC (rev 191815)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+// This file tests the names of all the classes with builtin Symbol.toStringTags and Object.prototype.toString().
+
+foo = { };
+foo[Symbol.toStringTag] = &quot;test the tag&quot;;
+
+if (foo != &quot;[object test the tag]&quot;)
+    throw &quot;failed on custom toStringTag&quot;;
+
+function toStr(obj) {
+    return Object.prototype.toString.call(obj);
+}
+
+function strName(str) { return &quot;[object &quot; + str + &quot;]&quot;; }
+
+if (toStr(Symbol()) !== strName(&quot;Symbol&quot;))
+    throw &quot;failed on Symbol&quot;;
+
+if (toStr(Symbol.prototype) !== strName(&quot;Symbol&quot;))
+    throw &quot;failed on Symbol.prototype&quot;;
+
+objects = [&quot;JSON&quot;, &quot;Math&quot;];
+
+for (name of objects) {
+    value = eval(name)
+    if (toStr(value) !== strName(name))
+        throw &quot;failed on &quot; + name;
+}
+
+iterators = ['Array', 'Map', 'Set', 'String'];
+
+for (name of iterators) {
+    value = eval('new ' + name + '()[Symbol.iterator]()');
+    if (toStr(value) !== strName(name + ' Iterator'))
+        throw 'failed on Iterator of ' + name;
+    if (toStr(Object.getPrototypeOf(value)) !== strName(name + ' Iterator'))
+        throw 'failed on Iterator.prototype of ' + name;
+}
+
+classes = { &quot;ArrayBuffer&quot;: 10, &quot;DataView&quot;: new ArrayBuffer(10), &quot;Promise&quot;: function() { return 1 }, &quot;Set&quot;: undefined, &quot;WeakMap&quot;: undefined, &quot;WeakSet&quot;: undefined };
+
+for (name in classes) {
+    value = eval(name);
+    if (toStr(new value(classes[name])) !== strName(name))
+        throw &quot;failed on new object of &quot; + name;
+    if (toStr(value.prototype) !== strName(name))
+        throw &quot;failed on prototype of &quot; + name;
+}
+
</ins></span></pre>
</div>
</div>

</body>
</html>