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
169f92b5
Commit
169f92b5
authored
Oct 15, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Oct 15, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fix shift/reduce conflict in IfStatement rule.
The famous "dangling else" problem.
parent
7b9e827a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
parser.y
dlls/jscript/parser.y
+4
-1
lang.js
dlls/jscript/tests/lang.js
+12
-0
No files found.
dlls/jscript/parser.y
View file @
169f92b5
...
...
@@ -253,6 +253,9 @@ static source_elements_t *source_elements_add_function(source_elements_t*,functi
%type <literal> BooleanLiteral
%type <srcptr> KFunction
%nonassoc LOWER_THAN_ELSE
%nonassoc kELSE
%%
/* ECMA-262 3rd Edition 14 */
...
...
@@ -389,7 +392,7 @@ ExpressionStatement
IfStatement
: kIF '(' Expression ')' Statement kELSE Statement
{ $$ = new_if_statement(ctx, $3, $5, $7); }
| kIF '(' Expression ')' Statement
| kIF '(' Expression ')' Statement
%prec LOWER_THAN_ELSE
{ $$ = new_if_statement(ctx, $3, $5, NULL); }
/* ECMA-262 3rd Edition 12.6 */
...
...
dlls/jscript/tests/lang.js
View file @
169f92b5
...
...
@@ -773,6 +773,18 @@ try {
ok
(
false
,
"deleteTest not throwed exception?"
);
}
catch
(
ex
)
{}
if
(
false
)
if
(
true
)
ok
(
false
,
"if evaluated"
);
else
ok
(
false
,
"else should be associated with nearest if statement"
);
if
(
true
)
if
(
false
)
ok
(
false
,
"if evaluated"
);
else
ok
(
true
,
"else should be associated with nearest if statement"
);
ok
(
isNaN
(
0.5
)
===
false
,
"isNaN(0.5) !== false"
);
ok
(
isNaN
()
===
true
,
"isNaN() !== true"
);
...
...
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