have parser trap const declaration without value (#2756)

fixes #2751
This commit is contained in:
kzc
2018-01-09 23:31:46 -05:00
committed by Alex Lam S.L
parent 1f3f8f25eb
commit 137cb73d1f
5 changed files with 8 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ do_not_remove_anon_blocks_if_they_have_decls: {
var x;
}
{
const y;
const y = 1;
class Zee {};
}
}
@@ -59,7 +59,7 @@ do_not_remove_anon_blocks_if_they_have_decls: {
}
var x;
{
const y;
const y = 1;
class Zee {}
}
}
@@ -77,12 +77,12 @@ remove_unused_in_global_block: {
input: {
{
let x;
const y;
const y = 1;
class Zee {};
var w;
}
let ex;
const why;
const why = 2;
class Zed {};
var wut;
console.log(x, y, Zee);
@@ -90,7 +90,7 @@ remove_unused_in_global_block: {
expect: {
var w;
let ex;
const why;
const why = 2;
class Zed {};
var wut;
console.log(x, y, Zee);