diff options
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 54853eea4a..cd860f4c2b 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -81,6 +81,16 @@ Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const QString f->init(n.getPointer(), createProto); } +Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const QString &name, bool createProto) + : Heap::Object(scope->engine->functionClass) + , scope(scope) +{ + Scope s(scope->engine); + ScopedFunctionObject f(s, this); + ScopedString n(s, s.engine->newString(name)); + f->init(n.getPointer(), createProto); +} + Heap::FunctionObject::FunctionObject(QV4::ExecutionContext *scope, const ReturnedValue name) : Heap::Object(scope->d()->engine->functionClass) , scope(scope->d()) |