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
{{ message }}
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Here's a strange issue that I've been running into with the React Native bundle. Our module system initializes and when doing so, can run into cases where there's an abstract conditional that might throw. The throw seems to break the execution flow for function constructors, something that shouldn't happen.
Here's a repro:
functionmodule(){varx=global.__abstract ? __abstract("boolean","(true)") : true;// if the throw is remove, the string below gets inlined correctlyif(!x){thrownewError("An error");}varComponent=function(){functionComponent(){this.someMethod=function(){return"This should be inlined!";};}returnComponent;}();functionfn(x){varinstance=newComponent();returninstance.someMethod();}global.__optimize&&__optimize(fn);returnfn;}global.result=module();
When we get to var instance = new Component();. Prepack wrongly thinks that Component is a conditional abstract value of undefined | Constructor, because of the above throw. This results in bailing out and the code never inlining – something that break the React reconciler when dealing with React class components (we don't support conditional constructors).
The text was updated successfully, but these errors were encountered:
Here's a strange issue that I've been running into with the React Native bundle. Our module system initializes and when doing so, can run into cases where there's an abstract conditional that might throw. The throw seems to break the execution flow for function constructors, something that shouldn't happen.
Here's a repro:
When we get to
var instance = new Component();
. Prepack wrongly thinks thatComponent
is a conditional abstract value ofundefined | Constructor
, because of the above throw. This results in bailing out and the code never inlining – something that break the React reconciler when dealing with React class components (we don't support conditional constructors).The text was updated successfully, but these errors were encountered: