diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-11-06 15:59:01 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-14 21:46:14 +0000 |
commit | 30ada3da8635f3e496ea6cb9483aa104d32e5a61 (patch) | |
tree | 5573b2a95dc25a5c8fa17de79179ef6bc10294f4 /src/qml/jsruntime/qv4runtime.cpp | |
parent | f0a412020f493f01205c302cf48927dd5e3b80b6 (diff) |
Clean up ArgumentsObject handling
Introduce a proper strict arguments object.
Change-Id: Ie4e7f904b3a0e03893b18b3c6709f4f25dbc1030
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 9728f5454c..8bbc021738 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1220,19 +1220,15 @@ ReturnedValue Runtime::method_objectLiteral(ExecutionEngine *engine, const QV4:: QV4::ReturnedValue Runtime::method_createMappedArgumentsObject(ExecutionEngine *engine) { Q_ASSERT(engine->currentContext()->d()->type == Heap::ExecutionContext::Type_CallContext); - QV4::CallContext *c = static_cast<QV4::CallContext *>(&engine->currentStackFrame->jsFrame->context); QV4::InternalClass *ic = engine->internalClasses[EngineBase::Class_ArgumentsObject]; - int nFormals = engine->currentStackFrame->v4Function->nFormals; - return engine->memoryManager->allocObject<ArgumentsObject>(ic, engine->objectPrototype(), c, nFormals, false)->asReturnedValue(); + return engine->memoryManager->allocObject<ArgumentsObject>(ic, engine->objectPrototype(), engine->currentStackFrame)->asReturnedValue(); } QV4::ReturnedValue Runtime::method_createUnmappedArgumentsObject(ExecutionEngine *engine) { Q_ASSERT(engine->currentContext()->d()->type == Heap::ExecutionContext::Type_CallContext); - QV4::CallContext *c = static_cast<QV4::CallContext *>(&engine->currentStackFrame->jsFrame->context); QV4::InternalClass *ic = engine->internalClasses[EngineBase::Class_StrictArgumentsObject]; - int nFormals = engine->currentStackFrame->v4Function->nFormals; - return engine->memoryManager->allocObject<ArgumentsObject>(ic, engine->objectPrototype(), c, nFormals, true)->asReturnedValue(); + return engine->memoryManager->allocObject<StrictArgumentsObject>(ic, engine->objectPrototype(), engine->currentStackFrame)->asReturnedValue(); } ReturnedValue Runtime::method_loadQmlContext(NoThrowEngine *engine) |