Title: [196042] trunk/Source/_javascript_Core
- Revision
- 196042
- Author
- [email protected]
- Date
- 2016-02-02 20:22:39 -0800 (Tue, 02 Feb 2016)
Log Message
[JSC] make Object.getOwnPropertyDescriptors() work with non-JSObject types
https://bugs.webkit.org/show_bug.cgi?id=153814
Patch by Caitlin Potter <[email protected]> on 2016-02-02
Reviewed by Yusuke Suzuki.
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptors):
* tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js:
(testGlobalProxy):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (196041 => 196042)
--- trunk/Source/_javascript_Core/ChangeLog 2016-02-03 04:16:45 UTC (rev 196041)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-02-03 04:22:39 UTC (rev 196042)
@@ -1,3 +1,15 @@
+2016-02-02 Caitlin Potter <[email protected]>
+
+ [JSC] make Object.getOwnPropertyDescriptors() work with non-JSObject types
+ https://bugs.webkit.org/show_bug.cgi?id=153814
+
+ Reviewed by Yusuke Suzuki.
+
+ * runtime/ObjectConstructor.cpp:
+ (JSC::objectConstructorGetOwnPropertyDescriptors):
+ * tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js:
+ (testGlobalProxy):
+
2016-02-02 Aakash Jain <[email protected]>
Remove references to CallFrameInlines.h
Modified: trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp (196041 => 196042)
--- trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp 2016-02-03 04:16:45 UTC (rev 196041)
+++ trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp 2016-02-03 04:22:39 UTC (rev 196042)
@@ -251,7 +251,7 @@
JSValue objectConstructorGetOwnPropertyDescriptors(ExecState* exec, JSObject* object)
{
PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
- object->getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+ object->methodTable(exec->vm())->getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
if (exec->hadException())
return jsUndefined();
Modified: trunk/Source/_javascript_Core/tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js (196041 => 196042)
--- trunk/Source/_javascript_Core/tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js 2016-02-03 04:16:45 UTC (rev 196041)
+++ trunk/Source/_javascript_Core/tests/es6/Object_static_methods_Object.getOwnPropertyDescriptors.js 2016-02-03 04:22:39 UTC (rev 196042)
@@ -81,3 +81,14 @@
shouldBe(result.c.writable, false);
shouldBe(result.c.value, 'C');
})();
+
+(function testGlobalProxy(global) {
+ var symbol = Symbol('test');
+ global[symbol] = 'Symbol(test)';
+
+ var result = Object.getOwnPropertyDescriptors(global);
+
+ shouldBeDataProperty(result[symbol], 'Symbol(test)', 'global[Symbol(test)]');
+ // FIXME: Can't delete Symbol properties from a JSSymbolTableObject.
+ // delete global[symbol];
+})(this);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes