Skip to content

Instantly share code, notes, and snippets.

@YellowAfterlife
Created July 20, 2014 14:38
Show Gist options
  • Save YellowAfterlife/f738c9ef3dc193f69457 to your computer and use it in GitHub Desktop.
Save YellowAfterlife/f738c9ef3dc193f69457 to your computer and use it in GitHub Desktop.
Does Google Closure not like this for-loop macros?
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// @formatting pretty_print
// ==/ClosureCompiler==
// Before Closure: 0, 1, 3
// After Closure: 0, 1, 3, 5, 6
// Bug
(function () { "use strict";
var Main = function() { };
Main.main = function() {
var i = 0;
while(i < 7) {
var _ = true;
do {
if(i == 2) continue;
if(i == 4) break;
console.log(i);
} while(_ = false);
if(_) break;
i++;
}
};
Main.main();
})();
//# sourceMappingURL=TestJS.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment