Changeset 271420 in webkit


Ignore:
Timestamp:
Jan 12, 2021 4:05:54 PM (3 years ago)
Author:
Caio Lima
Message:

[ESNext] super accesses broken on arrow functions defined as class field
https://bugs.webkit.org/show_bug.cgi?id=220558

Reviewed by Darin Adler.

JSTests:

  • stress/class-field-arrow-function-using-super.js: Added.

Source/JavaScriptCore:

We need to properly set isClassContext for class fields
initialization.

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::generateUnlinkedFunctionCodeBlock):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r271343 r271420  
     12021-01-12  Caio Lima  <ticaiolima@gmail.com>
     2
     3        [ESNext] super accesses broken on arrow functions defined as class field
     4        https://bugs.webkit.org/show_bug.cgi?id=220558
     5
     6        Reviewed by Darin Adler.
     7
     8        * stress/class-field-arrow-function-using-super.js: Added.
     9
    1102021-01-08  Alexey Shvayka  <shvaikalesh@gmail.com>
    211
  • trunk/Source/JavaScriptCore/ChangeLog

    r271415 r271420  
     12021-01-12  Caio Lima  <ticaiolima@gmail.com>
     2
     3        [ESNext] super accesses broken on arrow functions defined as class field
     4        https://bugs.webkit.org/show_bug.cgi?id=220558
     5
     6        Reviewed by Darin Adler.
     7
     8        We need to properly set `isClassContext` for class fields
     9        initialization.
     10
     11        * bytecode/UnlinkedFunctionExecutable.cpp:
     12        (JSC::generateUnlinkedFunctionCodeBlock):
     13
    1142021-01-12  Don Olmstead  <don.olmstead@sony.com>
    215
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp

    r270870 r271420  
    6969    executable->recordParse(function->features(), function->hasCapturedVariables());
    7070
    71     bool isClassContext = executable->superBinding() == SuperBinding::Needed;
     71    bool isClassContext = executable->superBinding() == SuperBinding::Needed || executable->parseMode() == SourceParseMode::ClassFieldInitializerMode;
    7272
    7373    UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(vm, FunctionCode, ExecutableInfo(function->usesEval(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind(), scriptMode, executable->superBinding(), parseMode, executable->derivedContextType(), executable->needsClassFieldInitializer(), false, isClassContext, EvalContextType::FunctionEvalContext), codeGenerationMode);
Note: See TracChangeset for help on using the changeset viewer.