src: use correct way to signal interceptor error

PR-URL: https://github.com/nodejs/node/pull/54418
Refs: e4f61de14f/deps/v8/include/v8-function-callback.h (L398-L408)
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
Michaël Zasso 2024-08-24 19:09:39 +02:00 committed by GitHub
parent 6dce10ff77
commit c062b5242a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -572,8 +572,8 @@ static Intercepted StorageSetter(Local<Name> property,
Storage* storage;
ASSIGN_OR_RETURN_UNWRAP(&storage, info.This(), Intercepted::kNo);
if (storage->Store(property, value)) {
info.GetReturnValue().Set(value);
if (!storage->Store(property, value)) {
info.GetReturnValue().SetFalse();
}
return Intercepted::kYes;