<!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>[178696] 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/178696">178696</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2015-01-19 21:28:04 -0800 (Mon, 19 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>A &quot;cached&quot; null setter should throw a TypeException when called in strict mode and doesn't
https://bugs.webkit.org/show_bug.cgi?id=139418

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Made a new NullSetterFunction class similar to NullGetterFunction.  The difference is that 
NullSetterFunction will throw a TypeError per the ECMA262 spec for a strict mode caller.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
Added new files NullSetterFunction.cpp and NullSetterFunction.h.

* runtime/GetterSetter.h:
(JSC::GetterSetter::GetterSetter):
(JSC::GetterSetter::isSetterNull):
(JSC::GetterSetter::setSetter):
Change setter instances from using NullGetterFunction to using NullSetterFunction.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::nullSetterFunction):
Added m_nullSetterFunction and accessor.

* runtime/NullSetterFunction.cpp: Added.
(JSC::GetCallerStrictnessFunctor::GetCallerStrictnessFunctor):
(JSC::GetCallerStrictnessFunctor::operator()):
(JSC::GetCallerStrictnessFunctor::callerIsStrict):
(JSC::callerIsStrict):
Method to determine if the caller is in strict mode.

(JSC::callReturnUndefined):
(JSC::constructReturnUndefined):
(JSC::NullSetterFunction::getCallData):
(JSC::NullSetterFunction::getConstructData):
* runtime/NullSetterFunction.h: Added.
(JSC::NullSetterFunction::create):
(JSC::NullSetterFunction::createStructure):
(JSC::NullSetterFunction::NullSetterFunction):
Class with handlers for a null setter.

LayoutTests:

New regression test.

* js/regress-139418-expected.txt: Added.
* js/regress-139418.html: Added.
* js/script-tests/regress-139418.js: Added.
(InnerObjectNoSetter):
(InnerObjectNoSetter.prototype.get enabled):
(StrictOuterObject):
(StrictOuterObject.prototype.get enabled):
(StrictOuterObject.prototype.set enabled):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGetterSetterh">trunk/Source/JavaScriptCore/runtime/GetterSetter.h</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsregress139418expectedtxt">trunk/LayoutTests/js/regress-139418-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregress139418html">trunk/LayoutTests/js/regress-139418.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsregress139418js">trunk/LayoutTests/js/script-tests/regress-139418.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNullSetterFunctioncpp">trunk/Source/JavaScriptCore/runtime/NullSetterFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNullSetterFunctionh">trunk/Source/JavaScriptCore/runtime/NullSetterFunction.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/LayoutTests/ChangeLog        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-01-19  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        A &quot;cached&quot; null setter should throw a TypeException when called in strict mode and doesn't
+        https://bugs.webkit.org/show_bug.cgi?id=139418
+
+        Reviewed by Filip Pizlo.
+
+        New regression test.
+
+        * js/regress-139418-expected.txt: Added.
+        * js/regress-139418.html: Added.
+        * js/script-tests/regress-139418.js: Added.
+        (InnerObjectNoSetter):
+        (InnerObjectNoSetter.prototype.get enabled):
+        (StrictOuterObject):
+        (StrictOuterObject.prototype.get enabled):
+        (StrictOuterObject.prototype.set enabled):
+
</ins><span class="cx"> 2015-01-19  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [SVG -&gt; OTF Converter] Flip the switch on
</span></span></pre></div>
<a id="trunkLayoutTestsjsregress139418expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress-139418-expected.txt (0 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress-139418-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress-139418-expected.txt        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Regression test for https://webkit.org/b/139418.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregress139418html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress-139418.html (0 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress-139418.html                                (rev 0)
+++ trunk/LayoutTests/js/regress-139418.html        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/regress-139418.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsregress139418js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/regress-139418.js (0 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/regress-139418.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/regress-139418.js        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+description(
+&quot;Regression test for https://webkit.org/b/139418.&quot;
+);
+
+function InnerObjectNoSetter()
+{
+    this._enabled = false;
+}
+
+InnerObjectNoSetter.prototype = {
+    get enabled()
+    {
+        return this._enabled;
+    }
+}
+
+function StrictOuterObject(inner)
+{
+    this._innerObject = inner;
+}
+
+StrictOuterObject.prototype = {
+    get enabled()
+    {
+        &quot;use strict&quot;;
+        return this._innerObject.enabled;
+    },
+
+    set enabled(x)
+    {
+        &quot;use strict&quot;;
+        this._innerObject.enabled = x;
+    }
+}
+
+var innerNoSetter = new InnerObjectNoSetter;
+var strictOuterNoInnerSetter = new StrictOuterObject(innerNoSetter);
+
+for (var i = 0; i &lt; 1000; ++i) {
+    var  noExceptionWithMissingSetter = &quot;Missing setter called with strict mode should throw exception and didn't!&quot;;
+    try {
+        strictOuterNoInnerSetter.enabled = true;
+        throw  noExceptionWithMissingSetter;
+    } catch (e) {
+        if (e instanceof TypeError)
+            ; // This is the expected exception
+        else if (!((e instanceof String) &amp;&amp; (e ==  noExceptionWithMissingSetter)))
+            throw e // rethrow &quot;missing exception&quot; exception
+        else
+            throw &quot;Missing setter called with strict mode threw wrong exception: &quot; + e;
+    }
+    if (strictOuterNoInnerSetter.enabled)
+        throw &quot;Setter unexpectedly modified value&quot;;
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -514,6 +514,7 @@
</span><span class="cx">     runtime/NativeErrorConstructor.cpp
</span><span class="cx">     runtime/NativeErrorPrototype.cpp
</span><span class="cx">     runtime/NullGetterFunction.cpp
</span><ins>+    runtime/NullSetterFunction.cpp
</ins><span class="cx">     runtime/NumberConstructor.cpp
</span><span class="cx">     runtime/NumberObject.cpp
</span><span class="cx">     runtime/NumberPrototype.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-01-19  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        A &quot;cached&quot; null setter should throw a TypeException when called in strict mode and doesn't
+        https://bugs.webkit.org/show_bug.cgi?id=139418
+
+        Reviewed by Filip Pizlo.
+
+        Made a new NullSetterFunction class similar to NullGetterFunction.  The difference is that 
+        NullSetterFunction will throw a TypeError per the ECMA262 spec for a strict mode caller.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        Added new files NullSetterFunction.cpp and NullSetterFunction.h.
+
+        * runtime/GetterSetter.h:
+        (JSC::GetterSetter::GetterSetter):
+        (JSC::GetterSetter::isSetterNull):
+        (JSC::GetterSetter::setSetter):
+        Change setter instances from using NullGetterFunction to using NullSetterFunction.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::nullSetterFunction):
+        Added m_nullSetterFunction and accessor.
+
+        * runtime/NullSetterFunction.cpp: Added.
+        (JSC::GetCallerStrictnessFunctor::GetCallerStrictnessFunctor):
+        (JSC::GetCallerStrictnessFunctor::operator()):
+        (JSC::GetCallerStrictnessFunctor::callerIsStrict):
+        (JSC::callerIsStrict):
+        Method to determine if the caller is in strict mode.
+
+        (JSC::callReturnUndefined):
+        (JSC::constructReturnUndefined):
+        (JSC::NullSetterFunction::getCallData):
+        (JSC::NullSetterFunction::getConstructData):
+        * runtime/NullSetterFunction.h: Added.
+        (JSC::NullSetterFunction::create):
+        (JSC::NullSetterFunction::createStructure):
+        (JSC::NullSetterFunction::NullSetterFunction):
+        Class with handlers for a null setter.
+
</ins><span class="cx"> 2015-01-19  Saam Barati  &lt;saambarati1@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Provide a front end for JSC's Control Flow Profiler
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -779,6 +779,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NativeErrorConstructor.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NativeErrorPrototype.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NullGetterFunction.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\NullSetterFunction.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NumberConstructor.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NumberObject.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NumberPrototype.cpp&quot; /&gt;
</span><span class="lines">@@ -1573,6 +1574,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NativeErrorConstructor.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NativeErrorPrototype.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NullGetterFunction.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\NullSetterFunction.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NumberConstructor.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NumberObject.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NumberPrototype.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -759,6 +759,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NullGetterFunction.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\NullSetterFunction.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\NumberConstructor.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -2774,6 +2777,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NullGetterFunction.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\NullSetterFunction.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\NumberConstructor.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -918,6 +918,7 @@
</span><span class="cx">                 6514F21918B3E1670098FF8B /* Bytecodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6514F21718B3E1670098FF8B /* Bytecodes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 6546F5211A32B313006F07D5 /* NullGetterFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546F51F1A32A59C006F07D5 /* NullGetterFunction.cpp */; };
</span><ins>+                65525FC51A6DD801007B5495 /* NullSetterFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65525FC31A6DD3B3007B5495 /* NullSetterFunction.cpp */; };
</ins><span class="cx">                 6553A33117A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */; };
</span><span class="cx">                 6553A33217A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */; };
</span><span class="cx">                 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; };
</span><span class="lines">@@ -2565,6 +2566,8 @@
</span><span class="cx">                 65400C100A69BAF200509887 /* PropertyNameArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PropertyNameArray.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6546F51F1A32A59C006F07D5 /* NullGetterFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = NullGetterFunction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</span><span class="cx">                 6546F5201A32A59C006F07D5 /* NullGetterFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullGetterFunction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                65525FC31A6DD3B3007B5495 /* NullSetterFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NullSetterFunction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                65525FC41A6DD3B3007B5495 /* NullSetterFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullSetterFunction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonSlowPathsExceptions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPathsExceptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 655EB29A10CE2581001A990E /* NodesCodegen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodesCodegen.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4444,6 +4447,8 @@
</span><span class="cx">                                 BC02E90B0E1839DB000F9297 /* NativeErrorPrototype.h */,
</span><span class="cx">                                 6546F51F1A32A59C006F07D5 /* NullGetterFunction.cpp */,
</span><span class="cx">                                 6546F5201A32A59C006F07D5 /* NullGetterFunction.h */,
</span><ins>+                                65525FC31A6DD3B3007B5495 /* NullSetterFunction.cpp */,
+                                65525FC41A6DD3B3007B5495 /* NullSetterFunction.h */,
</ins><span class="cx">                                 BC2680C20E16D4E900A06E92 /* NumberConstructor.cpp */,
</span><span class="cx">                                 BC2680C30E16D4E900A06E92 /* NumberConstructor.h */,
</span><span class="cx">                                 F692A8700255597D01FF60F7 /* NumberObject.cpp */,
</span><span class="lines">@@ -7179,6 +7184,7 @@
</span><span class="cx">                                 148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */,
</span><span class="cx">                                 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */,
</span><span class="cx">                                 6546F5211A32B313006F07D5 /* NullGetterFunction.cpp in Sources */,
</span><ins>+                                65525FC51A6DD801007B5495 /* NullSetterFunction.cpp in Sources */,
</ins><span class="cx">                                 14469DE2107EC7E700650446 /* NumberConstructor.cpp in Sources */,
</span><span class="cx">                                 14469DE3107EC7E700650446 /* NumberObject.cpp in Sources */,
</span><span class="cx">                                 14469DE4107EC7E700650446 /* NumberPrototype.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGetterSetterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GetterSetter.h (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GetterSetter.h        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/runtime/GetterSetter.h        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;NullGetterFunction.h&quot;
</span><ins>+#include &quot;NullSetterFunction.h&quot;
</ins><span class="cx"> #include &quot;Structure.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -48,7 +49,7 @@
</span><span class="cx">         : JSCell(vm, vm.getterSetterStructure.get())
</span><span class="cx">     {
</span><span class="cx">         m_getter.set(vm, this, globalObject-&gt;nullGetterFunction());
</span><del>-        m_setter.set(vm, this, globalObject-&gt;nullGetterFunction());
</del><ins>+        m_setter.set(vm, this, globalObject-&gt;nullSetterFunction());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> public:
</span><span class="lines">@@ -73,7 +74,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isGetterNull() const { return !!jsDynamicCast&lt;NullGetterFunction*&gt;(m_getter.get()); }
</span><del>-    bool isSetterNull() const { return !!jsDynamicCast&lt;NullGetterFunction*&gt;(m_setter.get()); }
</del><ins>+    bool isSetterNull() const { return !!jsDynamicCast&lt;NullSetterFunction*&gt;(m_setter.get()); }
</ins><span class="cx"> 
</span><span class="cx">     // Set the getter. It's only valid to call this if you've never set the getter on this
</span><span class="cx">     // object.
</span><span class="lines">@@ -101,7 +102,7 @@
</span><span class="cx">     void setSetter(VM&amp; vm, JSGlobalObject* globalObject, JSObject* setter)
</span><span class="cx">     {
</span><span class="cx">         if (!setter)
</span><del>-            setter = jsCast&lt;JSObject*&gt;(globalObject-&gt;nullGetterFunction());
</del><ins>+            setter = jsCast&lt;JSObject*&gt;(globalObject-&gt;nullSetterFunction());
</ins><span class="cx"> 
</span><span class="cx">         RELEASE_ASSERT(isSetterNull());
</span><span class="cx">         WTF::storeStoreFence();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -100,6 +100,7 @@
</span><span class="cx"> #include &quot;NativeErrorConstructor.h&quot;
</span><span class="cx"> #include &quot;NativeErrorPrototype.h&quot;
</span><span class="cx"> #include &quot;NullGetterFunction.h&quot;
</span><ins>+#include &quot;NullSetterFunction.h&quot;
</ins><span class="cx"> #include &quot;NumberConstructor.h&quot;
</span><span class="cx"> #include &quot;NumberPrototype.h&quot;
</span><span class="cx"> #include &quot;ObjCCallbackFunction.h&quot;
</span><span class="lines">@@ -234,6 +235,7 @@
</span><span class="cx">     m_callFunction.set(vm, this, callFunction);
</span><span class="cx">     m_applyFunction.set(vm, this, applyFunction);
</span><span class="cx">     m_nullGetterFunction.set(vm, this, NullGetterFunction::create(vm, NullGetterFunction::createStructure(vm, this, m_functionPrototype.get())));
</span><ins>+    m_nullSetterFunction.set(vm, this, NullSetterFunction::create(vm, NullSetterFunction::createStructure(vm, this, m_functionPrototype.get())));
</ins><span class="cx">     m_objectPrototype.set(vm, this, ObjectPrototype::create(vm, this, ObjectPrototype::createStructure(vm, this, jsNull())));
</span><span class="cx">     GetterSetter* protoAccessor = GetterSetter::create(vm, this);
</span><span class="cx">     protoAccessor-&gt;setGetter(vm, this, JSFunction::create(vm, this, 0, String(), globalFuncProtoGetter));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (178695 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2015-01-20 05:17:07 UTC (rev 178695)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> class RegExpPrototype;
</span><span class="cx"> class SourceCode;
</span><span class="cx"> class NullGetterFunction;
</span><ins>+class NullSetterFunction;
</ins><span class="cx"> struct ActivationStackNode;
</span><span class="cx"> struct HashTable;
</span><span class="cx"> 
</span><span class="lines">@@ -175,6 +176,7 @@
</span><span class="cx">     WriteBarrier&lt;ObjectConstructor&gt; m_objectConstructor;
</span><span class="cx"> 
</span><span class="cx">     WriteBarrier&lt;NullGetterFunction&gt; m_nullGetterFunction;
</span><ins>+    WriteBarrier&lt;NullSetterFunction&gt; m_nullSetterFunction;
</ins><span class="cx"> 
</span><span class="cx">     WriteBarrier&lt;JSFunction&gt; m_evalFunction;
</span><span class="cx">     WriteBarrier&lt;JSFunction&gt; m_callFunction;
</span><span class="lines">@@ -374,6 +376,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     NullGetterFunction* nullGetterFunction() const { return m_nullGetterFunction.get(); }
</span><ins>+    NullSetterFunction* nullSetterFunction() const { return m_nullSetterFunction.get(); }
</ins><span class="cx"> 
</span><span class="cx">     JSFunction* evalFunction() const { return m_evalFunction.get(); }
</span><span class="cx">     JSFunction* callFunction() const { return m_callFunction.get(); }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNullSetterFunctioncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/NullSetterFunction.cpp (0 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NullSetterFunction.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/NullSetterFunction.cpp        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;NullSetterFunction.h&quot;
+
+#include &quot;Error.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;JSCJSValueInlines.h&quot;
+#include &quot;StackVisitor.h&quot;
+
+namespace JSC {
+
+const ClassInfo NullSetterFunction::s_info = { &quot;Function&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(NullSetterFunction) };
+
+
+class GetCallerStrictnessFunctor {
+public:
+    GetCallerStrictnessFunctor()
+        : m_iterations(0)
+        , m_callerIsStrict(false)
+    {
+    }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor)
+    {
+        ++m_iterations;
+        if (m_iterations &lt; 2)
+            return StackVisitor::Continue;
+
+        CodeBlock* codeBlock = visitor-&gt;codeBlock();
+        m_callerIsStrict = codeBlock &amp;&amp; codeBlock-&gt;isStrictMode();
+        return StackVisitor::Done;
+    }
+
+    bool callerIsStrict() const { return m_callerIsStrict; }
+
+private:
+    int m_iterations;
+    bool m_callerIsStrict;
+};
+
+static bool callerIsStrict(ExecState* exec)
+{
+    GetCallerStrictnessFunctor iter;
+    exec-&gt;iterate(iter);
+    return iter.callerIsStrict();
+}
+
+static EncodedJSValue JSC_HOST_CALL callReturnUndefined(ExecState* exec)
+{
+    if (callerIsStrict(exec))
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral(&quot;Setting a property that has only a getter&quot;)));
+    return JSValue::encode(jsUndefined());
+}
+
+static EncodedJSValue JSC_HOST_CALL constructReturnUndefined(ExecState* exec)
+{
+    if (callerIsStrict(exec))
+        return JSValue::encode(throwTypeError(exec, ASCIILiteral(&quot;Setting a property that has only a getter&quot;)));
+    return JSValue::encode(jsUndefined());
+}
+
+CallType NullSetterFunction::getCallData(JSCell*, CallData&amp; callData)
+{
+    callData.native.function = callReturnUndefined;
+    return CallTypeHost;
+}
+
+ConstructType NullSetterFunction::getConstructData(JSCell*, ConstructData&amp; constructData)
+{
+    constructData.native.function = constructReturnUndefined;
+    return ConstructTypeHost;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNullSetterFunctionh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/NullSetterFunction.h (0 => 178696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NullSetterFunction.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/NullSetterFunction.h        2015-01-20 05:28:04 UTC (rev 178696)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NullSetterFunction_h
+#define NullSetterFunction_h
+
+#include &quot;InternalFunction.h&quot;
+
+namespace JSC {
+
+class NullSetterFunction : public InternalFunction {
+public:
+    typedef InternalFunction Base;
+
+    static NullSetterFunction* create(VM&amp; vm, Structure* structure)
+    {
+        NullSetterFunction* function = new (NotNull, allocateCell&lt; NullSetterFunction&gt;(vm.heap))  NullSetterFunction(vm, structure);
+        function-&gt;finishCreation(vm, String());
+        return function;
+    }
+
+    DECLARE_EXPORT_INFO;
+
+    static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
+    {
+        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
+    }
+
+private:
+    NullSetterFunction(VM&amp; vm, Structure* structure)
+        : Base(vm, structure)
+    {
+    }
+    static ConstructType getConstructData(JSCell*, ConstructData&amp;);
+    static CallType getCallData(JSCell*, CallData&amp;);
+};
+
+}
+
+#endif // NullSetterFunction_h
</ins></span></pre>
</div>
</div>

</body>
</html>