Skip to content

Commit 184e667

Browse files
Merge pull request #108 from conveyal/dev
v3.2.1
2 parents c1139e9 + aa651e0 commit 184e667

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/__tests__/babel.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* globals describe, expect, it */
2+
3+
describe('babel', () => {
4+
/** As of 2016-12-15 this test fails in babel loose mode. https://github.com/babel/babel/issues/4916 */
5+
it('should iterate correctly over a set after using the spread operator', () => {
6+
const originalArr = [1, 1, 2]
7+
const set = new Set(originalArr)
8+
const arr = [...set]
9+
expect(arr.length).toBe(2)
10+
})
11+
})

lib/babel-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = function (env) {
1313
presets: [
1414
[babelEnv, {
1515
targets: {browsers},
16-
loose: true
16+
loose: false // Loose mode breaks spread operator on `Set`s
1717
}],
1818
react,
1919
stage2

0 commit comments

Comments
 (0)