Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4cabe361
Commit
4cabe361
authored
Oct 16, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Allow trailing comma in object literals.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
adcb2162
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
parser.y
dlls/jscript/parser.y
+8
-0
lang.js
dlls/jscript/tests/lang.js
+14
-0
No files found.
dlls/jscript/parser.y
View file @
4cabe361
...
...
@@ -778,6 +778,14 @@ ObjectLiteral
: '{' '}' { $$ = new_prop_and_value_expression(ctx, NULL); }
| '{' PropertyNameAndValueList '}'
{ $$ = new_prop_and_value_expression(ctx, $2); }
| '{' PropertyNameAndValueList ',' '}'
{
if(ctx->script->version < 2) {
WARN("Trailing comma in object literal is illegal in legacy mode.\n");
YYABORT;
}
$$ = new_prop_and_value_expression(ctx, $2);
}
/* ECMA-262 3rd Edition 11.1.5 */
PropertyNameAndValueList
...
...
dlls/jscript/tests/lang.js
View file @
4cabe361
...
...
@@ -480,6 +480,20 @@ ok(obj3.prop1 === 1, "obj3.prop1 is not 1");
ok
(
obj3
.
prop2
===
"boolean"
,
"obj3.prop2 is not
\"
boolean
\"
"
);
ok
(
obj3
.
constructor
===
Object
,
"unexpected obj3.constructor"
);
if
(
invokeVersion
>=
2
)
{
eval
(
"tmp = {prop: 'value',}"
);
ok
(
tmp
.
prop
===
"value"
,
"tmp.prop = "
+
tmp
.
prop
);
eval
(
"tmp = {prop: 'value',second:2,}"
);
ok
(
tmp
.
prop
===
"value"
,
"tmp.prop = "
+
tmp
.
prop
);
}
else
{
try
{
eval
(
"tmp = {prop: 'value',}"
);
}
catch
(
e
)
{
tmp
=
true
;
}
ok
(
tmp
===
true
,
"exception not fired"
);
}
{
var
blockVar
=
1
;
blockVar
=
2
;
...
...
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