[JSC] Symbol structure has unnecessary flags
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Feb 2016 05:38:33 +0000 (05:38 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Feb 2016 05:38:33 +0000 (05:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153840

Reviewed by Saam Barati.

* runtime/Symbol.h:
* tests/stress/symbol-get-own-property.js: Added.
(shouldBe):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196107 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Symbol.h
Source/JavaScriptCore/tests/stress/symbol-get-own-property.js [new file with mode: 0644]

index 1c2ab8e..107ff25 100644 (file)
@@ -1,3 +1,14 @@
+2016-02-03  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [JSC] Symbol structure has unnecessary flags
+        https://bugs.webkit.org/show_bug.cgi?id=153840
+
+        Reviewed by Saam Barati.
+
+        * runtime/Symbol.h:
+        * tests/stress/symbol-get-own-property.js: Added.
+        (shouldBe):
+
 2016-02-03  Andreas Kling  <akling@apple.com>
 
         [iOS] Throw away linked code when navigating to a new page.
index 83f5de2..cfdabe6 100644 (file)
@@ -37,7 +37,7 @@ namespace JSC {
 class Symbol final : public JSCell {
 public:
     typedef JSCell Base;
-    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | StructureIsImmortal;
+    static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
 
     DECLARE_EXPORT_INFO;
 
diff --git a/Source/JavaScriptCore/tests/stress/symbol-get-own-property.js b/Source/JavaScriptCore/tests/stress/symbol-get-own-property.js
new file mode 100644 (file)
index 0000000..33b14a5
--- /dev/null
@@ -0,0 +1,14 @@
+function shouldBe(actual, expected) {
+    if (actual !== expected)
+        throw new Error('bad value: ' + actual);
+}
+
+var symbol = Symbol("Cocoa");
+shouldBe(symbol[0], undefined);
+
+// ToObject(symbol).
+symbol[0] = "Hello";
+shouldBe(symbol[0], undefined);
+
+Symbol.prototype[30] = 42;
+shouldBe(symbol[30], 42);