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
e7786d1d
Commit
e7786d1d
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 object initialiser expression implementation.
parent
1edd64ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
3 deletions
+54
-3
engine.c
dlls/jscript/engine.c
+50
-3
lang.js
dlls/jscript/tests/lang.js
+4
-0
No files found.
dlls/jscript/engine.c
View file @
e7786d1d
...
...
@@ -1050,10 +1050,57 @@ HRESULT array_literal_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD
return
E_NOTIMPL
;
}
HRESULT
property_value_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
/* ECMA-262 3rd Edition 11.1.5 */
HRESULT
property_value_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
_expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
property_value_expression_t
*
expr
=
(
property_value_expression_t
*
)
_expr
;
VARIANT
val
,
tmp
;
DispatchEx
*
obj
;
prop_val_t
*
iter
;
exprval_t
exprval
;
BSTR
name
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
create_object
(
ctx
->
parser
->
script
,
NULL
,
&
obj
);
if
(
FAILED
(
hres
))
return
hres
;
for
(
iter
=
expr
->
property_list
;
iter
;
iter
=
iter
->
next
)
{
hres
=
literal_to_var
(
iter
->
name
,
&
tmp
);
if
(
FAILED
(
hres
))
break
;
hres
=
to_string
(
ctx
->
parser
->
script
,
&
tmp
,
ei
,
&
name
);
VariantClear
(
&
tmp
);
if
(
FAILED
(
hres
))
break
;
hres
=
expr_eval
(
ctx
,
iter
->
value
,
0
,
ei
,
&
exprval
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
exprval_to_value
(
ctx
->
parser
->
script
,
&
exprval
,
ei
,
&
val
);
exprval_release
(
&
exprval
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propput_name
(
obj
,
name
,
ctx
->
parser
->
script
->
lcid
,
&
val
,
ei
,
NULL
/*FIXME*/
);
VariantClear
(
&
val
);
}
}
SysFreeString
(
name
);
if
(
FAILED
(
hres
))
break
;
}
if
(
FAILED
(
hres
))
{
jsdisp_release
(
obj
);
return
hres
;
}
ret
->
type
=
EXPRVAL_VARIANT
;
V_VT
(
&
ret
->
u
.
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
ret
->
u
.
var
)
=
(
IDispatch
*
)
_IDispatchEx_
(
obj
);
return
S_OK
;
}
HRESULT
comma_expression_eval
(
exec_ctx_t
*
ctx
,
expression_t
*
expr
,
DWORD
flags
,
jsexcept_t
*
ei
,
exprval_t
*
ret
)
...
...
dlls/jscript/tests/lang.js
View file @
e7786d1d
...
...
@@ -140,4 +140,8 @@ if(true)
tmp
=
1
;
ok
(
tmp
===
1
,
"tmp !== 1, if(true) not evaluated?"
);
var
obj3
=
{
prop1
:
1
,
prop2
:
typeof
(
false
)
};
ok
(
obj3
.
prop1
===
1
,
"obj3.prop1 is not 1"
);
ok
(
obj3
.
prop2
===
"boolean"
,
"obj3.prop2 is not
\"
boolean
\"
"
);
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