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
4aec6b10
Commit
4aec6b10
authored
Jan 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added labelled continue statement implementation.
parent
9a4e12aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
10 deletions
+40
-10
compile.c
dlls/jscript/compile.c
+40
-10
No files found.
dlls/jscript/compile.c
View file @
4aec6b10
...
...
@@ -922,6 +922,11 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr)
return
compile_expression_noret
(
ctx
,
expr
,
NULL
);
}
static
inline
BOOL
is_loop_statement
(
statement_type_t
type
)
{
return
type
==
STAT_FOR
||
type
==
STAT_FORIN
||
type
==
STAT_WHILE
;
}
/* ECMA-262 3rd Edition 12.1 */
static
HRESULT
compile_block_statement
(
compiler_ctx_t
*
ctx
,
statement_t
*
iter
)
{
...
...
@@ -1265,18 +1270,43 @@ static HRESULT compile_continue_statement(compiler_ctx_t *ctx, branch_statement_
statement_ctx_t
*
pop_ctx
;
HRESULT
hres
;
for
(
pop_ctx
=
ctx
->
stat_ctx
;
pop_ctx
;
pop_ctx
=
pop_ctx
->
next
)
{
if
(
pop_ctx
->
continue_label
)
break
;
}
if
(
stat
->
identifier
)
{
statement_t
*
label_stat
;
statement_ctx_t
*
iter
;
if
(
!
pop_ctx
)
{
WARN
(
"continue outside loop
\n
"
);
return
JS_E_INVALID_CONTINUE
;
}
pop_ctx
=
NULL
;
for
(
iter
=
ctx
->
stat_ctx
;
iter
;
iter
=
iter
->
next
)
{
if
(
iter
->
continue_label
)
pop_ctx
=
iter
;
if
(
iter
->
labelled_stat
&&
!
strcmpW
(
iter
->
labelled_stat
->
identifier
,
stat
->
identifier
))
break
;
}
if
(
stat
->
identifier
)
return
push_instr
(
ctx
,
OP_label
)
?
S_OK
:
E_OUTOFMEMORY
;
/* FIXME */
if
(
!
iter
)
{
WARN
(
"Label not found
\n
"
);
return
JS_E_LABEL_NOT_FOUND
;
}
/* Labelled continue are allowed only on loops */
for
(
label_stat
=
iter
->
labelled_stat
->
statement
;
label_stat
->
type
==
STAT_LABEL
;
label_stat
=
((
labelled_statement_t
*
)
label_stat
)
->
statement
);
if
(
!
is_loop_statement
(
label_stat
->
type
))
{
WARN
(
"Label is not a loop
\n
"
);
return
JS_E_INVALID_CONTINUE
;
}
}
else
{
for
(
pop_ctx
=
ctx
->
stat_ctx
;
pop_ctx
;
pop_ctx
=
pop_ctx
->
next
)
{
if
(
pop_ctx
->
continue_label
)
break
;
}
if
(
!
pop_ctx
)
{
WARN
(
"continue outside loop
\n
"
);
return
JS_E_INVALID_CONTINUE
;
}
}
hres
=
pop_to_stat
(
ctx
,
pop_ctx
);
if
(
FAILED
(
hres
))
...
...
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