jscript: Fixed to_primitive for null dispatch.
This commit is contained in:
parent
3e1430e0e4
commit
e7f2754c32
|
@ -198,6 +198,11 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
|
||||||
static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
|
static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
|
||||||
static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0};
|
static const WCHAR valueOfW[] = {'v','a','l','u','e','O','f',0};
|
||||||
|
|
||||||
|
if(!V_DISPATCH(v)) {
|
||||||
|
V_VT(ret) = VT_NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
jsdisp = iface_to_jsdisp((IUnknown*)V_DISPATCH(v));
|
jsdisp = iface_to_jsdisp((IUnknown*)V_DISPATCH(v));
|
||||||
if(!jsdisp) {
|
if(!jsdisp) {
|
||||||
V_VT(ret) = VT_EMPTY;
|
V_VT(ret) = VT_EMPTY;
|
||||||
|
|
|
@ -942,6 +942,7 @@ ok(nullDisp == null, "nullDisp == null");
|
||||||
ok(getVT(true && nullDisp) === "VT_DISPATCH",
|
ok(getVT(true && nullDisp) === "VT_DISPATCH",
|
||||||
"getVT(0 && nullDisp) = " + getVT(true && nullDisp));
|
"getVT(0 && nullDisp) = " + getVT(true && nullDisp));
|
||||||
ok(!nullDisp === true, "!nullDisp = " + !nullDisp);
|
ok(!nullDisp === true, "!nullDisp = " + !nullDisp);
|
||||||
|
ok(String(nullDisp) === "null", "String(nullDisp) = " + String(nullDisp));
|
||||||
|
|
||||||
function do_test() {}
|
function do_test() {}
|
||||||
function nosemicolon() {} nosemicolon();
|
function nosemicolon() {} nosemicolon();
|
||||||
|
|
Loading…
Reference in New Issue