diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-18 09:30:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 055f71f87d5d58be2aafd6c0ef2b84d57ed48b63 (patch) | |
tree | 71f5f12e997bdcca340309cd5da81aacf0b3731f /src/qml/jsruntime/qv4argumentsobject.cpp | |
parent | 2d781c4ca42f50643fa37200073a2fb2644b3806 (diff) |
Introduce a Referenced<T> class to pass Objects into methods
Added some convenience typedefs (StringRef, ObjectRef, ReturnedString,
ScopedString, ...)
Used StringRef in newBuiltinFunction() for testing.
Cleaned up the duplicated code for thrower functions.
Change-Id: I7b7676690cbe70d9eabb0a5afd0d922f0be3aefd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4argumentsobject.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp index 5af2c07b1a..be4fbe60b8 100644 --- a/src/qml/jsruntime/qv4argumentsobject.cpp +++ b/src/qml/jsruntime/qv4argumentsobject.cpp @@ -44,12 +44,6 @@ using namespace QV4; -static ReturnedValue throwTypeError(SimpleCallContext *ctx) -{ - ctx->throwTypeError(); - return Value::undefinedValue().asReturnedValue(); -} - DEFINE_MANAGED_VTABLE(ArgumentsObject); ArgumentsObject::ArgumentsObject(CallContext *context) @@ -59,12 +53,12 @@ ArgumentsObject::ArgumentsObject(CallContext *context) type = Type_ArgumentsObject; Scope scope(context); + ExecutionEngine *v4 = context->engine; if (context->strictMode) { - internalClass = engine()->strictArgumentsObjectClass; + internalClass = v4->strictArgumentsObjectClass; - Scoped<FunctionObject> thrower(scope, context->engine->newBuiltinFunction(context, 0, throwTypeError)); - Property pd = Property::fromAccessor(thrower.getPointer(), thrower.getPointer()); + Property pd = Property::fromAccessor(v4->thrower, v4->thrower); assert(CalleePropertyIndex == internalClass->find(context->engine->id_callee)); assert(CallerPropertyIndex == internalClass->find(context->engine->id_caller)); memberData[CalleePropertyIndex] = pd; |