If space don't have static objects, in 2565 lines in cp.js file
if(this.root) subtreeQuery(this.root, bb, func);
this - global node js object, and it have root property. And the condition is true, although this don't cp.BBTree. Additional check on the this instanceof cp.BBTree solves the problem.
If space don't have static objects, in 2565 lines in cp.js file
if(this.root) subtreeQuery(this.root, bb, func);this- global node js object, and it haverootproperty. And the condition is true, althoughthisdon'tcp.BBTree. Additional check on thethis instanceof cp.BBTreesolves the problem.