update protodef

This commit is contained in:
Romain Beaumont 2016-02-21 19:40:10 +01:00
parent ba2d791d75
commit 836b36640a
2 changed files with 3 additions and 4 deletions

View file

@ -45,7 +45,7 @@
"buffer-equal": "1.0.0",
"minecraft-data": "^1.0.3",
"prismarine-nbt": "0.2.1",
"protodef": "^1.0.1",
"protodef": "^1.1.1",
"readable-stream": "^2.0.5",
"ursa-purejs": "0.0.3",
"uuid-1345": "^0.99.6",

View file

@ -1,5 +1,4 @@
const [readVarInt, writeVarInt, sizeOfVarInt] = require("protodef").types.varint;
const {PartialReadError} = require("protodef").utils;
const Transform = require("readable-stream").Transform;
module.exports.createSplitter = function() {
@ -54,7 +53,7 @@ class Splitter extends Transform {
({ value, size, error } = readVarInt(this.buffer, offset));
}
catch(e) {
if(!(e instanceof PartialReadError)) {
if(!(e.partialReadError)) {
throw e;
}
else
@ -68,7 +67,7 @@ class Splitter extends Transform {
({value, size, error} = readVarInt(this.buffer, offset));
}
catch(e) {
if(e instanceof PartialReadError) {
if(e.partialReadError) {
break;
}
else