Handle _blockHoist value of zero safely

This commit is contained in:
kpdecker 2015-07-20 11:06:09 +03:00
parent b2e3a73e2f
commit 4eb1a45f02

View File

@ -829,7 +829,7 @@ export default class Scope {
var unique = opts.unique; var unique = opts.unique;
var kind = opts.kind || "var"; var kind = opts.kind || "var";
var blockHoist = opts._blockHoist || 2; var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
var dataKey = `declaration:${kind}:${blockHoist}`; var dataKey = `declaration:${kind}:${blockHoist}`;
var declar = !unique && path.getData(dataKey); var declar = !unique && path.getData(dataKey);