HoriSun / closure-compiler

Automatically exported from code.google.com/p/closure-compiler
0 stars 0 forks source link

Advanced optimization removes nested code #874

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile this code:

// ==ClosureCompiler==
// @output_file_name default.js
// @compilation_level ADVANCED_OPTIMIZATIONS
// @formatting pretty_print
// ==/ClosureCompiler==
var ImageEditor;
(function (ImageEditor) {
    (function (View) {
        View.defaultLeftPaneWidth = 200;
        var Editor = (function () {
            function Editor(a, b) {
                return a + b;
            }
            return Editor;
        })();
        View.Editor = Editor;        
    })(ImageEditor.View || (ImageEditor.View = {}));
    var View = ImageEditor.View;
})(ImageEditor || (ImageEditor = {}));
window["ImageEditor"]['View']["Editor"] = ImageEditor.View.Editor;

What is the expected output? What do you see instead?
Expected output:
var a, b = a || (a = {});
(b.a || (b.a = {})).b = function(c, d) {
  return c + d
};
window.ImageEditor.View.Editor = a.a.b;

Current output:
var a, b = a || (a = {});
b.a || (b.a = {});
window.ImageEditor.View.Editor = a.a.b;

What version of the product are you using? On what operating system?
Built at r2388

Please provide any additional information below.

Original issue reported on code.google.com by janousek...@gmail.com on 13 Dec 2012 at 2:46

GoogleCodeExporter commented 8 years ago
Issue 875 has been merged into this issue.

Original comment by concavel...@gmail.com on 13 Dec 2012 at 10:12

GoogleCodeExporter commented 8 years ago

Original comment by concavel...@gmail.com on 13 Dec 2012 at 10:12

GoogleCodeExporter commented 8 years ago
Thanks for the report

Original comment by concavel...@gmail.com on 13 Dec 2012 at 10:13

GoogleCodeExporter commented 8 years ago
@john -- did you start working on this?

Original comment by Nicholas.J.Santos on 18 Dec 2012 at 12:04

GoogleCodeExporter commented 8 years ago
no, I dug out a out CL of mine but I didn't like it.  I haven't started 
anything else.

Original comment by concavel...@gmail.com on 18 Dec 2012 at 2:41

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2429.

Original comment by `` on 4 Jan 2013 at 2:00