@@ -1862,7 +1862,7 @@ function parse($TEXT, options) {
|
|||||||
name : as_symbol(sym_type),
|
name : as_symbol(sym_type),
|
||||||
value : is("operator", "=")
|
value : is("operator", "=")
|
||||||
? (next(), expression(false, no_in))
|
? (next(), expression(false, no_in))
|
||||||
: !no_in && kind === "const" && S.input.has_directive("use strict")
|
: !no_in && kind === "const"
|
||||||
? croak("Missing initializer in const declaration") : null,
|
? croak("Missing initializer in const declaration") : null,
|
||||||
end : prev()
|
end : prev()
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ do_not_remove_anon_blocks_if_they_have_decls: {
|
|||||||
var x;
|
var x;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const y;
|
const y = 1;
|
||||||
class Zee {};
|
class Zee {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ do_not_remove_anon_blocks_if_they_have_decls: {
|
|||||||
}
|
}
|
||||||
var x;
|
var x;
|
||||||
{
|
{
|
||||||
const y;
|
const y = 1;
|
||||||
class Zee {}
|
class Zee {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,12 +77,12 @@ remove_unused_in_global_block: {
|
|||||||
input: {
|
input: {
|
||||||
{
|
{
|
||||||
let x;
|
let x;
|
||||||
const y;
|
const y = 1;
|
||||||
class Zee {};
|
class Zee {};
|
||||||
var w;
|
var w;
|
||||||
}
|
}
|
||||||
let ex;
|
let ex;
|
||||||
const why;
|
const why = 2;
|
||||||
class Zed {};
|
class Zed {};
|
||||||
var wut;
|
var wut;
|
||||||
console.log(x, y, Zee);
|
console.log(x, y, Zee);
|
||||||
@@ -90,7 +90,7 @@ remove_unused_in_global_block: {
|
|||||||
expect: {
|
expect: {
|
||||||
var w;
|
var w;
|
||||||
let ex;
|
let ex;
|
||||||
const why;
|
const why = 2;
|
||||||
class Zed {};
|
class Zed {};
|
||||||
var wut;
|
var wut;
|
||||||
console.log(x, y, Zee);
|
console.log(x, y, Zee);
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ unused_block_decls: {
|
|||||||
input: {
|
input: {
|
||||||
function foo() {
|
function foo() {
|
||||||
{
|
{
|
||||||
const x;
|
const x = 1;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let y;
|
let y;
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
function f() {
|
function f() {
|
||||||
const a;
|
const a;
|
||||||
}
|
}
|
||||||
|
|
||||||
function g() {
|
|
||||||
"use strict";
|
|
||||||
const a;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ describe("bin/uglifyjs", function () {
|
|||||||
assert.ok(err);
|
assert.ok(err);
|
||||||
assert.strictEqual(stdout, "");
|
assert.strictEqual(stdout, "");
|
||||||
assert.strictEqual(stderr.split(/\n/).slice(0, 4).join("\n"), [
|
assert.strictEqual(stderr.split(/\n/).slice(0, 4).join("\n"), [
|
||||||
"Parse error at test/input/invalid/const.js:7,11",
|
"Parse error at test/input/invalid/const.js:2,11",
|
||||||
" const a;",
|
" const a;",
|
||||||
" ^",
|
" ^",
|
||||||
"ERROR: Missing initializer in const declaration"
|
"ERROR: Missing initializer in const declaration"
|
||||||
|
|||||||
Reference in New Issue
Block a user