fix(compiler): ensure jit external id arguments names are unique
Fixes: #17558, #17378, #8676
This commit is contained in:

committed by
Alex Rickabaugh

parent
e20cfe1bbc
commit
95635c18c7
@ -43,7 +43,7 @@ export function jitStatements(sourceUrl: string, statements: o.Statement[]): {[k
|
||||
return evalExpression(sourceUrl, ctx, converter.getArgs());
|
||||
}
|
||||
|
||||
class JitEmitterVisitor extends AbstractJsEmitterVisitor {
|
||||
export class JitEmitterVisitor extends AbstractJsEmitterVisitor {
|
||||
private _evalArgNames: string[] = [];
|
||||
private _evalArgValues: any[] = [];
|
||||
private _evalExportedVars: string[] = [];
|
||||
@ -69,7 +69,7 @@ class JitEmitterVisitor extends AbstractJsEmitterVisitor {
|
||||
id = this._evalArgValues.length;
|
||||
this._evalArgValues.push(value);
|
||||
const name = identifierName({reference: ast.value.runtime}) || 'val';
|
||||
this._evalArgNames.push(`jit_${name}${id}`);
|
||||
this._evalArgNames.push(`jit_${name}_${id}`);
|
||||
}
|
||||
ctx.print(ast, this._evalArgNames[id]);
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user