babel-helper-evaluate-path
Advanced tools
Comparing version 0.5.0-alpha.6889f45d to 0.5.0-alpha.7195fa98
@@ -146,19 +146,21 @@ "use strict"; | ||
const declaration = binding.path.parentPath; | ||
/** | ||
* Handle when binding is created inside a parent block and | ||
* the corresponding parent is removed by other plugins | ||
* if (false) { var a } -> var a | ||
*/ | ||
if (declaration.parentPath && declaration.parentPath.removed) { | ||
return { | ||
confident: true, | ||
value: void 0 | ||
}; | ||
} | ||
if (declaration.parentPath) { | ||
/** | ||
* Handle when binding is created inside a parent block and | ||
* the corresponding parent is removed by other plugins | ||
* if (false) { var a } -> var a | ||
*/ | ||
if (declaration.parentPath.removed) { | ||
return { | ||
confident: true, | ||
value: void 0 | ||
}; | ||
} | ||
if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) { | ||
return { | ||
shouldDeopt: true | ||
}; | ||
if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) { | ||
return { | ||
shouldDeopt: true | ||
}; | ||
} | ||
} | ||
@@ -165,0 +167,0 @@ |
{ | ||
"name": "babel-helper-evaluate-path", | ||
"version": "0.5.0-alpha.6889f45d", | ||
"version": "0.5.0-alpha.7195fa98", | ||
"description": "path.evaluate wrapped in a try catch", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
9524
263