aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-12-02 12:23:20 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-20 07:40:02 +0100
commit295006428628435d300d0ac5e6a4d613430e1c4c (patch)
treeeb487f9597364e649dfeb727808cb71ff66ba310
parentd3a6412c66f62aa045f2856b0bf0ede4af10a984 (diff)
Use a Heap::FunctionObject to store the thrower function
Change-Id: I6b3f03080f35e39d14b377363f7546a9f7260029 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/jsruntime/qv4engine.cpp2
-rw-r--r--src/qml/jsruntime/qv4engine_p.h2
-rw-r--r--src/qml/jsruntime/qv4property_p.h4
3 files changed, 6 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 11d9800c83..1410d93e61 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -451,7 +451,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
globalObject()->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1);
Scoped<String> name(scope, newString(QStringLiteral("thrower")));
- thrower = ScopedFunctionObject(scope, BuiltinFunction::create(global, name, ::throwTypeError));
+ thrower = BuiltinFunction::create(global, name, ::throwTypeError);
}
ExecutionEngine::~ExecutionEngine()
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 4d02b4a51a..c5e6a54bcf 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -197,7 +197,7 @@ public:
InternalClass *typedArrayClasses[NTypedArrayTypes]; // TypedArray::NValues, avoid including the header here
Heap::EvalFunction *evalFunction;
- FunctionObject *thrower;
+ Heap::FunctionObject *thrower;
Property *argumentsAccessors;
int nArgumentsAccessors;
diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h
index 601e3446f4..ef58b4c0f8 100644
--- a/src/qml/jsruntime/qv4property_p.h
+++ b/src/qml/jsruntime/qv4property_p.h
@@ -88,6 +88,10 @@ struct Property {
value = Primitive::fromManaged(reinterpret_cast<Managed *>(getter));
set = Primitive::fromManaged(reinterpret_cast<Managed *>(setter));
}
+ Property(Heap::FunctionObject *getter, Heap::FunctionObject *setter) {
+ value.m = reinterpret_cast<Heap::Base *>(getter);
+ set.m = reinterpret_cast<Heap::Base *>(setter);
+ }
Property &operator=(Value v) { value = v; return *this; }
private:
Property(const Property &);