From 452e9751eebccd43bc2111f3e835b075aa285262 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 31 Jan 2019 10:26:18 -0800 Subject: [PATCH] preserve whether an object property is quoted in mozilla-ast.js --- lib/mozilla-ast.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js index dace808ab54..88e957fbe4f 100644 --- a/lib/mozilla-ast.js +++ b/lib/mozilla-ast.js @@ -137,7 +137,12 @@ end : my_end_token(M), properties : M.properties.map(function(prop) { 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; }) }); },