Changeset 278510 in webkit


Ignore:
Timestamp:
Jun 4, 2021 4:44:21 PM (14 months ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Private static method should define privateClassBrandIdentifier in class-scope
https://bugs.webkit.org/show_bug.cgi?id=226656
rdar://78313139

Reviewed by Keith Miller.

JSTests:

  • stress/private-in-error.js: Added.

(shouldThrow):
(x):
(prototype.foo):

  • stress/private-static-method-declaration-error.js: Added.

(shouldThrow):
(prototype.get x):
(prototype.foo.D.a):
(prototype.foo.D.prototype.b):
(prototype.foo.D):
(prototype.foo):

Source/JavaScriptCore:

We accidentally made declaresStaticPrivateMethod always false.
This patch fixes that so that we properly define privateClassBrandIdentifier field in the class-scope if static-private-method is defined.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseClass):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r278473 r278510  
     12021-06-04  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Private static method should define privateClassBrandIdentifier in class-scope
     4        https://bugs.webkit.org/show_bug.cgi?id=226656
     5        rdar://78313139
     6
     7        Reviewed by Keith Miller.
     8
     9        * stress/private-in-error.js: Added.
     10        (shouldThrow):
     11        (x):
     12        (prototype.foo):
     13        * stress/private-static-method-declaration-error.js: Added.
     14        (shouldThrow):
     15        (prototype.get x):
     16        (prototype.foo.D.a):
     17        (prototype.foo.D.prototype.b):
     18        (prototype.foo.D):
     19        (prototype.foo):
     20
    1212021-06-04  Mark Lam  <mark.lam@apple.com>
    222
  • trunk/Source/JavaScriptCore/ChangeLog

    r278476 r278510  
     12021-06-04  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Private static method should define privateClassBrandIdentifier in class-scope
     4        https://bugs.webkit.org/show_bug.cgi?id=226656
     5        rdar://78313139
     6
     7        Reviewed by Keith Miller.
     8
     9        We accidentally made `declaresStaticPrivateMethod` always `false`.
     10        This patch fixes that so that we properly define privateClassBrandIdentifier field in the class-scope if static-private-method is defined.
     11
     12        * parser/Parser.cpp:
     13        (JSC::Parser<LexerType>::parseClass):
     14
    1152021-06-04  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r278253 r278510  
    30343034
    30353035                if (tag == ClassElementTag::Static)
    3036                     declaresStaticPrivateAccessor = true;
     3036                    declaresStaticPrivateMethod = true;
    30373037                else
    30383038                    declaresPrivateMethod = true;
Note: See TracChangeset for help on using the changeset viewer.