@ -492,7 +492,7 @@ impl Context {
let result = match Self::parser_expr(src) {
Ok(expr) => expr.run(self),
Err(e) => self.throw_type_error(e),
Err(e) => self.throw_syntax_error(e),
};
// The main_timer needs to be dropped before the BoaProfiler is.
@ -1377,3 +1377,9 @@ fn test_conditional_op() {
let scenario = "1 === 2 ? 'a' : 'b'";
assert_eq!(&exec(scenario), "\"b\"");
}
#[test]
fn test_identifier_op() {
let scenario = "break = 1";
assert_eq!(&exec(scenario), "\"SyntaxError\": \"expected token \'identifier\', got \'=\' in binding identifier at line 1, col 7\"");