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
23ccc9a2
Commit
23ccc9a2
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 conditional expression implementation.
parent
026bbea6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
engine.c
dlls/jscript/engine.c
+19
-3
lang.js
dlls/jscript/tests/lang.js
+3
-0
No files found.
dlls/jscript/engine.c
View file @
23ccc9a2
...
...
@@ -781,10 +781,26 @@ HRESULT function_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD fla
return
S_OK
;
}
HRESULT
conditional_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
/* ECMA-262 3rd Edition 11.12 */
HRESULT
conditional_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
conditional_expression_t
*
expr
=
(
conditional_expression_t
*
)
_expr
;
exprval_t
exprval
;
VARIANT_BOOL
b
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
expr_eval
(
ctx
,
expr
->
expression
,
0
,
ei
,
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
exprval_to_boolean
(
ctx
->
parser
->
script
,
&
exprval
,
ei
,
&
b
);
exprval_release
(
&
exprval
);
if
(
FAILED
(
hres
))
return
hres
;
return
expr_eval
(
ctx
,
b
?
expr
->
true_expression
:
expr
->
false_expression
,
flags
,
ei
,
ret
);
}
/* ECMA-262 3rd Edition 11.2.1 */
...
...
dlls/jscript/tests/lang.js
View file @
23ccc9a2
...
...
@@ -150,4 +150,7 @@ ok(obj3.prop2 === "boolean", "obj3.prop2 is not \"boolean\"");
}
ok
(
blockVar
===
2
,
"blockVar !== 2"
);
ok
((
true
?
1
:
2
)
===
1
,
"conditional expression true is not 1"
);
ok
((
0
===
2
?
1
:
2
)
===
2
,
"conditional expression true is not 2"
);
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