Loading js/src/jit/WarpOracle.cpp +14 −1 Changes for js/src/jit/WarpOracle.cpp: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -347,7 +347,8 @@ AbortReasonOr<WarpScriptSnapshot*> WarpScriptOracle::createScriptSnapshot() { } case JSOp::FunctionThis: if (!script_->strict() && script_->hasNonSyntacticScope()) { if (!script_->strict()) { if (script_->hasNonSyntacticScope()) { // Abort because MBoxNonStrictThis doesn't support non-syntactic // scopes (a deprecated SpiderMonkey mechanism). If this becomes an // issue we could support it by refactoring GetFunctionThis to not Loading @@ -355,6 +356,18 @@ AbortReasonOr<WarpScriptSnapshot*> WarpScriptOracle::createScriptSnapshot() { return abort(AbortReason::Disable, "JSOp::FunctionThis with non-syntactic scope"); } // Ensure that all constructors called by PrimitiveToObject are // already resolved. Handle<GlobalObject*> global = cx_->global(); if (!GlobalObject::ensureConstructor(cx_, global, JSProto_Number) || !GlobalObject::ensureConstructor(cx_, global, JSProto_Boolean) || !GlobalObject::ensureConstructor(cx_, global, JSProto_String) || !GlobalObject::ensureConstructor(cx_, global, JSProto_Symbol) || !GlobalObject::ensureConstructor(cx_, global, JSProto_BigInt)) { return abort(AbortReason::Error); } } break; case JSOp::GlobalThis: Loading js/src/vm/JSObject.cpp +3 −0 Changes for js/src/vm/JSObject.cpp: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2533,6 +2533,9 @@ bool js::IsPrototypeOf(JSContext* cx, HandleObject protoObj, JSObject* obj, JSObject* js::PrimitiveToObject(JSContext* cx, const Value& v) { MOZ_ASSERT(v.isPrimitive()); // Note: if a new primitive type is added here, its constructor // should also be resolved in the JSOp::FunctionThis case in // WarpScriptOracle::createScriptSnapshot. switch (v.type()) { case ValueType::String: { Rooted<JSString*> str(cx, v.toString()); Loading Loading
js/src/jit/WarpOracle.cpp +14 −1 Changes for js/src/jit/WarpOracle.cpp: 14 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -347,7 +347,8 @@ AbortReasonOr<WarpScriptSnapshot*> WarpScriptOracle::createScriptSnapshot() { } case JSOp::FunctionThis: if (!script_->strict() && script_->hasNonSyntacticScope()) { if (!script_->strict()) { if (script_->hasNonSyntacticScope()) { // Abort because MBoxNonStrictThis doesn't support non-syntactic // scopes (a deprecated SpiderMonkey mechanism). If this becomes an // issue we could support it by refactoring GetFunctionThis to not Loading @@ -355,6 +356,18 @@ AbortReasonOr<WarpScriptSnapshot*> WarpScriptOracle::createScriptSnapshot() { return abort(AbortReason::Disable, "JSOp::FunctionThis with non-syntactic scope"); } // Ensure that all constructors called by PrimitiveToObject are // already resolved. Handle<GlobalObject*> global = cx_->global(); if (!GlobalObject::ensureConstructor(cx_, global, JSProto_Number) || !GlobalObject::ensureConstructor(cx_, global, JSProto_Boolean) || !GlobalObject::ensureConstructor(cx_, global, JSProto_String) || !GlobalObject::ensureConstructor(cx_, global, JSProto_Symbol) || !GlobalObject::ensureConstructor(cx_, global, JSProto_BigInt)) { return abort(AbortReason::Error); } } break; case JSOp::GlobalThis: Loading
js/src/vm/JSObject.cpp +3 −0 Changes for js/src/vm/JSObject.cpp: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2533,6 +2533,9 @@ bool js::IsPrototypeOf(JSContext* cx, HandleObject protoObj, JSObject* obj, JSObject* js::PrimitiveToObject(JSContext* cx, const Value& v) { MOZ_ASSERT(v.isPrimitive()); // Note: if a new primitive type is added here, its constructor // should also be resolved in the JSOp::FunctionThis case in // WarpScriptOracle::createScriptSnapshot. switch (v.type()) { case ValueType::String: { Rooted<JSString*> str(cx, v.toString()); Loading