Skip to content

Commit b77a52b

Browse files
committed
add reserved words to avoid syntax errors
1 parent 16a5831 commit b77a52b

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

lib/optimize/ConcatenatedModule.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,34 @@ class ConcatenatedModule extends Module {
448448
});
449449

450450
// List of all used names to avoid conflicts
451-
const allUsedNames = new Set(["__WEBPACK_MODULE_DEFAULT_EXPORT__", "Object"]);
451+
const allUsedNames = new Set([
452+
"abstract", "arguments", "await", "boolean", "break", "byte", "case", "catch", "char", "class",
453+
"const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "eval",
454+
"export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if",
455+
"implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new",
456+
"null", "package", "private", "protected", "public", "return", "short", "static", "super",
457+
"switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof",
458+
"var", "void", "volatile", "while", "with", "yield",
459+
460+
"Array", "Date", "eval", "function", "hasOwnProperty", "Infinity", "isFinite", "isNaN",
461+
"isPrototypeOf", "length", "Math", "NaN", "name", "Number", "Object", "prototype", "String",
462+
"toString", "undefined", "valueOf",
463+
464+
"alert", "all", "anchor", "anchors", "area", "assign", "blur", "button", "checkbox",
465+
"clearInterval", "clearTimeout", "clientInformation", "close", "closed", "confirm", "constructor",
466+
"crypto", "decodeURI", "decodeURIComponent", "defaultStatus", "document", "element", "elements",
467+
"embed", "embeds", "encodeURI", "encodeURIComponent", "escape", "event", "fileUpload", "focus",
468+
"form", "forms", "frame", "innerHeight", "innerWidth", "layer", "layers", "link", "location",
469+
"mimeTypes", "navigate", "navigator", "frames", "frameRate", "hidden", "history", "image",
470+
"images", "offscreenBuffering", "open", "opener", "option", "outerHeight", "outerWidth",
471+
"packages", "pageXOffset", "pageYOffset", "parent", "parseFloat", "parseInt", "password", "pkcs11",
472+
"plugin", "prompt", "propertyIsEnum", "radio", "reset", "screenX", "screenY", "scroll", "secure",
473+
"select", "self", "setInterval", "setTimeout", "status", "submit", "taint", "text", "textarea",
474+
"top", "unescape", "untaint", "window",
475+
476+
"onblur", "onclick", "onerror", "onfocus", "onkeydown", "onkeypress", "onkeyup", "onmouseover",
477+
"onload", "onmouseup", "onmousedown", "onsubmit"
478+
]);
452479

453480
// get all global names
454481
modulesWithInfo.forEach(info => {

0 commit comments

Comments
 (0)