-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: expose DOMException to internalBinding('message') for testing #28072
Conversation
Instead of using a hack to get it in the test.
return domexception_ctor; | ||
} | ||
|
||
void ThrowDataCloneException(Local<Context> context, Local<String> message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax I think ideally we'd want to do this in JS instead of throwing the error in nested C++ helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joyeecheung We need to have this in C++, because the V8 ValueSerializer API requires it. I also don’t see any reason to move the error throwing to JS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this is required by ValueSerializer::Delegate::ThrowDataCloneError
- but do we need to throw errors this way ourselves? As this is just doing new DOMException(message, 'DataCloneError')
- I believe in general we prefer throwing errors from JS.
return domexception_ctor; | ||
} | ||
|
||
void ThrowDataCloneException(Local<Context> context, Local<String> message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joyeecheung We need to have this in C++, because the V8 ValueSerializer API requires it. I also don’t see any reason to move the error throwing to JS?
@nodejs/testing This needs one more approval to land |
Landed in 890223d, thanks for taking care of this! |
Instead of using a hack to get it in the test. PR-URL: nodejs#28072 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Instead of using a hack to get it in the test. PR-URL: #28072 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Instead of using a hack to get it in the test.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes