node-bin-packing icon indicating copy to clipboard operation
node-bin-packing copied to clipboard

Bug in node-webkit environment

Open yuguo opened this issue 12 years ago • 1 comments

I'm running node-bin-packing in node-webkit environment, and it crashes.

after some research, i found that in this file:

https://github.com/jsmarkus/node-bin-packing/blob/master/js/packer.growing.js

(typeof window !== 'undefined' ? window : module.exports);

is not correct. it assume if an environment don't have window variable, it's node, but node-webkit have window and module and exports variable as global variables, and i do want to assign the anonymous function to module.exports.

so i recommend changing the judge condition, thank you!

yuguo avatar Nov 22 '13 10:11 yuguo

It looks like https://github.com/bryanburgers/bin-pack is node only so that should work

twolfson avatar Feb 19 '15 05:02 twolfson