preserve whether an object property is quoted in mozilla-ast.js

This commit is contained in:
Alon Zakai 2019-01-31 10:26:18 -08:00
parent ea999b0e92
commit 452e9751ee

View File

@ -137,7 +137,12 @@
end : my_end_token(M), end : my_end_token(M),
properties : M.properties.map(function(prop) { properties : M.properties.map(function(prop) {
prop.type = "Property"; prop.type = "Property";
return from_moz(prop) var ret = from_moz(prop);
if (prop.key.type === "Literal" &&
(prop.key.raw[0] === '"' || prop.key.raw[0] === "'")) {
ret.quote = true;
}
return ret;
}) })
}); });
}, },