Do not attach comments to EmptyStatement (#599)

Since we don't print EmptyStatement, we don't want to attach comments to them. I've tried actually printing the EmptyStatement but it messes up a ton of other things.
master
Christopher Chedeau 2017-02-04 18:32:51 -08:00 committed by James Long
parent 77bf64c6b1
commit c07329b4ef
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ function getSortedChildNodes(node, text, resultArray) {
util.fixFaultyLocations(node, text);
if (resultArray) {
if (n.Node.check(node)) {
if (n.Node.check(node) && node.type !== "EmptyStatement") {
// This reverse insertion sort almost always takes constant
// time because we almost always (maybe always?) append the
// nodes in order anyway.

View File

@ -416,13 +416,13 @@ function var_var() {
function function_toplevel() {
function a() {}
function a() {}
function a() {} // OK
}
function function_block() {
{
function a() {}
function a() {}
function a() {} // error: name already bound
}
}