Skip to content

Commit ec447f9

Browse files
authored
Merge pull request #7 from peers/fix/classSerialization
fix from binaryjs#13
2 parents 985d788 + 1d05f93 commit ec447f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/binarypack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Packer.prototype.pack = function(value){
300300
} else {
301301
this.pack_bin(value.buffer);
302302
}
303-
} else if (constructor == Object){
303+
} else if ((constructor == Object) || (constructor.toString().startsWith('class'))){
304304
this.pack_object(value);
305305
} else if (constructor == Date){
306306
this.pack_string(value.toString());

0 commit comments

Comments
 (0)