Skip to content

Commit

Permalink
[fix] Restore compatibility with older versions of binary-pack
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Apr 18, 2015
1 parent 6952417 commit 6f6ea17
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions parsers/binary.js
@@ -1,7 +1,6 @@
'use strict';

var BinaryPack = require('binary-pack')
, library = BinaryPack.BrowserSource;
var BinaryPack = require('binary-pack');

/**
* Message encoder.
Expand Down Expand Up @@ -42,7 +41,11 @@ exports.library = [
'var BinaryPack = (function () {',
' try { return require("binary-pack"); }',
' catch (e) {}',
' return '+ library.slice(library.indexOf('return ') + 7, -4) +';',
' var exports = {};',
' (function () { ',
BinaryPack.BrowserSource,
' }).call(exports);',
' return exports.BinaryPack;',
'})();',
''
].join('\n');

0 comments on commit 6f6ea17

Please sign in to comment.