Fix tests on node 4

Turns out, if you don't put "use strict"; `const` behaves in a crazy way.
master
Christopher Chedeau 2017-02-23 09:47:06 -08:00
parent 1d02ca7849
commit c9d2c17bc7
1 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
"use strict";
var assert = require("assert");
var types = require("ast-types");
var n = types.namedTypes;
@ -456,11 +458,11 @@ function printComment(commentPath) {
}
function findExpressionIndexForComment(expressions, comment) {
var match;
let match;
const startPos = locStart(comment) - 1;
const endPos = locEnd(comment) + 1;
for (var i = 0; i < expressions.length; ++i) {
for (let i = 0; i < expressions.length; ++i) {
const range = getExpressionRange(expressions[i])
if (