Skip to content

Commit 9643c6c

Browse files
committed
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
1 parent e09951d commit 9643c6c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

test/parallel/test-v8-serdes.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,12 @@ const objects = [
134134

135135
{
136136
assert.throws(
137-
() => {
138-
v8.Serializer();
139-
},
140-
Error,
141-
"Class constructor Serializer cannot be invoked without 'new'"
137+
() => { v8.Serializer(); },
138+
/^TypeError: Class constructor Serializer cannot be invoked without 'new'$/
142139
);
143140

144141
assert.throws(
145-
() => {
146-
v8.Derializer();
147-
},
148-
Error,
149-
"Class constructor Deserializer cannot be invoked without 'new'"
142+
() => { v8.Deserializer(); },
143+
/^TypeError: Class constructor Deserializer cannot be invoked without 'new'$/
150144
);
151145
}

0 commit comments

Comments
 (0)