Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var c = cases[i];
n.SwitchCase.assert(c);
if (c.test) {
condition = b.conditionalExpression(
b.binaryExpression("===", disc, c.test),
caseLocs[i] = loc(),
condition
);
} else {
caseLocs[i] = defaultLoc;
}
}
self.jump(self.explodeExpression(
new types.NodePath(condition, path, "discriminant")
));
self.leapManager.withEntry(
new leap.SwitchEntry(after),
function() {
path.get("cases").each(function(casePath) {
var c = casePath.value;
var i = casePath.name;
self.mark(caseLocs[i]);
casePath.get("consequent").each(
self.explodeStatement,
self
);
});
var c = cases[i];
n.SwitchCase.assert(c);
if (c.test) {
condition = b.conditionalExpression(
b.binaryExpression("===", disc, c.test),
caseLocs[i] = loc(),
condition
);
} else {
caseLocs[i] = defaultLoc;
}
}
self.jump(self.explodeExpression(
new types.NodePath(condition, path, "discriminant")
));
self.leapManager.withEntry(
new leap.SwitchEntry(after),
function() {
path.get("cases").each(function(casePath) {
var c = casePath.value;
var i = casePath.name;
self.mark(caseLocs[i]);
casePath.get("consequent").each(
self.explodeStatement,
self
);
});