diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-06 14:35:32 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-06 14:35:32 (GMT) |
commit | 9769235a26c3bacc597b994fa249516721833389 (patch) | |
tree | 60027b190da162077d9a3b1199ea3c6c56bca6a8 /src/script | |
parent | 2e571b141ce50349790ca943455427185442ed16 (diff) | |
download | Qt-9769235a26c3bacc597b994fa249516721833389.zip Qt-9769235a26c3bacc597b994fa249516721833389.tar.gz Qt-9769235a26c3bacc597b994fa249516721833389.tar.bz2 |
make QScriptClass::HasInstance extension work
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 2 | ||||
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 4321370..87f8e1c 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -424,7 +424,7 @@ bool ClassObject::hasInstance(JSC::ExecState *exec, JSC::JSValue value, JSC::JSV return JSC::JSObject::hasInstance(exec, value, proto); QScriptValueList args; QScriptEnginePrivate *eng_p = static_cast<QScript::GlobalObject*>(exec->dynamicGlobalObject())->engine; - args << eng_p->scriptValueFromJSCValue(value) << eng_p->scriptValueFromJSCValue(proto); + args << eng_p->scriptValueFromJSCValue(this) << eng_p->scriptValueFromJSCValue(value); QVariant result = scriptClass()->extension(QScriptClass::HasInstance, qVariantFromValue(args)); return result.toBool(); } diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index ff2823b..bb8b2b7 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -865,7 +865,7 @@ bool QScriptValue::instanceOf(const QScriptValue &other) const QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(d->engine); JSC::JSValue jscProto = eng_p->scriptValueToJSCValue(other.property(QLatin1String("prototype"))); if (!jscProto) - return false; + jscProto = JSC::jsUndefined(); JSC::ExecState *exec = eng_p->globalObject->globalExec(); JSC::JSValue jscOther = eng_p->scriptValueToJSCValue(other); return JSC::asObject(jscOther)->hasInstance(exec, d->jscValue, jscProto); |