Skip to content

Commit

Permalink
Fix tagged template this in strict mode (#3307)
Browse files Browse the repository at this point in the history
In strict mode `this` should be undefined.
  • Loading branch information
HalidOdat authored Sep 25, 2023
1 parent 1b03f83 commit fd2e558
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions boa_engine/src/bytecompiler/expression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ impl ByteCompiler<'_, '_> {
self.emit(Opcode::GetPrivateField, &[Operand::U32(index)]);
}
expr => {
self.emit_opcode(Opcode::PushUndefined);
self.compile_expr(expr, true);
self.emit_opcode(Opcode::This);
self.emit_opcode(Opcode::Swap);
}
}

Expand Down
3 changes: 1 addition & 2 deletions boa_engine/src/bytecompiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1441,9 +1441,8 @@ impl<'ctx, 'host> ByteCompiler<'ctx, 'host> {
kind = CallKind::CallEval;
}
}
self.compile_expr(expr, true);
self.emit_opcode(Opcode::PushUndefined);
self.emit_opcode(Opcode::Swap);
self.compile_expr(expr, true);
}
expr => {
self.compile_expr(expr, true);
Expand Down

0 comments on commit fd2e558

Please sign in to comment.