From bd4064eabf79a6166805c877ee622931df6fb172 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 6 Sep 2018 13:38:23 +0200 Subject: Throw a type error when trying to destructure null or undefined Change-Id: Id1bba1a729124bccb8a90dcf40252fe5c69d27a3 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4instr_moth_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qml/compiler/qv4instr_moth_p.h') diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 40313551e8..34c80db0e8 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -195,6 +195,7 @@ QT_BEGIN_NAMESPACE #define INSTR_LoadQmlContext(op) INSTRUCTION(op, LoadQmlContext, 1, result) #define INSTR_LoadQmlImportedScripts(op) INSTRUCTION(op, LoadQmlImportedScripts, 1, result) #define INSTR_InitializeBlockDeadTemporalZone(op) INSTRUCTION(op, InitializeBlockDeadTemporalZone, 2, firstReg, count) +#define INSTR_ThrowOnNullOrUndefined(op) INSTRUCTION(op, ThrowOnNullOrUndefined, 0) #define FOR_EACH_MOTH_INSTR_ALL(F) \ F(Nop) \ @@ -332,6 +333,7 @@ QT_BEGIN_NAMESPACE F(PushScriptContext) \ F(PopScriptContext) \ F(InitializeBlockDeadTemporalZone) \ + F(ThrowOnNullOrUndefined) \ F(Debug) \ #define MOTH_NUM_INSTRUCTIONS() (static_cast(Moth::Instr::Type::Debug_Wide) + 1) -- cgit v1.2.3