Permalink
Browse files

fixed potential issue with `m8.expose()` exposing a library when the …

…module/package it is being exposed to is not the `global` Object
  • Loading branch information...
1 parent 93cb70d commit 18d7e37ea3cca0c94afa5e2e036b9bc7bcff8b89 @constantology committed Dec 3, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 m8.js
  2. +1 −1 m8.min.js
  3. +1 −1 src/lib.js
View
2 m8.js
@@ -170,7 +170,7 @@
else
def( mod, name, describe( { value : lib }, 'ew' ) );
- if ( ENV == 'browser' )
+ if ( ENV == 'browser' && mod === root ) // don't expose as amd if lib is being added to a module that will be exposed
typeof define != 'function' || !define.amd || define( name, [], function() { return lib; } );
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -109,7 +109,7 @@
else
def( mod, name, describe( { value : lib }, 'ew' ) );
- if ( ENV == 'browser' )
+ if ( ENV == 'browser' && mod === root ) // don't expose as amd if lib is being added to a module that will be exposed
typeof define != 'function' || !define.amd || define( name, [], function() { return lib; } );
}

0 comments on commit 18d7e37

Please sign in to comment.