<!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>[197391] 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/197391">197391</a></dd>
<dt>Author</dt> <dd>sbarati@apple.com</dd>
<dt>Date</dt> <dd>2016-03-01 00:11:20 -0800 (Tue, 01 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[[PreventExtensions]] should be a virtual method in the method table.
https://bugs.webkit.org/show_bug.cgi?id=154800
Reviewed by Yusuke Suzuki.
This patch makes us more consistent with how the ES6 specification models the
[[PreventExtensions]] trap. Moving this method into ClassInfo::methodTable
is a prerequisite for implementing Proxy.[[PreventExtensions]].
* runtime/ClassInfo.h:
* runtime/JSCell.cpp:
(JSC::JSCell::getGenericPropertyNames):
(JSC::JSCell::preventExtensions):
* runtime/JSCell.h:
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::JSModuleNamespaceObject):
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::destroy):
* runtime/JSModuleNamespaceObject.h:
(JSC::JSModuleNamespaceObject::create):
(JSC::JSModuleNamespaceObject::moduleRecord):
* runtime/JSObject.cpp:
(JSC::JSObject::freeze):
(JSC::JSObject::preventExtensions):
(JSC::JSObject::reifyAllStaticProperties):
* runtime/JSObject.h:
(JSC::JSObject::isSealed):
(JSC::JSObject::isFrozen):
(JSC::JSObject::isExtensible):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorPreventExtensions):
(JSC::objectConstructorIsSealed):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectPreventExtensions):
* runtime/Structure.cpp:
(JSC::Structure::Structure):
(JSC::Structure::preventExtensionsTransition):
* runtime/Structure.h:</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="#trunkSourceJavaScriptCoreruntimeJSCellcpp">trunk/Source/JavaScriptCore/runtime/JSCell.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCellh">trunk/Source/JavaScriptCore/runtime/JSCell.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp">trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjecth">trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.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="#trunkSourceJavaScriptCoreruntimeObjectConstructorcpp">trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeReflectObjectcpp">trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStructurecpp">trunk/Source/JavaScriptCore/runtime/Structure.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStructureh">trunk/Source/JavaScriptCore/runtime/Structure.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-02-29 Saam barati <sbarati@apple.com>
+
+ [[PreventExtensions]] should be a virtual method in the method table.
+ https://bugs.webkit.org/show_bug.cgi?id=154800
+
+ Reviewed by Yusuke Suzuki.
+
+ This patch makes us more consistent with how the ES6 specification models the
+ [[PreventExtensions]] trap. Moving this method into ClassInfo::methodTable
+ is a prerequisite for implementing Proxy.[[PreventExtensions]].
+
+ * runtime/ClassInfo.h:
+ * runtime/JSCell.cpp:
+ (JSC::JSCell::getGenericPropertyNames):
+ (JSC::JSCell::preventExtensions):
+ * runtime/JSCell.h:
+ * runtime/JSModuleNamespaceObject.cpp:
+ (JSC::JSModuleNamespaceObject::JSModuleNamespaceObject):
+ (JSC::JSModuleNamespaceObject::finishCreation):
+ (JSC::JSModuleNamespaceObject::destroy):
+ * runtime/JSModuleNamespaceObject.h:
+ (JSC::JSModuleNamespaceObject::create):
+ (JSC::JSModuleNamespaceObject::moduleRecord):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::freeze):
+ (JSC::JSObject::preventExtensions):
+ (JSC::JSObject::reifyAllStaticProperties):
+ * runtime/JSObject.h:
+ (JSC::JSObject::isSealed):
+ (JSC::JSObject::isFrozen):
+ (JSC::JSObject::isExtensible):
+ * runtime/ObjectConstructor.cpp:
+ (JSC::objectConstructorSeal):
+ (JSC::objectConstructorFreeze):
+ (JSC::objectConstructorPreventExtensions):
+ (JSC::objectConstructorIsSealed):
+ * runtime/ReflectObject.cpp:
+ (JSC::reflectObjectPreventExtensions):
+ * runtime/Structure.cpp:
+ (JSC::Structure::Structure):
+ (JSC::Structure::preventExtensionsTransition):
+ * runtime/Structure.h:
+
</ins><span class="cx"> 2016-02-29 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> [JSC] Private symbols should not be trapped by proxy handler
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeClassInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ClassInfo.h (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ClassInfo.h        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/ClassInfo.h        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -103,6 +103,9 @@
</span><span class="cx"> typedef PassRefPtr<ArrayBufferView> (*GetTypedArrayImpl)(JSArrayBufferView*);
</span><span class="cx"> GetTypedArrayImpl getTypedArrayImpl;
</span><span class="cx">
</span><ins>+ typedef bool (*PreventExtensionsFunctionPtr)(JSObject*, ExecState*);
+ PreventExtensionsFunctionPtr preventExtensions;
+
</ins><span class="cx"> typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&);
</span><span class="cx"> DumpToStreamFunctionPtr dumpToStream;
</span><span class="cx">
</span><span class="lines">@@ -154,6 +157,7 @@
</span><span class="cx"> &ClassName::defineOwnProperty, \
</span><span class="cx"> &ClassName::slowDownAndWasteMemory, \
</span><span class="cx"> &ClassName::getTypedArrayImpl, \
</span><ins>+ &ClassName::preventExtensions, \
</ins><span class="cx"> &ClassName::dumpToStream, \
</span><span class="cx"> &ClassName::estimatedSize \
</span><span class="cx"> }, \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCell.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCell.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSCell.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -270,4 +270,9 @@
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool JSCell::preventExtensions(JSObject*, ExecState*)
+{
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCellh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCell.h (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCell.h        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSCell.h        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -206,6 +206,7 @@
</span><span class="cx"> static uint32_t getEnumerableLength(ExecState*, JSObject*);
</span><span class="cx"> static NO_RETURN_DUE_TO_CRASH void getStructurePropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
</span><span class="cx"> static NO_RETURN_DUE_TO_CRASH void getGenericPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
</span><ins>+ static NO_RETURN_DUE_TO_CRASH bool preventExtensions(JSObject*, ExecState*);
</ins><span class="cx">
</span><span class="cx"> static String className(const JSObject*);
</span><span class="cx"> JS_EXPORT_PRIVATE static bool customHasInstance(JSObject*, ExecState*, JSValue);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -49,8 +49,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSModuleNamespaceObject::finishCreation(VM& vm, JSGlobalObject* globalObject, JSModuleRecord* moduleRecord, const IdentifierSet& exports)
</del><ins>+void JSModuleNamespaceObject::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSModuleRecord* moduleRecord, const IdentifierSet& exports)
</ins><span class="cx"> {
</span><ins>+ VM& vm = exec->vm();
</ins><span class="cx"> Base::finishCreation(vm);
</span><span class="cx"> ASSERT(inherits(info()));
</span><span class="cx">
</span><span class="lines">@@ -78,7 +79,8 @@
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-setprototypeof-v
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-isextensible
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-preventextensions
</span><del>- preventExtensions(vm);
</del><ins>+ methodTable(vm)->preventExtensions(this, exec);
+ ASSERT(!exec->hadException());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSModuleNamespaceObject::destroy(JSCell* cell)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> static JSModuleNamespaceObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSModuleRecord* moduleRecord, const IdentifierSet& exports)
</span><span class="cx"> {
</span><span class="cx"> JSModuleNamespaceObject* object = new (NotNull, allocateCell<JSModuleNamespaceObject>(exec->vm().heap)) JSModuleNamespaceObject(exec->vm(), structure);
</span><del>- object->finishCreation(exec->vm(), globalObject, moduleRecord, exports);
</del><ins>+ object->finishCreation(exec, globalObject, moduleRecord, exports);
</ins><span class="cx"> return object;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> JSModuleRecord* moduleRecord() { return m_moduleRecord.get(); }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- JS_EXPORT_PRIVATE void finishCreation(VM&, JSGlobalObject*, JSModuleRecord*, const IdentifierSet& exports);
</del><ins>+ JS_EXPORT_PRIVATE void finishCreation(ExecState*, JSGlobalObject*, JSModuleRecord*, const IdentifierSet& exports);
</ins><span class="cx"> JS_EXPORT_PRIVATE JSModuleNamespaceObject(VM&, Structure*);
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -1675,12 +1675,15 @@
</span><span class="cx"> setStructure(vm, Structure::freezeTransition(vm, structure(vm)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSObject::preventExtensions(VM& vm)
</del><ins>+bool JSObject::preventExtensions(JSObject* object, ExecState* exec)
</ins><span class="cx"> {
</span><del>- if (!isExtensible())
- return;
- enterDictionaryIndexingMode(vm);
- setStructure(vm, Structure::preventExtensionsTransition(vm, structure(vm)));
</del><ins>+ if (!object->isExtensible())
+ return true;
+
+ VM& vm = exec->vm();
+ object->enterDictionaryIndexingMode(vm);
+ object->setStructure(vm, Structure::preventExtensionsTransition(vm, object->structure(vm)));
+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSObject::reifyAllStaticProperties(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -614,7 +614,7 @@
</span><span class="cx">
</span><span class="cx"> JS_EXPORT_PRIVATE void seal(VM&);
</span><span class="cx"> JS_EXPORT_PRIVATE void freeze(VM&);
</span><del>- JS_EXPORT_PRIVATE void preventExtensions(VM&);
</del><ins>+ JS_EXPORT_PRIVATE static bool preventExtensions(JSObject*, ExecState*);
</ins><span class="cx"> bool isSealed(VM& vm) { return structure(vm)->isSealed(vm); }
</span><span class="cx"> bool isFrozen(VM& vm) { return structure(vm)->isFrozen(vm); }
</span><span class="cx"> bool isExtensible() { return structure()->isExtensible(); }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -516,7 +516,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 3. Set the [[Extensible]] internal property of O to false.
</span><del>- object->preventExtensions(exec->vm());
</del><ins>+ object->methodTable(exec->vm())->preventExtensions(object, exec);
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
</ins><span class="cx">
</span><span class="cx"> // 4. Return O.
</span><span class="cx"> return JSValue::encode(obj);
</span><span class="lines">@@ -554,7 +556,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 3. Set the [[Extensible]] internal property of O to false.
</span><del>- object->preventExtensions(exec->vm());
</del><ins>+ object->methodTable(exec->vm())->preventExtensions(object, exec);
+ if (exec->hadException())
+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> // 4. Return O.
</span><span class="cx"> return object;
</span><span class="lines">@@ -566,16 +570,20 @@
</span><span class="cx"> JSValue obj = exec->argument(0);
</span><span class="cx"> if (!obj.isObject())
</span><span class="cx"> return JSValue::encode(obj);
</span><del>- return JSValue::encode(objectConstructorFreeze(exec, asObject(obj)));
</del><ins>+ JSObject* result = objectConstructorFreeze(exec, asObject(obj));
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
+ return JSValue::encode(result);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorPreventExtensions(ExecState* exec)
</span><span class="cx"> {
</span><del>- JSValue obj = exec->argument(0);
- if (!obj.isObject())
- return JSValue::encode(obj);
- asObject(obj)->preventExtensions(exec->vm());
- return JSValue::encode(obj);
</del><ins>+ JSValue argument = exec->argument(0);
+ if (!argument.isObject())
+ return JSValue::encode(argument);
+ JSObject* object = asObject(argument);
+ object->methodTable(exec->vm())->preventExtensions(object, exec);
+ return JSValue::encode(object);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorIsSealed(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeReflectObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -186,8 +186,11 @@
</span><span class="cx"> JSValue target = exec->argument(0);
</span><span class="cx"> if (!target.isObject())
</span><span class="cx"> return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.preventExtensions requires the first argument be an object")));
</span><del>- asObject(target)->preventExtensions(exec->vm());
- return JSValue::encode(jsBoolean(true));
</del><ins>+ JSObject* object = asObject(target);
+ bool result = object->methodTable(exec->vm())->preventExtensions(object, exec);
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
+ return JSValue::encode(jsBoolean(result));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-reflect.setprototypeof
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStructurecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Structure.cpp (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Structure.cpp        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/Structure.cpp        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx"> setHasReadOnlyOrGetterSetterPropertiesExcludingProto(classInfo->hasStaticSetterOrReadonlyProperties());
</span><span class="cx"> setHasNonEnumerableProperties(false);
</span><span class="cx"> setAttributesInPrevious(0);
</span><del>- setPreventExtensions(false);
</del><ins>+ setDidPreventExtensions(false);
</ins><span class="cx"> setDidTransition(false);
</span><span class="cx"> setStaticFunctionsReified(false);
</span><span class="cx"> setHasRareData(false);
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx"> setHasReadOnlyOrGetterSetterPropertiesExcludingProto(m_classInfo->hasStaticSetterOrReadonlyProperties());
</span><span class="cx"> setHasNonEnumerableProperties(false);
</span><span class="cx"> setAttributesInPrevious(0);
</span><del>- setPreventExtensions(false);
</del><ins>+ setDidPreventExtensions(false);
</ins><span class="cx"> setDidTransition(false);
</span><span class="cx"> setStaticFunctionsReified(false);
</span><span class="cx"> setHasRareData(false);
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx"> setHasReadOnlyOrGetterSetterPropertiesExcludingProto(previous->hasReadOnlyOrGetterSetterPropertiesExcludingProto());
</span><span class="cx"> setHasNonEnumerableProperties(previous->hasNonEnumerableProperties());
</span><span class="cx"> setAttributesInPrevious(0);
</span><del>- setPreventExtensions(previous->preventExtensions());
</del><ins>+ setDidPreventExtensions(previous->didPreventExtensions());
</ins><span class="cx"> setDidTransition(true);
</span><span class="cx"> setStaticFunctionsReified(previous->staticFunctionsReified());
</span><span class="cx"> setHasRareData(false);
</span><span class="lines">@@ -625,7 +625,7 @@
</span><span class="cx"> structure->materializePropertyMapIfNecessary(vm, deferGC);
</span><span class="cx"> transition->propertyTable().set(vm, transition, structure->copyPropertyTableForPinning(vm));
</span><span class="cx"> transition->m_offset = structure->m_offset;
</span><del>- transition->setPreventExtensions(true);
</del><ins>+ transition->setDidPreventExtensions(true);
</ins><span class="cx"> transition->pin();
</span><span class="cx">
</span><span class="cx"> transition->checkOffsetConsistency();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStructureh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Structure.h (197390 => 197391)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Structure.h        2016-03-01 07:39:23 UTC (rev 197390)
+++ trunk/Source/JavaScriptCore/runtime/Structure.h        2016-03-01 08:11:20 UTC (rev 197391)
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx">
</span><span class="cx"> JS_EXPORT_PRIVATE bool isSealed(VM&);
</span><span class="cx"> JS_EXPORT_PRIVATE bool isFrozen(VM&);
</span><del>- bool isExtensible() const { return !preventExtensions(); }
</del><ins>+ bool isExtensible() const { return !didPreventExtensions(); }
</ins><span class="cx"> bool putWillGrowOutOfLineStorage();
</span><span class="cx"> size_t suggestedNewOutOfLineStorageCapacity();
</span><span class="cx">
</span><span class="lines">@@ -579,7 +579,7 @@
</span><span class="cx"> DEFINE_BITFIELD(bool, hasReadOnlyOrGetterSetterPropertiesExcludingProto, HasReadOnlyOrGetterSetterPropertiesExcludingProto, 1, 4);
</span><span class="cx"> DEFINE_BITFIELD(bool, hasNonEnumerableProperties, HasNonEnumerableProperties, 1, 5);
</span><span class="cx"> DEFINE_BITFIELD(unsigned, attributesInPrevious, AttributesInPrevious, 14, 6);
</span><del>- DEFINE_BITFIELD(bool, preventExtensions, PreventExtensions, 1, 20);
</del><ins>+ DEFINE_BITFIELD(bool, didPreventExtensions, DidPreventExtensions, 1, 20);
</ins><span class="cx"> DEFINE_BITFIELD(bool, didTransition, DidTransition, 1, 21);
</span><span class="cx"> DEFINE_BITFIELD(bool, staticFunctionsReified, StaticFunctionsReified, 1, 22);
</span><span class="cx"> DEFINE_BITFIELD(bool, hasRareData, HasRareData, 1, 23);
</span></span></pre>
</div>
</div>
</body>
</html>