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
c4df88b7
Commit
c4df88b7
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: Use helper to access jsval_t type.
parent
c5183bb5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
engine.c
dlls/jscript/engine.c
+6
-4
jsutils.c
dlls/jscript/jsutils.c
+8
-8
jsval.h
dlls/jscript/jsval.h
+5
-0
No files found.
dlls/jscript/engine.c
View file @
c4df88b7
...
...
@@ -396,9 +396,11 @@ static HRESULT disp_cmp(IDispatch *disp1, IDispatch *disp2, BOOL *ret)
/* ECMA-262 3rd Edition 11.9.6 */
static
HRESULT
equal2_values
(
jsval_t
lval
,
jsval_t
rval
,
BOOL
*
ret
)
{
jsval_type_t
type
=
jsval_type
(
lval
);
TRACE
(
"
\n
"
);
if
(
lval
.
type
!=
rval
.
type
)
{
if
(
type
!=
jsval_type
(
rval
)
)
{
if
(
is_null_instance
(
lval
))
*
ret
=
is_null_instance
(
rval
);
else
...
...
@@ -406,7 +408,7 @@ static HRESULT equal2_values(jsval_t lval, jsval_t rval, BOOL *ret)
return
S_OK
;
}
switch
(
lval
.
type
)
{
switch
(
type
)
{
case
JSV_UNDEFINED
:
case
JSV_NULL
:
*
ret
=
TRUE
;
...
...
@@ -1657,7 +1659,7 @@ static HRESULT interp_void(exec_ctx_t *ctx)
/* ECMA-262 3rd Edition 11.4.3 */
static
HRESULT
typeof_string
(
jsval_t
v
,
const
WCHAR
**
ret
)
{
switch
(
v
.
type
)
{
switch
(
jsval_type
(
v
)
)
{
case
JSV_UNDEFINED
:
*
ret
=
undefinedW
;
break
;
...
...
@@ -1876,7 +1878,7 @@ static HRESULT interp_preinc(exec_ctx_t *ctx)
/* ECMA-262 3rd Edition 11.9.3 */
static
HRESULT
equal_values
(
script_ctx_t
*
ctx
,
jsval_t
lval
,
jsval_t
rval
,
jsexcept_t
*
ei
,
BOOL
*
ret
)
{
if
(
lval
.
type
==
rval
.
type
||
(
is_number
(
lval
)
&&
is_number
(
rval
)))
if
(
jsval_type
(
lval
)
==
jsval_type
(
rval
)
||
(
is_number
(
lval
)
&&
is_number
(
rval
)))
return
equal2_values
(
lval
,
rval
,
ret
);
/* FIXME: NULL disps should be handled in more general way */
...
...
dlls/jscript/jsutils.c
View file @
c4df88b7
...
...
@@ -61,7 +61,7 @@ const char *debugstr_variant(const VARIANT *v)
const
char
*
debugstr_jsval
(
const
jsval_t
v
)
{
switch
(
v
.
type
)
{
switch
(
jsval_type
(
v
)
)
{
case
JSV_UNDEFINED
:
return
"undefined"
;
case
JSV_NULL
:
...
...
@@ -217,7 +217,7 @@ static BSTR clone_bstr(BSTR str)
void
jsval_release
(
jsval_t
val
)
{
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_OBJECT
:
if
(
val
.
u
.
obj
)
IDispatch_Release
(
val
.
u
.
obj
);
...
...
@@ -252,7 +252,7 @@ HRESULT jsval_variant(jsval_t *val, VARIANT *var)
HRESULT
jsval_copy
(
jsval_t
v
,
jsval_t
*
r
)
{
switch
(
v
.
type
)
{
switch
(
jsval_type
(
v
)
)
{
case
JSV_UNDEFINED
:
case
JSV_NULL
:
case
JSV_NUMBER
:
...
...
@@ -329,7 +329,7 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
HRESULT
jsval_to_variant
(
jsval_t
val
,
VARIANT
*
retv
)
{
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_UNDEFINED
:
V_VT
(
retv
)
=
VT_EMPTY
;
return
S_OK
;
...
...
@@ -449,7 +449,7 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, jsval_t *re
/* ECMA-262 3rd Edition 9.2 */
HRESULT
to_boolean
(
jsval_t
val
,
BOOL
*
ret
)
{
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_UNDEFINED
:
case
JSV_NULL
:
*
ret
=
FALSE
;
...
...
@@ -587,7 +587,7 @@ static HRESULT str_to_number(BSTR str, double *ret)
/* ECMA-262 3rd Edition 9.3 */
HRESULT
to_number
(
script_ctx_t
*
ctx
,
jsval_t
val
,
jsexcept_t
*
ei
,
double
*
ret
)
{
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_UNDEFINED
:
*
ret
=
NAN
;
return
S_OK
;
...
...
@@ -734,7 +734,7 @@ HRESULT to_string(script_ctx_t *ctx, jsval_t val, jsexcept_t *ei, BSTR *str)
const
WCHAR
trueW
[]
=
{
't'
,
'r'
,
'u'
,
'e'
,
0
};
const
WCHAR
falseW
[]
=
{
'f'
,
'a'
,
'l'
,
's'
,
'e'
,
0
};
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_UNDEFINED
:
*
str
=
SysAllocString
(
undefinedW
);
break
;
...
...
@@ -775,7 +775,7 @@ HRESULT to_object(script_ctx_t *ctx, jsval_t val, IDispatch **disp)
jsdisp_t
*
dispex
;
HRESULT
hres
;
switch
(
val
.
type
)
{
switch
(
jsval_type
(
val
)
)
{
case
JSV_STRING
:
hres
=
create_string
(
ctx
,
get_string
(
val
),
SysStringLen
(
get_string
(
val
)),
&
dispex
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/jsval.h
View file @
c4df88b7
...
...
@@ -89,6 +89,11 @@ static inline jsval_t jsval_number(double n)
return
ret
;
}
static
inline
jsval_type_t
jsval_type
(
jsval_t
v
)
{
return
v
.
type
;
}
static
inline
BOOL
is_object_instance
(
jsval_t
v
)
{
return
v
.
type
==
JSV_OBJECT
;
...
...
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