diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-14 10:22:09 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-14 19:32:29 +0000 |
commit | 16288498cf0e1eb389ac3acdce86eb74cc69e67a (patch) | |
tree | 32ffcf8899a40d8bf076b6ffb58823991dac1978 /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | b9311cc01da09f7f736850f500113f3e576c21a9 (diff) |
Implement support for destructuring of rest elements
"var [x, ...y] = array" now works as intended.
Change-Id: I45238f27f468d0b0e14dc0e931c55c4f40043690
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 3565ec10ae..8b45226fcd 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -965,6 +965,12 @@ QV4::ReturnedValue VME::interpret(CppStackFrame &frame, const uchar *code) CHECK_EXCEPTION; MOTH_END_INSTR(IteratorNext) + MOTH_BEGIN_INSTR(DestructureRestElement) + STORE_ACC(); + acc = Runtime::method_destructureRestElement(engine, ACC); + CHECK_EXCEPTION; + MOTH_END_INSTR(DestructureRestElement) + MOTH_BEGIN_INSTR(DeleteMember) if (!Runtime::method_deleteMember(engine, STACK_VALUE(base), member)) { if (function->isStrict()) { |