babel / babylon

PSA: moved into babel/babel as @babel/parser -->

Home Page:https://github.com/babel/babel/tree/master/packages/babel-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static field initializer as an arrow function containing new.target is not allowed

gsathya opened this issue · comments

Input Code

class X {
  static c = () => new.target;
}

Babylon/Babel Configuration

stage2, stage3

Expected Behavior

No error

Current Behavior

repl: new.target can only be used in functions (2:23)
  1 | class X {
> 2 |   static c = () => new.target;
    |                        ^
  3 | }

Your Environment

REPL