fix pure_getters on spread of objects (#2275)

This commit is contained in:
Alex Lam S.L
2017-08-13 22:08:33 +08:00
committed by GitHub
parent 2ed3f8db44
commit 2bf8216e50
2 changed files with 79 additions and 1 deletions

View File

@@ -1427,9 +1427,14 @@ merge(Compressor.prototype, {
def(AST_Object, function(compressor) {
if (!is_strict(compressor)) return false;
for (var i = this.properties.length; --i >=0;)
if (this.properties[i].value instanceof AST_Accessor) return true;
if (this.properties[i]._dot_throw(compressor)) return true;
return false;
});
def(AST_ObjectProperty, return_false);
def(AST_ObjectGetter, return_true);
def(AST_Expansion, function(compressor) {
return this.expression._dot_throw(compressor);
});
def(AST_Function, return_false);
def(AST_Arrow, return_false);
def(AST_UnaryPostfix, return_false);