@@ -5003,9 +5003,9 @@ enum class BuiltinNamesMap : uint8_t {
50035003 encoding,
50045004};
50055005
5006- static const JSC ::Identifier builtinNameMap (JSC ::JSGlobalObject* globalObject , unsigned char name)
5006+ static inline const JSC ::Identifier builtinNameMap (JSC ::VM & vm , unsigned char name)
50075007{
5008- auto & vm = globalObject-> vm ();
5008+
50095009 auto clientData = WebCore::clientData (vm);
50105010 switch (static_cast <BuiltinNamesMap>(name)) {
50115011 case BuiltinNamesMap::method: {
@@ -5076,22 +5076,28 @@ JSC__JSValue JSC__JSValue__fastGetDirect_(JSC__JSValue JSValue0, JSC__JSGlobalOb
50765076{
50775077 JSC ::JSValue value = JSC::JSValue::decode (JSValue0);
50785078 ASSERT (value.isCell ());
5079- return JSValue::encode (value.getObject ()->getDirect (globalObject->vm (), PropertyName (builtinNameMap (globalObject, arg2))));
5079+ return JSValue::encode (value.getObject ()->getDirect (globalObject->vm (), PropertyName (builtinNameMap (globalObject-> vm () , arg2))));
50805080}
50815081
50825082JSC__JSValue JSC__JSValue__fastGet_ (JSC__JSValue JSValue0, JSC__JSGlobalObject* globalObject, unsigned char arg2)
50835083{
50845084 JSC ::JSValue value = JSC::JSValue::decode (JSValue0);
50855085 ASSERT (value.isCell ());
5086- return JSValue::encode (value.getObject ()->getIfPropertyExists (globalObject, builtinNameMap (globalObject, arg2)));
5086+
5087+ JSC ::JSObject* object = value.getObject ();
5088+ ASSERT_WITH_MESSAGE (object, " fastGet() called on non-object. Check that the JSValue is an object before calling fastGet()." );
5089+ auto & vm = globalObject->vm ();
5090+ const auto property = JSC::PropertyName (builtinNameMap (vm, arg2));
5091+
5092+ return JSC::JSValue::encode (Bun::getIfPropertyExistsPrototypePollutionMitigation (vm, globalObject, object, property));
50875093}
50885094
50895095extern " C" JSC__JSValue JSC__JSValue__fastGetOwn (JSC__JSValue JSValue0, JSC__JSGlobalObject* globalObject, unsigned char arg2)
50905096{
50915097 JSC ::JSValue value = JSC::JSValue::decode (JSValue0);
50925098 ASSERT (value.isCell ());
50935099 PropertySlot slot = PropertySlot (value, PropertySlot::InternalMethodType::GetOwnProperty);
5094- const Identifier name = builtinNameMap (globalObject, arg2);
5100+ const Identifier name = builtinNameMap (globalObject-> vm () , arg2);
50955101 auto * object = value.getObject ();
50965102 if (object->getOwnPropertySlot (object, globalObject, name, slot)) {
50975103 return JSValue::encode (slot.getValue (globalObject, name));
0 commit comments