-
Notifications
You must be signed in to change notification settings - Fork 168
Add DOMException #1040
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
base: master
Are you sure you want to change the base?
Add DOMException #1040
Conversation
@@ -285,10 +285,10 @@ function bjson_test_bytecode() | |||
function bjson_test_fuzz() | |||
{ | |||
var corpus = [ | |||
"FBAAAAAABGA=", |
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.
Note: this was complaining because of the bytecode version, but I don't know how the corpus was generated so I just incremented it manually...
It's still missing a stack trace when created with the constructor... |
I was confused for a minute because browsers set |
Perhaps you could use Js_NewError and extract it? |
I think that should be fine. |
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.
LGTM with a small comment, good work!
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.
Nice work!
Implemented separately from the other errors because it is defined in terms of WebIDL, where members of an interface are getters on their prototype. See the difference between `JSON.stringify(Object.getOwnPropertyDescriptors(new TypeError()))` vs `JSON.stringify(Object.getOwnPropertyDescriptors(new DOMException()))`. Note: the standard doesn't specify where to put "stack". We follow existing practice which imitates node instead of browsers.
Implemented separately from the other errors because it is defined in terms of WebIDL, where members of an interface are getters on their prototype.
See the difference between
JSON.stringify(Object.getOwnPropertyDescriptors(new TypeError()))
vsJSON.stringify(Object.getOwnPropertyDescriptors(new DOMException()))
.(Required for btoa/atob and structuredClone; ref. #16, #1032)