Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
v8: add a js class for Serializer/Deserializer
Calling Serializer/Deserializer without new crashes node.
Adding a js class which just inherits cpp bindings.
Added regression tests.

Fixes: #13326
  • Loading branch information
zimbabao committed Jun 8, 2017
commit 9643c6c20f6752bd40da023f2ec217e029954f49
14 changes: 4 additions & 10 deletions test/parallel/test-v8-serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,12 @@ const objects = [

{
assert.throws(
() => {
v8.Serializer();
},
Error,
"Class constructor Serializer cannot be invoked without 'new'"
() => { v8.Serializer(); },
/^TypeError: Class constructor Serializer cannot be invoked without 'new'$/
);

assert.throws(
() => {
v8.Derializer();
},
Error,
"Class constructor Deserializer cannot be invoked without 'new'"
() => { v8.Deserializer(); },
/^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/
);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should likely also add a note to the documentation clarifying the requirement