⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267440 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 3:23:08 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by HyeockJin Kim <kherootz@gmail.com> on 2020-09-22
Reviewed by Yusuke Suzuki.

JSTests:

  • stress/object-rest-deconstruct.js:

(get 3):

Source/JavaScriptCore:

  • bytecompiler/NodesCodegen.cpp:

(JSC::ObjectPatternNode::bindValue const):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r267373 r267440  
     12020-09-22  HyeockJin Kim  <kherootz@gmail.com>
     2
     3        Coerce computed property before adding to |excludedList|
     4        https://bugs.webkit.org/show_bug.cgi?id=216437
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * stress/object-rest-deconstruct.js:
     9        (get 3):
     10
    1112020-09-21  Yusuke Suzuki  <ysuzuki@apple.com>
    212
  • trunk/JSTests/stress/object-rest-deconstruct.js

    r218861 r267440  
    203203})();
    204204
     205// Destructuring non-string computed property
     206(() => {
     207    var a = 1;
     208    var {[a]: b, ...r} = {[a]: 1, b: 2, c: 3};
     209    assert(b === 1);
     210    assert(r[1] === undefined);
     211    assert(r.b === 2);
     212    assert(r.c === 3);
     213})();
     214
     215// Destructuring Symbol computed property
     216(() => {
     217    var a = Symbol('a');
     218    var b = Symbol('a');
     219    var {[a]: c, ...r} = {[b]: 1, b: 2, c: 3};
     220    assert(c === undefined);
     221    assert(r[b] === 1);
     222    assert(r.b === 2);
     223    assert(r.c === 3);
     224})();
     225
    205226// Catch case
    206227
  • trunk/Source/JavaScriptCore/ChangeLog

    r267395 r267440  
     12020-09-22  HyeockJin Kim  <kherootz@gmail.com>
     2
     3        Coerce computed property before adding to |excludedList|
     4        https://bugs.webkit.org/show_bug.cgi?id=216437
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * bytecompiler/NodesCodegen.cpp:
     9        (JSC::ObjectPatternNode::bindValue const):
     10
    1112020-09-21  Paulo Matos  <pmatos@igalia.com>
    212
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r266778 r267440  
    52345234            if (m_containsRestElement) {
    52355235                if (m_containsComputedProperty) {
    5236                     if (!target.propertyExpression)
     5236                    if (target.propertyExpression)
     5237                        generator.emitToPropertyKey(propertyName.get(), propertyName.get());
     5238                    else
    52375239                        propertyName = generator.emitLoad(nullptr, target.propertyName);
    52385240
Note: See TracChangeset for help on using the changeset viewer.