The following code:
(function() {
var hello = function(name) {
alert('Hello, ' + name);
}
hello('New user');
})();
with ADVANCED_OPTIMIZATIONS
is compiled to:
alert("Hello, New user");
But this code:
(function() {
var hello = function(name) {
alert('Hello, ' + name);
}
hello.a = 5;
hello('New user');
})();
is compiled to:
function a(b){alert("Hello, "+b)}a.a=5;a("New user");
Why it cannot ignore the hello.a = 5
?
(It cannot be used outside the context, there is no eval
, no []
and no new Function()
.)