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
3e1430e0
Commit
3e1430e0
authored
Sep 11, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fixed null dispatch comparison.
parent
176ba8cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
engine.c
dlls/jscript/engine.c
+15
-5
lang.js
dlls/jscript/tests/lang.js
+7
-0
No files found.
dlls/jscript/engine.c
View file @
3e1430e0
...
...
@@ -245,6 +245,11 @@ static HRESULT put_value(script_ctx_t *ctx, exprval_t *ref, VARIANT *v, jsexcept
return
disp_propput
(
ref
->
u
.
idref
.
disp
,
ref
->
u
.
idref
.
id
,
ctx
->
lcid
,
v
,
ei
,
NULL
/*FIXME*/
);
}
static
inline
BOOL
is_null
(
const
VARIANT
*
v
)
{
return
V_VT
(
v
)
==
VT_NULL
||
(
V_VT
(
v
)
==
VT_DISPATCH
&&
!
V_DISPATCH
(
v
));
}
static
HRESULT
disp_cmp
(
IDispatch
*
disp1
,
IDispatch
*
disp2
,
BOOL
*
ret
)
{
IObjectIdentity
*
identity
;
...
...
@@ -256,6 +261,11 @@ static HRESULT disp_cmp(IDispatch *disp1, IDispatch *disp2, BOOL *ret)
return
S_OK
;
}
if
(
!
disp1
)
{
*
ret
=
!
disp2
;
return
S_OK
;
}
hres
=
IDispatch_QueryInterface
(
disp1
,
&
IID_IUnknown
,
(
void
**
)
&
unk1
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -290,12 +300,12 @@ static HRESULT equal2_values(VARIANT *lval, VARIANT *rval, BOOL *ret)
TRACE
(
"
\n
"
);
if
(
V_VT
(
lval
)
!=
V_VT
(
rval
))
{
if
(
is_num_vt
(
V_VT
(
lval
))
&&
is_num_vt
(
V_VT
(
rval
)))
{
if
(
is_num_vt
(
V_VT
(
lval
))
&&
is_num_vt
(
V_VT
(
rval
)))
*
ret
=
num_val
(
lval
)
==
num_val
(
rval
);
return
S_OK
;
}
*
ret
=
FALSE
;
else
if
(
is_null
(
lval
))
*
ret
=
is_null
(
rval
);
else
*
ret
=
FALSE
;
return
S_OK
;
}
...
...
dlls/jscript/tests/lang.js
View file @
3e1430e0
...
...
@@ -935,6 +935,13 @@ ok(createNullBSTR() === '', "createNullBSTR() !== ''");
ok
(
getVT
(
nullDisp
)
===
"VT_DISPATCH"
,
"getVT(nullDisp) = "
+
getVT
(
nullDisp
));
ok
(
typeof
(
nullDisp
)
===
"object"
,
"typeof(nullDisp) = "
+
typeof
(
nullDisp
));
ok
(
nullDisp
===
nullDisp
,
"nullDisp !== nullDisp"
);
ok
(
nullDisp
!==
re
,
"nullDisp === re"
);
ok
(
nullDisp
===
null
,
"nullDisp === null"
);
ok
(
nullDisp
==
null
,
"nullDisp == null"
);
ok
(
getVT
(
true
&&
nullDisp
)
===
"VT_DISPATCH"
,
"getVT(0 && nullDisp) = "
+
getVT
(
true
&&
nullDisp
));
ok
(
!
nullDisp
===
true
,
"!nullDisp = "
+
!
nullDisp
);
function
do_test
()
{}
function
nosemicolon
()
{}
nosemicolon
();
...
...
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