Permalink
Browse files

Resolved namespace rendering

  • Loading branch information...
1 parent efe1b3a commit f8bbae54e23c0e7dc01cbc45e8c457c05706a8ab @vinch vinch committed Aug 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/expose.js
View
@@ -64,7 +64,7 @@ function renderNamespace(str){
return str.split('.').map(function(part, i){
parts.push(part);
part = parts.join('.');
- return (i ? '' : 'window.') + part + ' = ' + part + ' || {};';
+ return (i ? '' : 'window.') + part + ' = typeof ' + part + ' !== \'undefined\' ? ' + part + ' : {};';
}).join('\n');
}

0 comments on commit f8bbae5

Please sign in to comment.