Export to GitHub

v8cgi - issue #99

binary-b error


Posted on Oct 13, 2011 by Quick Rabbit

var ByteArray = require('binary-b').ByteArray;

produce an error:

TypeError: Cannot read property 'prototype' of undefined (/usr/local/Cellar/v8cgi/0.9.1/lib/binary-b.js:60) TypeError: Cannot read property 'prototype' of undefined at Object.

Maybe I am using it wrong ( some prerequisites?), but Buffer from binary module works.

Comment #1

Posted on Oct 13, 2011 by Happy Giraffe

The "binary-b" module (as well as "binary") is a "hybrid" module: it has a JS implementation and a C++ counterpart. Both must be available in order to use it.

The issue you see is caused by the fact that the C++ part of binary-b is not available, e.g. was not compiled. The trouble here is that there is no offical way to compile binary-b, as the SConstruct defines compilation only for "binary" module.

As a bugfix, I will add a "binary-b=1" option to SConstruct so that people can try binary-b as well. Note, however, that all components of v8cgi that need to manipulate binary data will still use "binary" instead of "binary-b".

Comment #2

Posted on Dec 14, 2011 by Happy Giraffe

binary_b=1 commited in r977.

Status: Fixed

Labels:
Type-Defect Priority-Medium