mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Move creation of scopes for primitives into a separate pass
Rather than force scopes to be created for primitives within InferReactiveScopeVariables, here we move the creation of scopes for these instructions to a later pass. Later in the pipeline we have more context, such as whether e.g. a primitive or propertyload is being accessed within a scope or not, and whether it therefore needs its own scope or not.
This commit is contained in:
+2
-4
@@ -154,13 +154,11 @@ function mayAllocate(env: Environment, instruction: Instruction): boolean {
|
||||
case "NextIterableOf":
|
||||
case "NextPropertyOf":
|
||||
case "Debugger":
|
||||
case "Memoize": {
|
||||
return false;
|
||||
}
|
||||
case "Memoize":
|
||||
case "UnaryExpression":
|
||||
case "BinaryExpression":
|
||||
case "PropertyLoad": {
|
||||
return env.config.enableForest;
|
||||
return false;
|
||||
}
|
||||
case "CallExpression":
|
||||
case "MethodCall": {
|
||||
|
||||
Reference in New Issue
Block a user