fix empty whitelist in build-external-helpers - fixes #1129
This commit is contained in:
@@ -50,9 +50,9 @@ function buildVar(namespace, builder) {
|
||||
return t.program(body);
|
||||
}
|
||||
|
||||
function buildHelpers(body, namespace, whitelist = []) {
|
||||
function buildHelpers(body, namespace, whitelist) {
|
||||
each(File.helpers, function (name) {
|
||||
if (whitelist.length && whitelist.indexOf(name) === -1) return;
|
||||
if (whitelist && whitelist.indexOf(name) === -1) return;
|
||||
|
||||
var key = t.identifier(t.toIdentifier(name));
|
||||
body.push(t.expressionStatement(
|
||||
|
||||
@@ -33,5 +33,11 @@ suite("api", function () {
|
||||
assert.ok(script.indexOf("classCallCheck") === -1);
|
||||
assert.ok(script.indexOf("inherits") >= 0);
|
||||
});
|
||||
|
||||
test("empty whitelist", function () {
|
||||
var script = buildExternalHelpers([]);
|
||||
assert.ok(script.indexOf("classCallCheck") === -1);
|
||||
assert.ok(script.indexOf("inherits") === -1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user