diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/vm/Interpreter.cpp | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/src/vm/Interpreter.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index f4cdc86f18..f005c12949 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -63,6 +63,7 @@ #include "vm/StringType.h" #include "vm/ThrowMsgKind.h" // ThrowMsgKind #include "vm/Time.h" +#include "vm/TypeofEqOperand.h" // TypeofEqOperand #ifdef ENABLE_RECORD_TUPLE # include "vm/RecordType.h" # include "vm/TupleType.h" @@ -249,7 +250,7 @@ static inline bool GetNameOperation(JSContext* cx, HandleObject envChain, Handle<PropertyName*> name, JSOp nextOp, MutableHandleValue vp) { /* Kludge to allow (typeof foo == "undefined") tests. */ - if (nextOp == JSOp::Typeof) { + if (IsTypeOfNameOp(nextOp)) { return GetEnvironmentName<GetNameMode::TypeOf>(cx, envChain, name, vp); } return GetEnvironmentName<GetNameMode::Normal>(cx, envChain, name, vp); @@ -2650,6 +2651,16 @@ bool MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER js::Interpret(JSContext* cx, } END_CASE(Typeof) + CASE(TypeofEq) { + auto operand = TypeofEqOperand::fromRawValue(GET_UINT8(REGS.pc)); + bool result = js::TypeOfValue(REGS.sp[-1]) == operand.type(); + if (operand.compareOp() == JSOp::Ne) { + result = !result; + } + REGS.sp[-1].setBoolean(result); + } + END_CASE(TypeofEq) + CASE(Void) { REGS.sp[-1].setUndefined(); } END_CASE(Void) @@ -4140,13 +4151,7 @@ bool MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER js::Interpret(JSContext* cx, } if (!DebugAPI::onResumeFrame(cx, REGS.fp())) { - if (cx->isPropagatingForcedReturn()) { - MOZ_ASSERT_IF( - REGS.fp() - ->callee() - .isGenerator(), // as opposed to an async function - gen->isClosed()); - } + MOZ_ASSERT_IF(cx->isPropagatingForcedReturn(), gen->isClosed()); goto error; } } |