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
1edd64ef
Commit
1edd64ef
authored
Sep 10, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added if statement implementation.
parent
eedc6dc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
engine.c
dlls/jscript/engine.c
+26
-3
lang.js
dlls/jscript/tests/lang.js
+24
-0
No files found.
dlls/jscript/engine.c
View file @
1edd64ef
...
...
@@ -566,10 +566,33 @@ HRESULT expression_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_ty
return
S_OK
;
}
HRESULT
if_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
/* ECMA-262 3rd Edition 12.5 */
HRESULT
if_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
_stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
if_statement_t
*
stat
=
(
if_statement_t
*
)
_stat
;
exprval_t
exprval
;
VARIANT_BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
expr_eval
(
ctx
,
stat
->
expr
,
0
,
&
rt
->
ei
,
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
exprval_to_boolean
(
ctx
->
parser
->
script
,
&
exprval
,
&
rt
->
ei
,
&
b
);
exprval_release
(
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
b
)
hres
=
stat_eval
(
ctx
,
stat
->
if_stat
,
rt
,
ret
);
else
if
(
stat
->
else_stat
)
hres
=
stat_eval
(
ctx
,
stat
->
else_stat
,
rt
,
ret
);
else
V_VT
(
ret
)
=
VT_EMPTY
;
return
hres
;
}
HRESULT
dowhile_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
...
...
dlls/jscript/tests/lang.js
View file @
1edd64ef
...
...
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
var
tmp
;
ok
(
true
,
"true is not true?"
);
ok
(
!
false
,
"!false is not true"
);
ok
(
!
undefined
,
"!undefined is not true"
);
...
...
@@ -116,4 +118,26 @@ obj2.pvar = 3;
testConstr1
.
prototype
.
pvar
=
1
;
ok
(
obj2
.
pvar
===
3
,
"obj2.pvar is not 3"
);
tmp
=
0
;
if
(
true
)
tmp
=
1
;
else
ok
(
false
,
"else evaluated"
);
ok
(
tmp
===
1
,
"tmp !== 1, if not evaluated?"
);
tmp
=
0
;
if
(
1
===
0
)
ok
(
false
,
"if evaluated"
);
else
tmp
=
1
;
ok
(
tmp
===
1
,
"tmp !== 1, if not evaluated?"
);
if
(
false
)
ok
(
false
,
"if(false) evaluated"
);
tmp
=
0
;
if
(
true
)
tmp
=
1
;
ok
(
tmp
===
1
,
"tmp !== 1, if(true) not evaluated?"
);
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