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
228aab23
Commit
228aab23
authored
Sep 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Always use jsval-based to_object implementation.
parent
acfd2b98
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
47 deletions
+34
-47
engine.c
dlls/jscript/engine.c
+4
-4
function.c
dlls/jscript/function.c
+2
-2
jscript.h
dlls/jscript/jscript.h
+1
-2
jsutils.c
dlls/jscript/jsutils.c
+26
-38
object.c
dlls/jscript/object.c
+1
-1
No files found.
dlls/jscript/engine.c
View file @
228aab23
...
...
@@ -148,7 +148,7 @@ static HRESULT stack_pop_object(exec_ctx_t *ctx, IDispatch **r)
return
S_OK
;
}
hres
=
to_object
_jsval
(
ctx
->
script
,
v
,
r
);
hres
=
to_object
(
ctx
->
script
,
v
,
r
);
jsval_release
(
v
);
return
hres
;
}
...
...
@@ -627,7 +627,7 @@ static HRESULT interp_push_scope(exec_ctx_t *ctx)
TRACE
(
"
\n
"
);
v
=
stack_pop
(
ctx
);
hres
=
to_object
_jsval
(
ctx
->
script
,
v
,
&
disp
);
hres
=
to_object
(
ctx
->
script
,
v
,
&
disp
);
jsval_release
(
v
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -878,7 +878,7 @@ static HRESULT interp_memberid(exec_ctx_t *ctx)
namev
=
stack_pop
(
ctx
);
objv
=
stack_pop
(
ctx
);
hres
=
to_object
_jsval
(
ctx
->
script
,
objv
,
&
obj
);
hres
=
to_object
(
ctx
->
script
,
objv
,
&
obj
);
jsval_release
(
objv
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
to_string
(
ctx
->
script
,
namev
,
ctx
->
ei
,
&
name
);
...
...
@@ -1578,7 +1578,7 @@ static HRESULT interp_delete(exec_ctx_t *ctx)
namev
=
stack_pop
(
ctx
);
objv
=
stack_pop
(
ctx
);
hres
=
to_object
_jsval
(
ctx
->
script
,
objv
,
&
obj
);
hres
=
to_object
(
ctx
->
script
,
objv
,
&
obj
);
jsval_release
(
objv
);
if
(
FAILED
(
hres
))
{
jsval_release
(
namev
);
...
...
dlls/jscript/function.c
View file @
228aab23
...
...
@@ -389,7 +389,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un
if
(
argc
)
{
if
(
!
is_undefined
(
argv
[
0
])
&&
!
is_null
(
argv
[
0
]))
{
hres
=
to_object
_jsval
(
ctx
,
argv
[
0
],
&
this_obj
);
hres
=
to_object
(
ctx
,
argv
[
0
],
&
this_obj
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
@@ -442,7 +442,7 @@ static HRESULT Function_call(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, uns
if
(
argc
)
{
if
(
!
is_undefined
(
argv
[
0
])
&&
!
is_null
(
argv
[
0
]))
{
hres
=
to_object
_jsval
(
ctx
,
argv
[
0
],
&
this_obj
);
hres
=
to_object
(
ctx
,
argv
[
0
],
&
this_obj
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
dlls/jscript/jscript.h
View file @
228aab23
...
...
@@ -261,8 +261,7 @@ HRESULT to_integer(script_ctx_t*,jsval_t,jsexcept_t*,double*) DECLSPEC_HIDDEN;
HRESULT
to_int32
(
script_ctx_t
*
,
jsval_t
,
jsexcept_t
*
,
INT
*
)
DECLSPEC_HIDDEN
;
HRESULT
to_uint32
(
script_ctx_t
*
,
jsval_t
,
jsexcept_t
*
,
DWORD
*
)
DECLSPEC_HIDDEN
;
HRESULT
to_string
(
script_ctx_t
*
,
jsval_t
,
jsexcept_t
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
to_object
(
script_ctx_t
*
,
VARIANT
*
,
IDispatch
**
)
DECLSPEC_HIDDEN
;
HRESULT
to_object_jsval
(
script_ctx_t
*
,
jsval_t
,
IDispatch
**
)
DECLSPEC_HIDDEN
;
HRESULT
to_object
(
script_ctx_t
*
,
jsval_t
,
IDispatch
**
)
DECLSPEC_HIDDEN
;
HRESULT
variant_change_type
(
script_ctx_t
*
,
VARIANT
*
,
VARIANT
*
,
VARTYPE
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/jsutils.c
View file @
228aab23
...
...
@@ -760,31 +760,30 @@ HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, BSTR *str)
}
/* ECMA-262 3rd Edition 9.9 */
HRESULT
to_object
(
script_ctx_t
*
ctx
,
VARIANT
*
v
,
IDispatch
**
disp
)
HRESULT
to_object
(
script_ctx_t
*
ctx
,
jsval_t
val
,
IDispatch
**
disp
)
{
jsdisp_t
*
dispex
;
HRESULT
hres
;
switch
(
V_VT
(
v
)
)
{
case
VT_BSTR
:
hres
=
create_string
(
ctx
,
V_BSTR
(
v
),
SysStringLen
(
V_BSTR
(
v
)),
&
dispex
);
switch
(
val
.
type
)
{
case
JSV_STRING
:
hres
=
create_string
(
ctx
,
get_string
(
val
),
SysStringLen
(
get_string
(
val
)),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
to_disp
(
dispex
);
break
;
case
VT_I4
:
case
VT_R8
:
hres
=
create_number
(
ctx
,
num_val
(
v
),
&
dispex
);
case
JSV_NUMBER
:
hres
=
create_number
(
ctx
,
get_number
(
val
),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
to_disp
(
dispex
);
break
;
case
VT_DISPATCH
:
if
(
V_DISPATCH
(
v
))
{
IDispatch_AddRef
(
V_DISPATCH
(
v
)
);
*
disp
=
V_DISPATCH
(
v
);
case
JSV_OBJECT
:
if
(
get_object
(
val
))
{
*
disp
=
get_object
(
val
);
IDispatch_AddRef
(
*
disp
);
}
else
{
jsdisp_t
*
obj
;
...
...
@@ -795,47 +794,36 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
*
disp
=
to_disp
(
obj
);
}
break
;
case
VT
_BOOL
:
hres
=
create_bool
(
ctx
,
V_BOOL
(
v
),
&
dispex
);
case
JSV
_BOOL
:
hres
=
create_bool
(
ctx
,
get_bool
(
val
),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
to_disp
(
dispex
);
break
;
case
VT_ARRAY
|
VT_VARIANT
:
hres
=
create_vbarray
(
ctx
,
V_ARRAY
(
v
),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
case
JSV_VARIANT
:
switch
(
V_VT
(
get_variant
(
val
)))
{
case
VT_ARRAY
|
VT_VARIANT
:
hres
=
create_vbarray
(
ctx
,
V_ARRAY
(
get_variant
(
val
)),
&
dispex
);
if
(
FAILED
(
hres
))
return
hres
;
*
disp
=
to_disp
(
dispex
);
*
disp
=
to_disp
(
dispex
);
break
;
default:
FIXME
(
"Unsupported %s
\n
"
,
debugstr_variant
(
get_variant
(
val
)));
return
E_NOTIMPL
;
}
break
;
default:
FIXME
(
"unsupported
vt %d
\n
"
,
V_VT
(
v
));
FIXME
(
"unsupported
%s
\n
"
,
debugstr_jsval
(
val
));
return
E_NOTIMPL
;
}
return
S_OK
;
}
/* ECMA-262 3rd Edition 9.9 */
HRESULT
to_object_jsval
(
script_ctx_t
*
ctx
,
jsval_t
v
,
IDispatch
**
disp
)
{
VARIANT
var
;
HRESULT
hres
;
if
(
is_object_instance
(
v
))
{
*
disp
=
get_object
(
v
);
IDispatch_AddRef
(
*
disp
);
return
S_OK
;
}
hres
=
jsval_to_variant
(
v
,
&
var
);
if
(
FAILED
(
hres
))
return
hres
;
return
to_object
(
ctx
,
&
var
,
disp
);
}
HRESULT
variant_change_type
(
script_ctx_t
*
ctx
,
VARIANT
*
dst
,
VARIANT
*
src
,
VARTYPE
vt
)
{
jsexcept_t
ei
;
...
...
dlls/jscript/object.c
View file @
228aab23
...
...
@@ -228,7 +228,7 @@ static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
if
(
!
is_undefined
(
argv
[
0
])
&&
!
is_null
(
argv
[
0
])
&&
(
!
is_object_instance
(
argv
[
0
])
||
get_object
(
argv
[
0
])))
{
IDispatch
*
disp
;
hres
=
to_object
_jsval
(
ctx
,
argv
[
0
],
&
disp
);
hres
=
to_object
(
ctx
,
argv
[
0
],
&
disp
);
if
(
FAILED
(
hres
))
return
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