From 7162beaa649100b2c772ca2a57cfa9039c3559d5 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 7 Apr 2021 21:58:54 -0400 Subject: [PATCH] test: add regression test for serdes readDouble() Refs: https://github.com/nodejs/node/issues/37978 PR-URL: https://github.com/nodejs/node/pull/38121 Reviewed-By: James M Snell Reviewed-By: Jiawen Geng Reviewed-By: Darshan Sen --- test/parallel/test-v8-serdes.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 9b153739c57270..f080f551396c8b 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -236,3 +236,10 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); /^TypeError: buffer must be a TypedArray or a DataView$/, ); } + +{ + // Regression test for https://github.com/nodejs/node/issues/37978 + assert.throws(() => { + new v8.Deserializer(new v8.Serializer().releaseBuffer()).readDouble(); + }, /ReadDouble\(\) failed/); +}