mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +00:00
safety: a lot more exception checker progress (#20956)
This commit is contained in:
@@ -45,13 +45,14 @@ generateObjectModuleSourceCodeForJSON(JSC::JSGlobalObject* globalObject,
|
||||
Vector<JSC::Identifier, 4>& exportNames,
|
||||
JSC::MarkedArgumentBuffer& exportValues) -> void {
|
||||
auto& vm = JSC::getVM(lexicalGlobalObject);
|
||||
auto scope = DECLARE_THROW_SCOPE(vm);
|
||||
GlobalObject* globalObject = reinterpret_cast<GlobalObject*>(lexicalGlobalObject);
|
||||
JSC::EnsureStillAliveScope stillAlive(object);
|
||||
|
||||
PropertyNameArray properties(vm, PropertyNameMode::Strings,
|
||||
PrivateSymbolMode::Exclude);
|
||||
object->getPropertyNames(globalObject, properties,
|
||||
DontEnumPropertiesMode::Exclude);
|
||||
object->getPropertyNames(globalObject, properties, DontEnumPropertiesMode::Exclude);
|
||||
RETURN_IF_EXCEPTION(scope, {});
|
||||
gcUnprotectNullTolerant(object);
|
||||
|
||||
exportNames.append(vm.propertyNames->defaultKeyword);
|
||||
@@ -64,12 +65,8 @@ generateObjectModuleSourceCodeForJSON(JSC::JSGlobalObject* globalObject,
|
||||
|
||||
exportNames.append(entry);
|
||||
|
||||
auto scope = DECLARE_CATCH_SCOPE(vm);
|
||||
JSValue value = object->get(globalObject, entry);
|
||||
if (scope.exception()) [[unlikely]] {
|
||||
scope.clearException();
|
||||
value = jsUndefined();
|
||||
}
|
||||
RETURN_IF_EXCEPTION(scope, {});
|
||||
exportValues.append(value);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user