From 8f314799682c48fac1a128b9b20b4f09cb060130 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 4 Sep 2024 15:21:08 +0200 Subject: [PATCH] [js] Simplify with-env handling in FetchName --- js/src/vm/Interpreter-inl.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/src/vm/Interpreter-inl.h b/js/src/vm/Interpreter-inl.h index cbf3113b50..b9266514e3 100644 --- a/js/src/vm/Interpreter-inl.h +++ b/js/src/vm/Interpreter-inl.h @@ -188,21 +188,19 @@ FetchName(JSContext* cx, HandleObject obj, HandleObject obj2, HandlePropertyName } /* Take the slow path if shape was not found in a native object. */ - if (!obj->isNative() || !obj2->isNative()) { + if (!obj->isNative() || !obj2->isNative() || + obj->is()) { Rooted id(cx, NameToId(name)); if (!GetProperty(cx, obj, obj, id, vp)) return false; } else { RootedShape shape(cx, prop.shape()); - RootedObject normalized(cx, obj); - if (normalized->is() && !shape->hasDefaultGetter()) - normalized = &normalized->as().object(); if (shape->isDataDescriptor() && shape->hasDefaultGetter()) { /* Fast path for Object instance properties. */ MOZ_ASSERT(shape->hasSlot()); vp.set(obj2->as().getSlot(shape->slot())); } else { - if (!NativeGetExistingProperty(cx, normalized, obj2.as(), shape, vp)) + if (!NativeGetExistingProperty(cx, obj, obj2.as(), shape, vp)) return false; } }