-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
v8: add a js class for Serializer/Dserializer #13541
Changes from 3 commits
b39baec
90c50a6
e09951d
9643c6c
955a1bb
1de429c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,3 +131,21 @@ const objects = [ | |
|
||
assert.deepStrictEqual(v8.deserialize(buf), expectedResult); | ||
} | ||
|
||
{ | ||
assert.throws( | ||
() => { | ||
v8.Serializer(); | ||
}, | ||
Error, | ||
"Class constructor Serializer cannot be invoked without 'new'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you do something more like this: assert.throws(
() => { v8.Serializer(); },
/^Error: Class constructor Serializer cannot be invoked without 'new'$/
); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cjihrig : Done |
||
); | ||
|
||
assert.throws( | ||
() => { | ||
v8.Derializer(); | ||
}, | ||
Error, | ||
"Class constructor Deserializer cannot be invoked without 'new'" | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should likely also add a note to the documentation clarifying the requirement |
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'd prefer something like:
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.
Will resend.
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.
@jasnell : Made changes and added a note.