This commit is contained in:
Richard van Velzen 2016-04-12 18:48:07 +00:00
commit 7516c3a0e9
2 changed files with 35 additions and 2 deletions

View File

@ -1030,8 +1030,16 @@ merge(Compressor.prototype, {
: ev(this.alternative, compressor);
});
def(AST_SymbolRef, function(compressor){
if (this._evaluating) throw def;
this._evaluating = true;
try {
var d = this.definition();
if (d && d.constant && d.init) return ev(d.init, compressor);
if (d && d.constant && d.init) {
return ev(d.init, compressor);
}
} finally {
this._evaluating = false;
}
throw def;
});
def(AST_Dot, function(compressor){

View File

@ -0,0 +1,25 @@
const_declaration: {
options = {
evaluate: true
};
input: {
const goog = goog || {};
}
expect: {
const goog = goog || {};
}
}
const_pragma: {
options = {
evaluate: true
};
input: {
/** @const */ var goog = goog || {};
}
expect: {
var goog = goog || {};
}
}