onilabs / stratifiedjs

Oni StratifiedJS (previously Apollo)
http://onilabs.com/stratifiedjs
Other
231 stars 22 forks source link

Apollo is not fully CommonJS comliant #2

Closed dotmaster closed 13 years ago

dotmaster commented 13 years ago

Hi, just to let you know, that apollo breaks with libraries, that rely on Common JS 1.1 Modules Spec. (most prominently underscore.js)

QUOTE FROM THE SPEC@ http://wiki.commonjs.org/wiki/Modules/1.1#Module_Context Section 1.3

In a module, there must be a free variable "module", that is an Object. The "module" object must have a read-only, don't delete "id" property that is the top-level "id" of the module. The "id" property must be such that require(module.id) will return the exports object from which the module.id originated. (That is to say module.id can be passed to another module, and requiring that must return the original module). The "module" object may have a "uri" String that is the fully-qualified URI to the resource from which the module was created. The "uri" property must not exist in a sandbox.

afri commented 13 years ago

Fixed on trunk. underscore.js is now working, see http://bit.ly/fDsSLV Thanks for reporting!

dotmaster commented 13 years ago

ccol thx!