Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_this.referencingDefaultValue(pattern, info.assignments, null, true);
});
}
// if there's a rest argument, add that
if (node.rest) {
this.visitPattern({
type: "RestElement",
argument: node.rest
}, function (pattern) {
_this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, node.params.length, true));
});
}
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
this.close(node);
}
},
_this.referencingDefaultValue(pattern, info.assignments, null, true);
});
}
// if there's a rest argument, add that
if (node.rest) {
this.visitPattern({
type: "RestElement",
argument: node.rest
}, function (pattern) {
_this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, node.params.length, true));
});
}
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
this.close(node);
}
},
this.currentScope().__define(pattern,
new ParameterDefinition(
pattern,
node,
node.params.length,
true
));
});
}
// In TypeScript there are a number of function-like constructs which have no body,
// so check it exists before traversing
if (node.body) {
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
}
this.close(node);
}
this.visitPattern({
type: 'RestElement',
argument: node.rest
}, (pattern) => {
this.currentScope().__define(pattern,
new ParameterDefinition(
pattern,
node,
node.params.length,
true
));
});
}
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
this.close(node);
}
this.currentScope().__define(pattern,
new ParameterDefinition(
pattern,
node,
node.params.length,
true
));
});
}
// In TypeScript there are a number of function-like constructs which have no body,
// so check it exists before traversing
if (node.body) {
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
}
this.close(node);
}
this.visitPattern({
type: 'RestElement',
argument: node.rest
}, (pattern) => {
this.currentScope().__define(pattern,
new ParameterDefinition(
pattern,
node,
node.params.length,
true
));
});
}
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
this.close(node);
}
_this.referencingDefaultValue(pattern, info.assignments, null, true);
});
}
// if there's a rest argument, add that
if (node.rest) {
this.visitPattern({
type: "RestElement",
argument: node.rest
}, function (pattern) {
_this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, node.params.length, true));
});
}
// Skip BlockStatement to prevent creating BlockStatement scope.
if (node.body.type === Syntax.BlockStatement) {
this.visitChildren(node.body);
} else {
this.visit(node.body);
}
this.close(node);
}
},
function cpsFinalStatement(node, k, fk) {
return match(node, [
clause(Syntax.BlockStatement, function(body) {
return cpsSequence(body, 0, k, fk);
}),
clause(Syntax.EmptyStatement, function() {
return cps(build.identifier('undefined'), k);
}),
clause(Syntax.ExpressionStatement, function(expression) {
return cps(expression, k);
}),
clause(Syntax.IfStatement, function(test, consequent, alternate) {
if (!alternate) {
alternate = build.emptyStatement();
}
return bindContinuation(k, function(k) { // most likely unnecessary
return atomize(test, function(test) {
return build.conditionalExpression(test,
}
if (isMethodDefinition) {
return true;
}
if (scope.type === "class" || scope.type === "module") {
return true;
}
if (scope.type === "block" || scope.type === "switch") {
return false;
}
if (scope.type === "function") {
if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) {
return false;
}
if (block.type === Syntax.Program) {
body = block;
} else {
body = block.body;
}
if (!body) {
return false;
}
} else if (scope.type === "global") {
body = block;
} else {
return false;
function linearizeSequence(ss, i, ks) {
if (i === ss.length) {
return ks;
}
else {
ks = linearizeSequence(ss, i + 1, ks);
return match(ss[i], [
clause(Syntax.BlockStatement, function(body) {
return linearizeSequence(body, 0, ks);
}),
clause(Syntax.IfStatement, function(test, consequent, alternate) {
if (alternate === null) {
alternate = build.emptyStatement();
}
if (hasReturn(consequent) || hasReturn(alternate)) {
return [build.ifStatement(
test,
build.blockStatement(linearizeSequence([consequent], 0, ks)),
build.blockStatement(linearizeSequence([alternate], 0, ks)))];
}
else {
return [build.ifStatement(test, consequent, alternate)].concat(ks);
}