diff options
author | Holger Hans Peter Freyther <[email protected]> | 2014-06-15 08:05:03 +0200 |
---|---|---|
committer | Holger Freyther <[email protected]> | 2014-07-20 09:51:44 +0200 |
commit | 8ea3b20b141a93da5ca6e2ef4e623249ab46d91b (patch) | |
tree | 83a906438bb3bf3ff9ba1004302310833903e252 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 9da3da656e47f8924d3f886fff71b847e8daac63 (diff) |
v4: Remove dead code ScriptFunction constructor
Creating a Scope/ScopedValue will immediately access ExecutionEngine
of the ExecutionContext so the null check is not needed here. Move
the v4 variable into the scope that is using it.
Change-Id: I9189ee9d1a63997119e49c12182dffefadc916f1
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 39a123c4d2..b5300f8799 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -358,18 +358,13 @@ ScriptFunction::ScriptFunction(ExecutionContext *scope, Function *function) Scope s(scope); ScopedValue protectThis(s, this); - // global function - if (!scope) - return; - - ExecutionEngine *v4 = scope->engine; - needsActivation = function->needsActivation(); strictMode = function->isStrict(); defineReadonlyProperty(scope->engine->id_length, Primitive::fromInt32(formalParameterCount())); if (scope->strictMode) { + ExecutionEngine *v4 = scope->engine; Property pd(v4->thrower, v4->thrower); insertMember(scope->engine->id_caller, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); insertMember(scope->engine->id_arguments, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); |