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 b4da30f commit b39baec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/v8.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
'use strict';

const { Buffer } = require('buffer');
const { Serializer, Deserializer } = process.binding('serdes');
const serdesBindings = process.binding('serdes');
const { copy } = process.binding('buffer');
const { objectToString } = require('internal/util');
const { FastBuffer } = require('internal/buffer');

class Serializer extends serdesBindings.Serializer {}

class Deserializer extends serdesBindings.Deserializer {}

const {
cachedDataVersionTag,
setFlagsFromString,
Expand Down

0 comments on commit b39baec

Please sign in to comment.