diff options
Diffstat (limited to 'src/qml/jsruntime/qv4context_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4context_p.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 0c3b189401..fe15a53fd2 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -148,8 +148,6 @@ struct Q_QML_EXPORT ExecutionContext ReturnedValue getPropertyAndBase(String *name, Object **base); bool deleteProperty(String *name); - inline Value argument(unsigned int index = 0); - void mark(); inline CallContext *asCallContext(); @@ -160,9 +158,13 @@ struct SimpleCallContext : public ExecutionContext { void initSimpleCallContext(ExecutionEngine *engine); FunctionObject *function; - Value *arguments; + SafeValue *arguments; unsigned int realArgumentCount; unsigned int argumentCount; + + ReturnedValue argument(uint i) { + return i < argumentCount ? arguments[i].asReturnedValue() : Value::undefinedValue().asReturnedValue(); + } }; struct CallContext : public SimpleCallContext @@ -196,16 +198,6 @@ struct WithContext : public ExecutionContext void initWithContext(ExecutionContext *p, Object *with); }; -inline Value ExecutionContext::argument(unsigned int index) -{ - if (type >= Type_SimpleCallContext) { - CallContext *ctx = static_cast<CallContext *>(this); - if (index < ctx->argumentCount) - return ctx->arguments[index]; - } - return Value::undefinedValue(); -} - inline CallContext *ExecutionContext::asCallContext() { return type >= Type_CallContext ? static_cast<CallContext *>(this) : 0; |