Skip to content

Commit

Permalink
v8: add a js class for Serializer/Deserializer
Browse files Browse the repository at this point in the history
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
1 parent e09951d commit 9643c6c
Showing 1 changed file with 4 additions and 10 deletions.
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'$/
);
}

0 comments on commit 9643c6c

Please sign in to comment.