Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f3d24fdd
Commit
f3d24fdd
authored
Jul 24, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Throw more SyntaxErrors in parser.
parent
67c8a3e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
parser.y
dlls/jscript/parser.y
+11
-7
api.js
dlls/jscript/tests/api.js
+2
-0
No files found.
dlls/jscript/parser.y
View file @
f3d24fdd
...
...
@@ -202,7 +202,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state
%type <statement> Finally
%type <statement_list> StatementList StatementList_opt
%type <parameter_list> FormalParameterList FormalParameterList_opt
%type <expr> Expression Expression_opt
%type <expr> Expression Expression_opt
Expression_err
%type <expr> ExpressionNoIn ExpressionNoIn_opt
%type <expr> FunctionExpression
%type <expr> AssignmentExpression AssignmentExpressionNoIn
...
...
@@ -381,16 +381,16 @@ ExpressionStatement
/* ECMA-262 3rd Edition 12.5 */
IfStatement
: kIF left_bracket Expression right_bracket Statement kELSE Statement
: kIF left_bracket Expression
_err
right_bracket Statement kELSE Statement
{ $$ = new_if_statement(ctx, $3, $5, $7); }
| kIF left_bracket Expression right_bracket Statement %prec LOWER_THAN_ELSE
| kIF left_bracket Expression
_err
right_bracket Statement %prec LOWER_THAN_ELSE
{ $$ = new_if_statement(ctx, $3, $5, NULL); }
/* ECMA-262 3rd Edition 12.6 */
IterationStatement
: kDO Statement kWHILE left_bracket Expression right_bracket semicolon_opt
: kDO Statement kWHILE left_bracket Expression
_err
right_bracket semicolon_opt
{ $$ = new_while_statement(ctx, TRUE, $5, $2); }
| kWHILE left_bracket Expression right_bracket Statement
| kWHILE left_bracket Expression
_err
right_bracket Statement
{ $$ = new_while_statement(ctx, FALSE, $3, $5); }
| kFOR left_bracket ExpressionNoIn_opt
{ if(!explicit_error(ctx, $3, ';')) YYABORT; }
...
...
@@ -404,9 +404,9 @@ IterationStatement
{ if(!explicit_error(ctx, $7, ';')) YYABORT; }
semicolon Expression_opt right_bracket Statement
{ $$ = new_for_statement(ctx, $4, NULL, $7, $10, $12); }
| kFOR left_bracket LeftHandSideExpression kIN Expression right_bracket Statement
| kFOR left_bracket LeftHandSideExpression kIN Expression
_err
right_bracket Statement
{ $$ = new_forin_statement(ctx, NULL, $3, $5, $7); }
| kFOR left_bracket kVAR VariableDeclarationNoIn kIN Expression right_bracket Statement
| kFOR left_bracket kVAR VariableDeclarationNoIn kIN Expression
_err
right_bracket Statement
{ $$ = new_forin_statement(ctx, $4, NULL, $6, $8); }
/* ECMA-262 3rd Edition 12.7 */
...
...
@@ -493,6 +493,10 @@ Expression_opt
: /* empty */ { $$ = NULL; }
| Expression { $$ = $1; }
Expression_err
: Expression { $$ = $1; }
| error { set_error(ctx, IDS_SYNTAX_ERROR); YYABORT; }
/* ECMA-262 3rd Edition 11.14 */
Expression
: AssignmentExpression { $$ = $1; }
...
...
dlls/jscript/tests/api.js
View file @
f3d24fdd
...
...
@@ -1331,5 +1331,7 @@ exception_test(function() {eval("while(true");}, "SyntaxError", -2146827282);
exception_test
(
function
()
{
test
=
function
()
{}},
"ReferenceError"
,
-
2146823280
);
exception_test
(
function
()
{
eval
(
"for(i=0"
)},
"SyntaxError"
,
-
2146827284
);
exception_test
(
function
()
{
eval
(
"for(i=0;i<10"
)},
"SyntaxError"
,
-
2146827284
);
exception_test
(
function
()
{
eval
(
"while("
)},
"SyntaxError"
,
-
2146827286
);
exception_test
(
function
()
{
eval
(
"if("
)},
"SyntaxError"
,
-
2146827286
);
reportSuccess
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment