jscript: Set error location when handling errors directly in parser.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-11-26 15:27:50 +01:00 committed by Alexandre Julliard
parent 1e94d99f31
commit b485d58293
1 changed files with 2 additions and 2 deletions

View File

@ -780,7 +780,7 @@ ObjectLiteral
{
if(ctx->script->version < 2) {
WARN("Trailing comma in object literal is illegal in legacy mode.\n");
ctx->hres = JS_E_SYNTAX;
set_error(ctx, @3, JS_E_SYNTAX);
YYABORT;
}
$$ = new_prop_and_value_expression(ctx, $2);
@ -824,7 +824,7 @@ IdentifierName
if(ctx->script->version < SCRIPTLANGUAGEVERSION_ES5) {
WARN("%s keyword used as an identifier in legacy mode.\n",
debugstr_w($1));
ctx->hres = JS_E_SYNTAX;
set_error(ctx, @$, JS_E_SYNTAX);
YYABORT;
}
$$ = $1;