summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptvariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/bridge/qscriptvariant.cpp')
-rw-r--r--src/script/bridge/qscriptvariant.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/bridge/qscriptvariant.cpp b/src/script/bridge/qscriptvariant.cpp
index 583b61c..aa7ad94 100644
--- a/src/script/bridge/qscriptvariant.cpp
+++ b/src/script/bridge/qscriptvariant.cpp
@@ -148,6 +148,13 @@ static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec,
return JSC::jsString(exec, result);
}
+bool QVariantDelegate::compareToObject(QScriptObject *, JSC::ExecState *exec, JSC::JSObject *o2)
+{
+ const QVariant &variant1 = value();
+ return variant1 == scriptEngineFromExec(exec)->scriptValueFromJSCValue(o2).toVariant();
+}
+
+
QVariantPrototype::QVariantPrototype(JSC::ExecState* exec, WTF::PassRefPtr<JSC::Structure> structure,
JSC::Structure* prototypeFunctionStructure)
: QScriptObject(structure)
@@ -158,6 +165,7 @@ QVariantPrototype::QVariantPrototype(JSC::ExecState* exec, WTF::PassRefPtr<JSC::
putDirectFunction(exec, new (exec) JSC::PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, variantProtoFuncValueOf), JSC::DontEnum);
}
+
} // namespace QScript
QT_END_NAMESPACE