MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add error handling for unary operator before exponentiation

+7
+7
src/ant.c
··· 9176 9176 if (t == TOK_PLUS) t = TOK_UPLUS; 9177 9177 js->consumed = 1; 9178 9178 jsval_t operand = js_unary(js); 9179 + if (is_err(operand)) return operand; 9180 + if (next(js) == TOK_EXP) { 9181 + return js_mkerr_typed( 9182 + js, JS_ERR_SYNTAX, 9183 + "Unary operator used immediately before exponentiation expression. Parenthesis must be used to disambiguate operator precedence" 9184 + ); 9185 + } 9179 9186 return do_op(js, t, js_mkundef(), operand); 9180 9187 } 9181 9188 }