Skip to content

Commit

Permalink
v8: add a js class for Serializer/Dserializer
Browse files Browse the repository at this point in the history
Calling Serializer/Deserlizer without new crashes node.
Adding a js class which just inherits cpp bindings.

Fixes: nodejs#13326
  • Loading branch information
zimbabao committed Jun 8, 2017
1 parent b39baec commit 90c50a6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-v8-serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,19 @@ const objects = [

assert.deepStrictEqual(v8.deserialize(buf), expectedResult);
}

{
try {
v8.Serializer();
} catch (e) {
const m = "Class constructor Serializer cannot be invoked without 'new'";
assert.strictEqual(e.message, m);
}

try {
v8.Deserializer();
} catch (e) {
const m = "Class constructor Deserializer cannot be invoked without 'new'";
assert.strictEqual(e.message, m);
}
}

0 comments on commit 90c50a6

Please sign in to comment.