Skip to content

Commit

Permalink
source-debug: remove env for start function (#111)
Browse files Browse the repository at this point in the history
Signed-off-by: zhenweijin <[email protected]>
  • Loading branch information
kylo5aby authored Dec 18, 2023
1 parent 783e9af commit 12f6345
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/binaryen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,10 @@ export class WASMGen extends Ts2wasmBackend {
}
}
this.parseBody(func.body);
this.currentFuncCtx.localVarIdxNameMap.set('@context', 0);
this.currentFuncCtx.localVarIdxNameMap.set('@this', 1);
if (!(func.ownKind & FunctionOwnKind.START)) {
this.currentFuncCtx.localVarIdxNameMap.set('@context', 0);
this.currentFuncCtx.localVarIdxNameMap.set('@this', 1);
}
if (func.parameters) {
for (const p of func.parameters) {
/** must no duplicate parameter name here */
Expand Down

0 comments on commit 12f6345

Please sign in to comment.