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
326cf6e0
Commit
326cf6e0
authored
Sep 09, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added var statement implementation.
parent
11153d0e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
3 deletions
+64
-3
dispex.c
dlls/jscript/dispex.c
+14
-0
engine.c
dlls/jscript/engine.c
+46
-3
jscript.h
dlls/jscript/jscript.h
+1
-0
lang.js
dlls/jscript/tests/lang.js
+3
-0
No files found.
dlls/jscript/dispex.c
View file @
326cf6e0
...
...
@@ -838,6 +838,20 @@ HRESULT disp_call(IDispatch *disp, DISPID id, LCID lcid, WORD flags, DISPPARAMS
return
hres
;
}
HRESULT
jsdisp_propput_name
(
DispatchEx
*
obj
,
const
WCHAR
*
name
,
LCID
lcid
,
VARIANT
*
val
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
DISPID
named_arg
=
DISPID_PROPERTYPUT
;
DISPPARAMS
dp
=
{
val
,
&
named_arg
,
1
,
1
};
dispex_prop_t
*
prop
;
HRESULT
hres
;
hres
=
find_prop_name_prot
(
obj
,
name
,
TRUE
,
&
prop
);
if
(
FAILED
(
hres
))
return
hres
;
return
prop_put
(
obj
,
prop
,
lcid
,
&
dp
,
ei
,
caller
);
}
HRESULT
disp_propput
(
IDispatch
*
disp
,
DISPID
id
,
LCID
lcid
,
VARIANT
*
val
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
DISPID
dispid
=
DISPID_PROPERTYPUT
;
...
...
dlls/jscript/engine.c
View file @
326cf6e0
...
...
@@ -341,10 +341,53 @@ HRESULT block_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *
return
E_NOTIMPL
;
}
HRESULT
var_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
/* ECMA-262 3rd Edition 12.2 */
static
HRESULT
variable_list_eval
(
exec_ctx_t
*
ctx
,
variable_declaration_t
*
var_list
,
jsexcept_t
*
ei
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
variable_declaration_t
*
iter
;
HRESULT
hres
;
for
(
iter
=
var_list
;
iter
;
iter
=
iter
->
next
)
{
VARIANT
val
;
if
(
iter
->
expr
)
{
exprval_t
exprval
;
hres
=
expr_eval
(
ctx
,
iter
->
expr
,
0
,
ei
,
&
exprval
);
if
(
FAILED
(
hres
))
break
;
hres
=
exprval_to_value
(
ctx
->
parser
->
script
,
&
exprval
,
ei
,
&
val
);
exprval_release
(
&
exprval
);
if
(
FAILED
(
hres
))
break
;
}
else
{
V_VT
(
&
val
)
=
VT_EMPTY
;
}
hres
=
jsdisp_propput_name
(
ctx
->
var_disp
,
iter
->
identifier
,
ctx
->
parser
->
script
->
lcid
,
&
val
,
ei
,
NULL
/*FIXME*/
);
VariantClear
(
&
val
);
if
(
FAILED
(
hres
))
break
;
}
return
hres
;
}
/* ECMA-262 3rd Edition 12.2 */
HRESULT
var_statement_eval
(
exec_ctx_t
*
ctx
,
statement_t
*
_stat
,
return_type_t
*
rt
,
VARIANT
*
ret
)
{
var_statement_t
*
stat
=
(
var_statement_t
*
)
_stat
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
variable_list_eval
(
ctx
,
stat
->
variable_list
,
&
rt
->
ei
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
ret
)
=
VT_EMPTY
;
return
S_OK
;
}
/* ECMA-262 3rd Edition 12.3 */
...
...
dlls/jscript/jscript.h
View file @
326cf6e0
...
...
@@ -90,6 +90,7 @@ HRESULT create_dispex(script_ctx_t*,const builtin_info_t*,DispatchEx*,DispatchEx
HRESULT
disp_call
(
IDispatch
*
,
DISPID
,
LCID
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
disp_propget
(
IDispatch
*
,
DISPID
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
disp_propput
(
IDispatch
*
,
DISPID
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
jsdisp_propput_name
(
DispatchEx
*
,
const
WCHAR
*
,
LCID
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
to_boolean
(
VARIANT
*
,
VARIANT_BOOL
*
);
...
...
dlls/jscript/tests/lang.js
View file @
326cf6e0
...
...
@@ -23,4 +23,7 @@ ok(!null, "!null is not true");
ok
(
!
0
,
"!0 is not true"
);
ok
(
!
0.0
,
"!0.0 is not true"
);
var
trueVar
=
true
;
ok
(
trueVar
,
"trueVar is not true"
);
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