tlrobinson / narwhal

[DEPRECATED] A JavaScript standard library, package manager, and more.
http://narwhaljs.org/
372 stars 16 forks source link

require("packages").resource does not work in a sandbox #80

Open kriszyp opened 14 years ago

kriszyp commented 14 years ago

When I turn Jack's reloader functionality on, I get this error when I call the resource function in the packages module: TypeError: Cannot read property "length" from undefined at C:\dev\narwhal\lib\packages.js:9

kriszyp commented 14 years ago

I guess basically the issue is that some modules expect to really be singletons. Another module that behaves poorly when instantiated multiple times (as the reloader does) is the event-queue. Perhaps we need to include the modules option in the reloader middleware that includes "packages" and "event-queue" modules... But this certainly doesn't seem very scalable, it would be nice to be able to smarter selection of which modules get reloaded, like be able to have a sandbox that only reloads modules from a certain package (or packages).