Last active
August 29, 2015 13:57
-
-
Save jugglinmike/9439131 to your computer and use it in GitHub Desktop.
Converting AMD early returns to generic equivalent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function() { | |
if (true) { | |
return 23; | |
} | |
return 45; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (function() { | |
if (true) { | |
return 23; | |
} | |
return 45; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRANSMOGRIFY: { | |
if (true) { | |
module.exports = 23; | |
break TRANSMOGRIFY; | |
} | |
module.exports = 45; | |
break TRANSMOGRIFY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment