Skip to content

Commit

Permalink
reduce test exports (#3361)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed Apr 17, 2019
1 parent 5172ba5 commit 21cd7e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/parse.js
Expand Up @@ -164,10 +164,6 @@ function is_unicode_connector_punctuation(ch) {
return UNICODE.connector_punctuation.test(ch);
}

function is_identifier(name) {
return !RESERVED_WORDS[name] && /^[a-z_$][a-z0-9_$]*$/i.test(name);
}

function is_identifier_start(code) {
return code == 36 || code == 95 || is_letter(code);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/scope.js
Expand Up @@ -342,7 +342,7 @@ function next_mangled_name(scope, options, def) {
}
while (true) {
name = base54(++scope.cname);
if (in_use[name] || !is_identifier(name) || options.reserved.has[name]) continue;
if (in_use[name] || RESERVED_WORDS[name] || options.reserved.has[name]) continue;
if (!names[name]) break;
holes.push(scope.cname);
}
Expand Down Expand Up @@ -422,7 +422,7 @@ AST_Toplevel.DEFMETHOD("mangle_names", function(options) {
var name;
do {
name = base54(++lname);
} while (!is_identifier(name));
} while (RESERVED_WORDS[name]);
node.mangled_name = name;
return true;
}
Expand Down Expand Up @@ -493,7 +493,7 @@ AST_Toplevel.DEFMETHOD("expand_names", function(options) {
var name;
do {
name = base54(cname++);
} while (avoid[name] || !is_identifier(name));
} while (avoid[name] || RESERVED_WORDS[name]);
return name;
}

Expand Down
3 changes: 0 additions & 3 deletions test/exports.js
@@ -1,15 +1,12 @@
exports["base54"] = base54;
exports["Compressor"] = Compressor;
exports["defaults"] = defaults;
exports["is_identifier"] = is_identifier;
exports["JS_Parse_Error"] = JS_Parse_Error;
exports["mangle_properties"] = mangle_properties;
exports["minify"] = minify;
exports["OutputStream"] = OutputStream;
exports["parse"] = parse;
exports["push_uniq"] = push_uniq;
exports["reserve_quoted_keys"] = reserve_quoted_keys;
exports["SourceMap"] = SourceMap;
exports["string_template"] = string_template;
exports["tokenizer"] = tokenizer;
exports["TreeTransformer"] = TreeTransformer;
Expand Down

0 comments on commit 21cd7e3

Please sign in to comment.