Title: [267440] trunk
Revision
267440
Author
[email protected]
Date
2020-09-22 15:23:08 -0700 (Tue, 22 Sep 2020)

Log Message

Coerce computed property before adding to |excludedList|
https://bugs.webkit.org/show_bug.cgi?id=216437

Patch by HyeockJin Kim <[email protected]> on 2020-09-22
Reviewed by Yusuke Suzuki.

JSTests:

* stress/object-rest-deconstruct.js:
(get 3):

Source/_javascript_Core:

* bytecompiler/NodesCodegen.cpp:
(JSC::ObjectPatternNode::bindValue const):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (267439 => 267440)


--- trunk/JSTests/ChangeLog	2020-09-22 22:21:43 UTC (rev 267439)
+++ trunk/JSTests/ChangeLog	2020-09-22 22:23:08 UTC (rev 267440)
@@ -1,3 +1,13 @@
+2020-09-22  HyeockJin Kim  <[email protected]>
+
+        Coerce computed property before adding to |excludedList|
+        https://bugs.webkit.org/show_bug.cgi?id=216437
+
+        Reviewed by Yusuke Suzuki.
+
+        * stress/object-rest-deconstruct.js:
+        (get 3):
+
 2020-09-21  Yusuke Suzuki  <[email protected]>
 
         [JSC] BigInt should work with Map / Set

Modified: trunk/JSTests/stress/object-rest-deconstruct.js (267439 => 267440)


--- trunk/JSTests/stress/object-rest-deconstruct.js	2020-09-22 22:21:43 UTC (rev 267439)
+++ trunk/JSTests/stress/object-rest-deconstruct.js	2020-09-22 22:23:08 UTC (rev 267440)
@@ -202,6 +202,27 @@
     assert(r.baz === 3);
 })();
 
+// Destructuring non-string computed property
+(() => {
+    var a = 1;
+    var {[a]: b, ...r} = {[a]: 1, b: 2, c: 3};
+    assert(b === 1);
+    assert(r[1] === undefined);
+    assert(r.b === 2);
+    assert(r.c === 3);
+})();
+
+// Destructuring Symbol computed property
+(() => {
+    var a = Symbol('a');
+    var b = Symbol('a');
+    var {[a]: c, ...r} = {[b]: 1, b: 2, c: 3};
+    assert(c === undefined);
+    assert(r[b] === 1);
+    assert(r.b === 2);
+    assert(r.c === 3);
+})();
+
 // Catch case
 
 (() => {

Modified: trunk/Source/_javascript_Core/ChangeLog (267439 => 267440)


--- trunk/Source/_javascript_Core/ChangeLog	2020-09-22 22:21:43 UTC (rev 267439)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-09-22 22:23:08 UTC (rev 267440)
@@ -1,3 +1,13 @@
+2020-09-22  HyeockJin Kim  <[email protected]>
+
+        Coerce computed property before adding to |excludedList|
+        https://bugs.webkit.org/show_bug.cgi?id=216437
+
+        Reviewed by Yusuke Suzuki.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::ObjectPatternNode::bindValue const):
+
 2020-09-21  Paulo Matos  <[email protected]>
 
         Fix MIPS leai,leap when offset is nonzero

Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (267439 => 267440)


--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2020-09-22 22:21:43 UTC (rev 267439)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2020-09-22 22:23:08 UTC (rev 267440)
@@ -5233,7 +5233,9 @@
 
             if (m_containsRestElement) {
                 if (m_containsComputedProperty) {
-                    if (!target.propertyExpression)
+                    if (target.propertyExpression)
+                        generator.emitToPropertyKey(propertyName.get(), propertyName.get());
+                    else
                         propertyName = generator.emitLoad(nullptr, target.propertyName);
 
                     CallArguments args(generator, nullptr, 1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to