You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var__accessCheck=(obj,member,msg)=>{if(!member.has(obj))throwTypeError("Cannot "+msg);};var__privateGet=(obj,member,getter)=>{__accessCheck(obj,member,"read from private field");returngetter ? getter.call(obj) : member.get(obj);};var__privateSet=(obj,member,value,setter)=>{__accessCheck(obj,member,"write to private field");setter ? setter.call(obj,value) : member.set(obj,value);returnvalue;};var_e;exportclassA{}exportclassBextendsA{constructor(c){_e.set(this,void0);// ReferenceError: must call super constructor// before using 'this' in derived class constructor.var_a;super();__privateSet(this,_e,(_a=c.d)!=null ? _a : "test");}f(){return__privateGet(this,_e);}}_e=newWeakMap();
It seems to be a combination of using a private field, the ?? operator, and a nested value, c.d, which creates _a.
The text was updated successfully, but these errors were encountered:
In certain cases, esbuild can generate a constructor that will use
this
beforesuper()
gets called.You can reproduce it with this TS code and
--target=es2019
:Which transforms into:
It seems to be a combination of using a private field, the
??
operator, and a nested value,c.d
, which creates_a
.The text was updated successfully, but these errors were encountered: