default optional builder keys to false

This commit is contained in:
Sebastian McKenzie
2015-02-11 00:02:51 +11:00
parent 62fa583fc1
commit 0c1e1e757c
2 changed files with 12 additions and 7 deletions

View File

@@ -197,11 +197,10 @@ TailCallTransformer.prototype.subTransformSequenceExpression = function (node) {
};
TailCallTransformer.prototype.subTransformCallExpression = function (node) {
var callee = node.callee, prop, thisBinding, args;
var callee = node.callee, thisBinding, args;
if (t.isMemberExpression(callee, { computed: false }) &&
t.isIdentifier(prop = callee.property)) {
switch (prop.name) {
if (t.isMemberExpression(callee, { computed: false }) && t.isIdentifier(callee.property)) {
switch (callee.property.name) {
case "call":
args = t.arrayExpression(node.arguments.slice(1));
break;

View File

@@ -105,9 +105,15 @@ each(t.BUILDER_KEYS, function (keys, type) {
var node = new Node;
node.start = null;
node.type = type;
each(keys, function (key, i) {
node[key] = args[i];
});
for (var i = 0; i < keys.length; i++) {
var arg = args[i];
if (arg === undefined) arg = false;
var key = keys[i];
node[key] = arg;
}
return node;
};
});