Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #586 from NTag/master
Browse files Browse the repository at this point in the history
Single named modules used as anonymous modules in ternaire conditions
  • Loading branch information
guybedford committed May 15, 2016
2 parents 009ecf9 + 5cf6bc4 commit d667134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compilers/amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ AMDDefineRegisterTransformer.prototype.transformCallExpression = function(tree)
*/
var nameAlias = '';
if (name && this.name && name != this.name)
nameAlias = ', define("' + name + '", ["' + this.name + '"], function(m) { return m; })';
nameAlias = '&& define("' + name + '", ["' + this.name + '"], function(m) { return m; })';

// write out the anonymous define as named and dep-normalized
return parseExpression(['define(' + (this.name ? '"' + this.name + '", ' : '') + JSON.stringify(deps) + ', ', ')' + nameAlias + ';'], factoryTree);
Expand Down

0 comments on commit d667134

Please sign in to comment.