diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-02-10 17:04:32 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:49:09 +0000 |
commit | b59b727035c4c1a4d235432cc67e5d89d3a24cd3 (patch) | |
tree | b452f39eab452a8a472dfc5c9b7e89ab4a354c1f /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | 2683a22364f742e3809b6c48570b0b4aaf37b31f (diff) |
ES6: add support for default arguments for function parameters
The parser can also handle rest parameters correctly, this will
however require some additional work in the runtime to support
it correctly.
Change-Id: Ib6f4d27683774966b2d2aac075494d2f5066d2a2
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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index fbb2744c15..88d859eef5 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -1023,6 +1023,11 @@ QV4::ReturnedValue VME::exec(const FunctionObject *fo, const Value *thisObject, } MOTH_END_INSTR(JumpFalse) + MOTH_BEGIN_INSTR(JumpNotUndefined) + if (Q_LIKELY(acc != QV4::Encode::undefined())) + code += offset; + MOTH_END_INSTR(JumpNotUndefined) + MOTH_BEGIN_INSTR(CmpEqNull) acc = Encode(ACC.isNullOrUndefined()); MOTH_END_INSTR(CmpEqNull) |