fix bugs found by exception scope verification (#20285)

Co-authored-by: 190n <7763597+190n@users.noreply.github.com>
This commit is contained in:
190n
2025-06-18 23:08:19 -07:00
committed by GitHub
parent aa37ecb7a5
commit 346e97dde2
98 changed files with 4263 additions and 933 deletions

View File

@@ -158,6 +158,7 @@ JSC_DEFINE_CUSTOM_SETTER(jsSetter_INSPECT_MAX_BYTES, (JSGlobalObject * lexicalGl
DEFINE_NATIVE_MODULE(NodeBuffer)
{
INIT_NATIVE_MODULE(12);
auto scope = DECLARE_THROW_SCOPE(vm);
put(JSC::Identifier::fromString(vm, "Buffer"_s), globalObject->JSBufferConstructor());
@@ -192,9 +193,11 @@ DEFINE_NATIVE_MODULE(NodeBuffer)
JSC::Identifier atobI = JSC::Identifier::fromString(vm, "atob"_s);
JSC::JSValue atobV = lexicalGlobalObject->get(globalObject, PropertyName(atobI));
RETURN_IF_EXCEPTION(scope, );
JSC::Identifier btoaI = JSC::Identifier::fromString(vm, "btoa"_s);
JSC::JSValue btoaV = lexicalGlobalObject->get(globalObject, PropertyName(btoaI));
RETURN_IF_EXCEPTION(scope, );
put(atobI, atobV);
put(btoaI, btoaV);