diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 21:10:11 +0200 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 20:52:40 +0000 |
| commit | 2d6b08bd17377aa6bcb663029a196a8d19cac6ac (patch) | |
| tree | 4bce8e27455c38b919a5a1706c6bb5b8b7f8813a /src/qml/jsruntime/qv4runtime.cpp | |
| parent | bde97ab6a72acafaa29d2da0f7a31ae23918a6b0 (diff) | |
Give for loops a per-iteration context as well
Regular for loops also have a per iteration context for lexically
declared variables as well.
Change-Id: I35cb58bfb198c7dc32d70f41ea0ced7ddefcc37e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 8bf6d6b73f..986684302c 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1230,6 +1230,12 @@ ReturnedValue Runtime::method_createBlockContext(ExecutionContext *parent, int i return parent->newBlockContext(e->currentStackFrame, index)->asReturnedValue(); } +ReturnedValue Runtime::method_cloneBlockContext(ExecutionContext *previous) +{ + return ExecutionContext::cloneBlockContext(static_cast<Heap::CallContext *>(previous->d()))->asReturnedValue(); +} + + ReturnedValue Runtime::method_createScriptContext(ExecutionEngine *engine, int index) { Q_ASSERT(engine->currentStackFrame->context()->d()->type == Heap::ExecutionContext::Type_GlobalContext || |
