fix iteration over object with inherited properties (#2068)

fixes #2055
This commit is contained in:
Alex Lam S.L
2017-06-08 03:27:03 +08:00
committed by GitHub
parent 9db0695b10
commit 9c306406f1
3 changed files with 22 additions and 3 deletions

View File

@@ -1419,7 +1419,7 @@ merge(Compressor.prototype, {
});
if (value && typeof value == "object") {
var props = [];
for (var key in value) {
for (var key in value) if (HOP(value, key)) {
props.push(make_node(AST_ObjectKeyVal, orig, {
key: key,
value: to_node(value[key], orig)