Skip to content

Commit

Permalink
Fix syntax for old node version
Browse files Browse the repository at this point in the history
  • Loading branch information
keik committed Jun 19, 2017
1 parent 655c805 commit 7f46661
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test('multi transform with CoffeeScript and doubleLineTransform', function(t) {
t.equal(doubleLineTransformed.code, fs.readFileSync(resolve(__dirname, './fixtures/coffee-script/actual.js'), 'utf-8'))

const con = new SourceMapConsumer(mergedMap)
for (let i = 0; i < 2; i++) {
for (var i = 0; i < 2; i++) {
const offset = i * 17
t.deepEqual(
con.originalPositionFor({ line: 2 + offset, column: 8 }),
Expand Down Expand Up @@ -124,7 +124,7 @@ test('multi transform with CoffeeScript and doubleLineTransform', function(t) {
t.end()
})

test('multi transform with es2015-arrow and es2015-spread on babel', (t) => {
test('multi transform with es2015-arrow and es2015-spread on babel', function(t) {

// source.js -> resultOfArrow.js
const resultOfArrow = babel.transform(fs.readFileSync(resolve(__dirname, './fixtures/es2015/expected.js')), {
Expand Down Expand Up @@ -177,11 +177,11 @@ test('multi transform with es2015-arrow and es2015-spread on babel', (t) => {

// mappings by merge-soource-source-map, filtered by having `name` property
const mergedMappings = []
mergedMapConsumer.eachMapping(m => m.name && mergedMappings.push(m))
mergedMapConsumer.eachMapping(function(m) { m.name && mergedMappings.push(m) })

// mappings by babel, filtered by having `name` property
const sameTimeMappings = []
sameTimeMapConsumer.eachMapping(m => m.name && sameTimeMappings.push(m))
sameTimeMapConsumer.eachMapping(function(m) { m.name && sameTimeMappings.push(m) })

t.deepEqual(mergedMappings, sameTimeMappings)
t.end()
Expand All @@ -201,7 +201,7 @@ test('handle original position of code that does not have an origin', function(t
// verify
const mergedMap = merge(transformed1.map.toJSON(), transformed2.map.toJSON())
const con = new SourceMapConsumer(mergedMap)
let origPos
var origPos

// pos for variable `a`
origPos = con.originalPositionFor({line: 1, column: 0})
Expand All @@ -227,7 +227,7 @@ test('handle original position of code that does not have an origin (with compac

const mergedMap = merge(transformed1.map.toJSON(), transformed2.map.toJSON())
const con = new SourceMapConsumer(mergedMap)
let origPos
var origPos

// pos for variable `a`
origPos = con.originalPositionFor({line: 1, column: 0})
Expand Down

0 comments on commit 7f46661

Please sign in to comment.