<!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>[205131] trunk/Source/JavaScriptCore</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/205131">205131</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2016-08-29 11:50:44 -0700 (Mon, 29 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix toStringName for Proxies and add support for normal instances
https://bugs.webkit.org/show_bug.cgi?id=161275

Reviewed by Saam Barati.

toStringName on proxies needs to follow the chain of proxies until it finds a non-proxy target.
Additionally, there are a couple of other classes that need to return &quot;Object&quot; for their
toStringName. Since this isn't tested by test262 I will propose a new test there.

* runtime/ClassInfo.h:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::toStringName):
* runtime/JSArrayBufferView.h:
* runtime/JSCell.cpp:
(JSC::JSCell::toStringName):
* runtime/JSCell.h:
* runtime/JSMap.cpp:
(JSC::JSMap::toStringName):
* runtime/JSMap.h:
* runtime/JSObject.cpp:
(JSC::JSObject::toStringName):
* runtime/JSObject.h:
* runtime/JSSet.cpp:
(JSC::JSSet::destroy):
(JSC::JSSet::toStringName):
* runtime/JSSet.h:
* runtime/JSWeakMap.cpp:
(JSC::JSWeakMap::toStringName):
* runtime/JSWeakMap.h:
* runtime/JSWeakSet.cpp:
(JSC::JSWeakSet::toStringName):
* runtime/JSWeakSet.h:
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::toStringName):
* runtime/ProxyObject.h:
* runtime/SymbolObject.cpp:
(JSC::SymbolObject::toStringName):
* runtime/SymbolObject.h:
(JSC::SymbolObject::internalValue):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeClassInfoh">trunk/Source/JavaScriptCore/runtime/ClassInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferViewcpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferViewh">trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCellcpp">trunk/Source/JavaScriptCore/runtime/JSCell.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCellh">trunk/Source/JavaScriptCore/runtime/JSCell.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSMapcpp">trunk/Source/JavaScriptCore/runtime/JSMap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSMaph">trunk/Source/JavaScriptCore/runtime/JSMap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjecth">trunk/Source/JavaScriptCore/runtime/JSObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSetcpp">trunk/Source/JavaScriptCore/runtime/JSSet.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSSeth">trunk/Source/JavaScriptCore/runtime/JSSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSWeakMapcpp">trunk/Source/JavaScriptCore/runtime/JSWeakMap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSWeakMaph">trunk/Source/JavaScriptCore/runtime/JSWeakMap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSWeakSetcpp">trunk/Source/JavaScriptCore/runtime/JSWeakSet.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSWeakSeth">trunk/Source/JavaScriptCore/runtime/JSWeakSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectPrototypecpp">trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProxyObjectcpp">trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProxyObjecth">trunk/Source/JavaScriptCore/runtime/ProxyObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolObjectcpp">trunk/Source/JavaScriptCore/runtime/SymbolObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolObjecth">trunk/Source/JavaScriptCore/runtime/SymbolObject.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2016-08-29  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Fix toStringName for Proxies and add support for normal instances
+        https://bugs.webkit.org/show_bug.cgi?id=161275
+
+        Reviewed by Saam Barati.
+
+        toStringName on proxies needs to follow the chain of proxies until it finds a non-proxy target.
+        Additionally, there are a couple of other classes that need to return &quot;Object&quot; for their
+        toStringName. Since this isn't tested by test262 I will propose a new test there.
+
+        * runtime/ClassInfo.h:
+        * runtime/JSArrayBufferView.cpp:
+        (JSC::JSArrayBufferView::toStringName):
+        * runtime/JSArrayBufferView.h:
+        * runtime/JSCell.cpp:
+        (JSC::JSCell::toStringName):
+        * runtime/JSCell.h:
+        * runtime/JSMap.cpp:
+        (JSC::JSMap::toStringName):
+        * runtime/JSMap.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::toStringName):
+        * runtime/JSObject.h:
+        * runtime/JSSet.cpp:
+        (JSC::JSSet::destroy):
+        (JSC::JSSet::toStringName):
+        * runtime/JSSet.h:
+        * runtime/JSWeakMap.cpp:
+        (JSC::JSWeakMap::toStringName):
+        * runtime/JSWeakMap.h:
+        * runtime/JSWeakSet.cpp:
+        (JSC::JSWeakSet::toStringName):
+        * runtime/JSWeakSet.h:
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncToString):
+        * runtime/ProxyObject.cpp:
+        (JSC::ProxyObject::toStringName):
+        * runtime/ProxyObject.h:
+        * runtime/SymbolObject.cpp:
+        (JSC::SymbolObject::toStringName):
+        * runtime/SymbolObject.h:
+        (JSC::SymbolObject::internalValue):
+
</ins><span class="cx"> 2016-08-29  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Fetch API] Response cloning should structureClone when teeing Response stream
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeClassInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ClassInfo.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ClassInfo.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/ClassInfo.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -91,8 +91,10 @@
</span><span class="cx"> 
</span><span class="cx">     typedef String (*ClassNameFunctionPtr)(const JSObject*);
</span><span class="cx">     ClassNameFunctionPtr className;
</span><del>-    ClassNameFunctionPtr toStringName;
</del><span class="cx"> 
</span><ins>+    typedef String (*ToStringNameFunctionPtr)(const JSObject*, ExecState*);
+    ToStringNameFunctionPtr toStringName;
+
</ins><span class="cx">     typedef bool (*CustomHasInstanceFunctionPtr)(JSObject*, ExecState*, JSValue);
</span><span class="cx">     CustomHasInstanceFunctionPtr customHasInstance;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -36,6 +36,11 @@
</span><span class="cx">     &quot;ArrayBufferView&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSArrayBufferView)
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+String JSArrayBufferView::toStringName(const JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
+}
+
</ins><span class="cx"> JSArrayBufferView::ConstructionContext::ConstructionContext(
</span><span class="cx">     VM&amp; vm, Structure* structure, uint32_t length, uint32_t elementSize,
</span><span class="cx">     InitializationMode mode)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -179,6 +179,8 @@
</span><span class="cx"> 
</span><span class="cx">     ArrayBuffer* existingBufferInButterfly();
</span><span class="cx"> 
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
+
</ins><span class="cx">     CopyBarrier&lt;char&gt; m_vector; // this is really a void*, but void would not work here.
</span><span class="cx">     uint32_t m_length;
</span><span class="cx">     TypedArrayMode m_mode;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCell.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCell.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSCell.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String JSCell::toStringName(const JSObject*)
</del><ins>+String JSCell::toStringName(const JSObject*, ExecState*)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCellh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCell.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCell.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSCell.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx">     static NO_RETURN_DUE_TO_CRASH JSValue getPrototype(JSObject*, ExecState*);
</span><span class="cx"> 
</span><span class="cx">     static String className(const JSObject*);
</span><del>-    static String toStringName(const JSObject*);
</del><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx">     JS_EXPORT_PRIVATE static bool customHasInstance(JSObject*, ExecState*, JSValue);
</span><span class="cx">     static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&amp;, bool shouldThrow);
</span><span class="cx">     static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSMap.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSMap.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSMap.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -50,6 +50,11 @@
</span><span class="cx">     return Base::estimatedSize(cell) + mapDataSize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String JSMap::toStringName(const JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
+}
+
</ins><span class="cx"> void JSMap::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     Base::visitChildren(cell, visitor);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSMap.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSMap.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSMap.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx">     static size_t estimatedSize(JSCell*);
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><span class="cx">     static void copyBackingStore(JSCell*, CopyVisitor&amp;, CopyToken);
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx">     MapData m_mapData;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">     return info-&gt;className;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String JSObject::toStringName(const JSObject* object)
</del><ins>+String JSObject::toStringName(const JSObject* object, ExecState*)
</ins><span class="cx"> {
</span><span class="cx">     const ClassInfo* info = object-&gt;classInfo();
</span><span class="cx">     ASSERT(info);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">     // an object when using Symbol.toStringTag fails. For the most part there is no
</span><span class="cx">     // difference between this and className(). The main use case is for new JS language
</span><span class="cx">     // objects to set the default tag to &quot;Object&quot;.
</span><del>-    JS_EXPORT_PRIVATE static String toStringName(const JSObject*);
</del><ins>+    JS_EXPORT_PRIVATE static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx">     // This is the fully virtual [[GetPrototypeOf]] internal function defined
</span><span class="cx">     // in the ECMAScript 6 specification. Use this when doing a [[GetPrototypeOf]] 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSet.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSet.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSSet.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -43,6 +43,11 @@
</span><span class="cx">     thisObject-&gt;JSSet::~JSSet();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String JSSet::toStringName(const JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
+}
+
</ins><span class="cx"> size_t JSSet::estimatedSize(JSCell* cell)
</span><span class="cx"> {
</span><span class="cx">     JSSet* thisObject = jsCast&lt;JSSet*&gt;(cell);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSSet.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSSet.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSSet.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -120,6 +120,7 @@
</span><span class="cx">     static size_t estimatedSize(JSCell*);
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><span class="cx">     static void copyBackingStore(JSCell*, CopyVisitor&amp;, CopyToken);
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx">     SetData m_setData;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSWeakMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSWeakMap.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSWeakMap.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSWeakMap.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -49,4 +49,9 @@
</span><span class="cx">     visitor.append(&amp;thisObj-&gt;m_weakMapData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String JSWeakMap::toStringName(const JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSWeakMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSWeakMap.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSWeakMap.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSWeakMap.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">     void finishCreation(VM&amp;);
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx">     WriteBarrier&lt;WeakMapData&gt; m_weakMapData;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSWeakSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSWeakSet.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSWeakSet.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSWeakSet.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -49,4 +49,9 @@
</span><span class="cx">     visitor.append(&amp;thisObj-&gt;m_weakMapData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String JSWeakSet::toStringName(const JSC::JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSWeakSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSWeakSet.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSWeakSet.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/JSWeakSet.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> 
</span><span class="cx">     void finishCreation(VM&amp;);
</span><span class="cx">     static void visitChildren(JSCell*, SlotVisitor&amp;);
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx"> 
</span><span class="cx">     WriteBarrier&lt;WeakMapData&gt; m_weakMapData;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -298,7 +298,10 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        String newString = WTF::tryMakeString(&quot;[object &quot;, thisObject-&gt;methodTable(exec-&gt;vm())-&gt;toStringName(thisObject), &quot;]&quot;);
</del><ins>+        String tag = thisObject-&gt;methodTable(exec-&gt;vm())-&gt;toStringName(thisObject, exec);
+        if (vm.exception())
+            return JSValue();
+        String newString = WTF::tryMakeString(&quot;[object &quot;, WTFMove(tag), &quot;]&quot;);
</ins><span class="cx">         if (!newString)
</span><span class="cx">             return throwOutOfMemoryError(exec);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProxyObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ProxyObject.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;ArrayConstructor.h&quot;
</ins><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;IdentifierInlines.h&quot;
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><span class="lines">@@ -49,11 +50,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String ProxyObject::toStringName(const JSObject* object)
</del><ins>+String ProxyObject::toStringName(const JSObject* object, ExecState* exec)
</ins><span class="cx"> {
</span><del>-    const JSObject* target = jsCast&lt;const ProxyObject*&gt;(object)-&gt;target();
-    if (isJSArray(target))
-        return target-&gt;classInfo()-&gt;methodTable.className(target);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    const ProxyObject* proxy = jsCast&lt;const ProxyObject*&gt;(object);
+    while (proxy) {
+        const JSObject* target = proxy-&gt;target();
+        if (isArray(exec, target))
+            return target-&gt;classInfo()-&gt;methodTable.toStringName(target, exec);
+        if (vm.exception())
+            break;
+
+        proxy = jsDynamicCast&lt;const ProxyObject*&gt;(target);
+    }
</ins><span class="cx">     return ASCIILiteral(&quot;Object&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProxyObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProxyObject.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProxyObject.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/ProxyObject.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     void finishCreation(VM&amp;, ExecState*, JSValue target, JSValue handler);
</span><span class="cx">     static Structure* structureForTarget(JSGlobalObject*, JSValue target);
</span><span class="cx"> 
</span><del>-    static String toStringName(const JSObject*);
</del><ins>+    static String toStringName(const JSObject*, ExecState*);
</ins><span class="cx">     static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&amp;);
</span><span class="cx">     static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&amp;);
</span><span class="cx">     static CallType getCallData(JSCell*, CallData&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolObject.cpp (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolObject.cpp        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/SymbolObject.cpp        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -47,6 +47,11 @@
</span><span class="cx">     setInternalValue(vm, symbol);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String SymbolObject::toStringName(const JSObject*, ExecState*)
+{
+    return ASCIILiteral(&quot;Object&quot;);
+}
+
</ins><span class="cx"> JSValue SymbolObject::defaultValue(const JSObject* object, ExecState*, PreferredPrimitiveType)
</span><span class="cx"> {
</span><span class="cx">     const SymbolObject* symbolObject = jsCast&lt;const SymbolObject*&gt;(object);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolObject.h (205130 => 205131)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolObject.h        2016-08-29 18:50:00 UTC (rev 205130)
+++ trunk/Source/JavaScriptCore/runtime/SymbolObject.h        2016-08-29 18:50:44 UTC (rev 205131)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx">     DECLARE_EXPORT_INFO;
</span><span class="cx"> 
</span><del>-    Symbol* internalValue() const { return asSymbol(JSWrapperObject::internalValue());}
</del><ins>+    Symbol* internalValue() const { return asSymbol(JSWrapperObject::internalValue()); }
</ins><span class="cx"> 
</span><span class="cx">     static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
</span><span class="cx">     {
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType);
</span><span class="cx"> 
</span><ins>+    static String toStringName(const JSObject*, ExecState*);
+
</ins><span class="cx"> protected:
</span><span class="cx">     JS_EXPORT_PRIVATE void finishCreation(VM&amp;, Symbol*);
</span><span class="cx">     JS_EXPORT_PRIVATE SymbolObject(VM&amp;, Structure*);
</span></span></pre>
</div>
</div>

</body>
</html>