Add --reserve-domprops along with a default exclusion list in tools/domprops.json

This commit is contained in:
Mihai Bazon
2015-03-18 12:09:09 +02:00
parent 3ef092332b
commit 03b6121194
2 changed files with 4497 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ You need to pass an argument to this option to specify the name that your module
.describe("keep-fnames", "Do not mangle/drop function names. Useful for code relying on Function.prototype.name.")
.describe("quotes", "Quote style (0 - auto, 1 - single, 2 - double, 3 - original)")
.describe("reserved-file", "File containing reserved names")
.describe("reserve-domprops", "Make (most?) DOM properties reserved for --mangle-props")
.describe("mangle-props", "Mangle property names")
.describe("name-cache", "File to hold mangled names mappings")
@@ -112,6 +113,7 @@ You need to pass an argument to this option to specify the name that your module
.boolean("bare-returns")
.boolean("keep-fnames")
.boolean("mangle-props")
.boolean("reserve-domprops")
.wrap(80)
@@ -156,6 +158,10 @@ if (ARGS.reserved_file) ARGS.reserved_file.forEach(function(filename){
RESERVED = UglifyJS.readReservedFile(filename, RESERVED);
});
if (ARGS.reserve_domprops) {
RESERVED = UglifyJS.readReservedFile(path.join(__dirname, "..", "tools", "domprops.json"), RESERVED);
}
if (ARGS.d) {
if (COMPRESS) COMPRESS.global_defs = getOptions("d");
}

4491
tools/domprops.json Normal file

File diff suppressed because it is too large Load Diff