aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-15 23:29:33 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-23 13:19:28 +0000
commit3de014db9ebdaa66d875bb8801261e39846ae5d0 (patch)
treeaae50219633ef8e75f62c84e3075baf79b492612 /src/qml/jsruntime
parent84306f7f8cbe37ad23f4c01c1f7af50e309cc7f8 (diff)
Fixup the throwTypeError internal function
Make the function conform to section 9.2.7.1 of the spec. Change-Id: Ieb3295198f407d4404e06a54efb51a8b8496bbd7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 6edf7ddf37..ff32671dc8 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -539,8 +539,10 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
globalObject->defineDefaultProperty(QStringLiteral("escape"), GlobalFunctions::method_escape, 1);
globalObject->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1);
- ScopedString name(scope, newString(QStringLiteral("thrower")));
- jsObjects[ThrowerObject] = FunctionObject::createBuiltinFunction(this, name, ::throwTypeError, 0);
+ ScopedFunctionObject t(scope, memoryManager->allocate<FunctionObject>(rootContext(), nullptr, ::throwTypeError));
+ t->defineReadonlyProperty(id_length(), Primitive::fromInt32(0));
+ t->setInternalClass(t->internalClass()->frozen());
+ jsObjects[ThrowerObject] = t;
ScopedProperty pd(scope);
pd->value = thrower();