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:
Joe Savona
2024-02-27 12:01:32 -08:00
parent 45216dc3d9
commit 9d5a01359f
@@ -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": {