From aa635409759aeb61ff5c39e028296c64653ae39b Mon Sep 17 00:00:00 2001 From: yangweixian Date: Sun, 26 Nov 2017 22:20:52 +0800 Subject: [PATCH] fix tools/domprops.json is not mixed in reserved, when use API option Mangle properties --- lib/propmangle.js | 1 + tools/node.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/propmangle.js b/lib/propmangle.js index 36a67e80..c0abf6e8 100644 --- a/lib/propmangle.js +++ b/lib/propmangle.js @@ -62,6 +62,7 @@ function find_builtins(reserved) { Object.getOwnPropertyNames(ctor.prototype).map(add); } }); + domprops.forEach(add); function add(name) { push_uniq(reserved, name); } diff --git a/tools/node.js b/tools/node.js index dc270106..ce5abeb4 100644 --- a/tools/node.js +++ b/tools/node.js @@ -23,6 +23,7 @@ new Function("MOZ_SourceMap", "exports", function() { return fs.readFileSync(file, "utf8"); }); code.push("exports.describe_ast = " + describe_ast.toString()); + code.push(";var domprops = " + JSON.stringify(require("./domprops.json"))); return code.join("\n\n"); }())( require("source-map"),