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
1a89ea70
Commit
1a89ea70
authored
Nov 06, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Improved error handling in numeric literal parser.
parent
4d9ea4b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
lex.c
dlls/jscript/lex.c
+7
-3
api.js
dlls/jscript/tests/api.js
+7
-0
No files found.
dlls/jscript/lex.c
View file @
1a89ea70
...
@@ -454,6 +454,11 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
...
@@ -454,6 +454,11 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
else
exp
+=
e
;
else
exp
+=
e
;
}
}
if
(
is_identifier_char
(
*
ctx
->
ptr
))
{
WARN
(
"wrong char after zero
\n
"
);
return
lex_error
(
ctx
,
JS_E_MISSING_SEMICOLON
);
}
*
literal
=
new_double_literal
(
ctx
,
exp
>=
0
?
d
*
pow
(
10
,
exp
)
:
d
/
pow
(
10
,
-
exp
));
*
literal
=
new_double_literal
(
ctx
,
exp
>=
0
?
d
*
pow
(
10
,
exp
)
:
d
/
pow
(
10
,
-
exp
));
return
tNumericLiteral
;
return
tNumericLiteral
;
}
}
...
@@ -477,7 +482,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
...
@@ -477,7 +482,7 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
if
(
ctx
->
ptr
<
ctx
->
end
&&
is_identifier_char
(
*
ctx
->
ptr
))
{
if
(
ctx
->
ptr
<
ctx
->
end
&&
is_identifier_char
(
*
ctx
->
ptr
))
{
WARN
(
"unexpected identifier char
\n
"
);
WARN
(
"unexpected identifier char
\n
"
);
return
lex_error
(
ctx
,
E_FAIL
);
return
lex_error
(
ctx
,
JS_E_MISSING_SEMICOLON
);
}
}
*
literal
=
new_double_literal
(
ctx
,
l
);
*
literal
=
new_double_literal
(
ctx
,
l
);
...
@@ -512,9 +517,8 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
...
@@ -512,9 +517,8 @@ static int parse_numeric_literal(parser_ctx_t *ctx, literal_t **literal)
if
(
is_identifier_char
(
*
ctx
->
ptr
))
{
if
(
is_identifier_char
(
*
ctx
->
ptr
))
{
WARN
(
"wrong char after zero
\n
"
);
WARN
(
"wrong char after zero
\n
"
);
return
lex_error
(
ctx
,
E_FAIL
);
return
lex_error
(
ctx
,
JS_E_MISSING_SEMICOLON
);
}
}
}
}
return
parse_double_literal
(
ctx
,
l
,
literal
);
return
parse_double_literal
(
ctx
,
l
,
literal
);
...
...
dlls/jscript/tests/api.js
View file @
1a89ea70
...
@@ -2357,6 +2357,13 @@ testSyntaxError("ok(false, 'unexpected execution'); while(true) continue some_la
...
@@ -2357,6 +2357,13 @@ testSyntaxError("ok(false, 'unexpected execution'); while(true) continue some_la
testSyntaxError
(
"ok(false, 'unexpected execution'); some_label: { while(true) continue some_label; }"
,
"E_INVALID_CONTINUE"
);
testSyntaxError
(
"ok(false, 'unexpected execution'); some_label: { while(true) continue some_label; }"
,
"E_INVALID_CONTINUE"
);
testSyntaxError
(
"ok(false, 'unexpected execution'); some_label: { some_label: while(true); }"
,
"E_LABEL_REDEFINED"
);
testSyntaxError
(
"ok(false, 'unexpected execution'); some_label: { some_label: while(true); }"
,
"E_LABEL_REDEFINED"
);
testSyntaxError
(
"return;"
,
"E_MISPLACED_RETURN"
);
testSyntaxError
(
"return;"
,
"E_MISPLACED_RETURN"
);
testSyntaxError
(
"001.5;"
,
"E_SEMICOLON"
);
testSyntaxError
(
"001.5"
,
"E_SEMICOLON"
);
testSyntaxError
(
"0a"
,
"E_SEMICOLON"
);
testSyntaxError
(
"01a"
,
"E_SEMICOLON"
);
testSyntaxError
(
"0x1r"
,
"E_SEMICOLON"
);
testSyntaxError
(
"1a"
,
"E_SEMICOLON"
);
testSyntaxError
(
"1_"
,
"E_SEMICOLON"
);
// ReferenceError tests
// ReferenceError tests
testException
(
function
()
{
test
=
function
()
{}},
"E_ILLEGAL_ASSIGN"
);
testException
(
function
()
{
test
=
function
()
{}},
"E_ILLEGAL_ASSIGN"
);
...
...
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