safety: a lot more exception checker progress (#20956)

This commit is contained in:
Meghan Denny
2025-07-15 23:11:19 -08:00
committed by GitHub
parent d8b37bf408
commit 875604a42b
102 changed files with 774 additions and 1383 deletions

View File

@@ -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);
}
};