-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
046b18a
commit 7c673d2
Showing
21 changed files
with
81 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...gin-transform-for-of/test/fixtures/assumption-iterableIsArray/for-of-import-amd/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
define(["foo"], function (_foo) { | ||
"use strict"; | ||
|
||
for (let _i = 0; _i < _foo.array.length; _i++) { | ||
const elm = _foo.array[_i]; | ||
for (let _i = 0, _arr = _foo.array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} | ||
}); |
4 changes: 2 additions & 2 deletions
4
...ransform-for-of/test/fixtures/assumption-iterableIsArray/for-of-import-commonjs/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"use strict"; | ||
|
||
var _foo = require("foo"); | ||
for (let _i = 0; _i < _foo.array.length; _i++) { | ||
const elm = _foo.array[_i]; | ||
for (let _i = 0, _arr = _foo.array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 2 additions & 2 deletions
4
...transform-for-of/test/fixtures/assumption-iterableIsArray/for-of-import-es2015/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { array } from "foo"; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
const elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
3 changes: 3 additions & 0 deletions
3
...transform-for-of/test/fixtures/assumption-iterableIsArray/for-of-modify-iterable/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
for (let o of arr) { | ||
arr = null; | ||
} |
4 changes: 4 additions & 0 deletions
4
...ransform-for-of/test/fixtures/assumption-iterableIsArray/for-of-modify-iterable/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
for (let _i = 0, _arr = arr; _i < _arr.length; _i++) { | ||
let o = _arr[_i]; | ||
arr = null; | ||
} |
4 changes: 1 addition & 3 deletions
4
...sform-for-of/test/fixtures/assumption-iterableIsArray/for-of-redeclare-iterable/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
for (let _i = 0, _arr = arr; _i < _arr.length; _i++) { | ||
let o = _arr[_i]; | ||
{ | ||
const arr = o; | ||
} | ||
const arr = o; | ||
} |
4 changes: 2 additions & 2 deletions
4
...sform-for-of/test/fixtures/assumption-iterableIsArray/for-of-static-declaration/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const array = []; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
const elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 2 additions & 2 deletions
4
...-plugin-transform-for-of/test/fixtures/assumption-iterableIsArray/for-of-static/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const array = []; | ||
let elm; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 2 additions & 2 deletions
4
...s/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-amd/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
define(["foo"], function (_foo) { | ||
"use strict"; | ||
|
||
for (let _i = 0; _i < _foo.array.length; _i++) { | ||
const elm = _foo.array[_i]; | ||
for (let _i = 0, _arr = _foo.array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} | ||
}); |
4 changes: 2 additions & 2 deletions
4
...el-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-commonjs/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
"use strict"; | ||
|
||
var _foo = require("foo"); | ||
for (let _i = 0; _i < _foo.array.length; _i++) { | ||
const elm = _foo.array[_i]; | ||
for (let _i = 0, _arr = _foo.array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 2 additions & 2 deletions
4
...bel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { array } from "foo"; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
const elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 1 addition & 3 deletions
4
...plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-redeclare-iterable/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
for (let _i = 0, _arr = arr; _i < _arr.length; _i++) { | ||
let o = _arr[_i]; | ||
{ | ||
const arr = o; | ||
} | ||
const arr = o; | ||
} |
4 changes: 2 additions & 2 deletions
4
...plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-static-declaration/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const array = []; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
const elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
const elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-static/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
const array = []; | ||
let elm; | ||
for (let _i = 0; _i < array.length; _i++) { | ||
elm = array[_i]; | ||
for (let _i = 0, _arr = array; _i < _arr.length; _i++) { | ||
elm = _arr[_i]; | ||
console.log(elm); | ||
} |
4 changes: 1 addition & 3 deletions
4
...ges/babel-plugin-transform-for-of/test/fixtures/regression/redeclare-array-8913/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
function f(...t) { | ||
for (var _i = 0, _t = t; _i < _t.length; _i++) { | ||
let o = _t[_i]; | ||
{ | ||
const t = o; | ||
} | ||
const t = o; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...s/babel-preset-env/test/fixtures/plugins-integration/for-of-array-block-scoping-2/exec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function x(e){ | ||
const r = []; | ||
for (const s of e) { | ||
e = null; | ||
r.push(s); | ||
} | ||
return r; | ||
} | ||
|
||
expect(x([1, 2, 3])).toEqual([1, 2, 3]); |
10 changes: 10 additions & 0 deletions
10
.../babel-preset-env/test/fixtures/plugins-integration/for-of-array-block-scoping-2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function x(e){ | ||
const r = []; | ||
for (const s of e) { | ||
e = null; | ||
r.push(s); | ||
} | ||
return r; | ||
} | ||
|
||
expect(x([1, 2, 3])).toEqual([1, 2, 3]); |
7 changes: 7 additions & 0 deletions
7
...el-preset-env/test/fixtures/plugins-integration/for-of-array-block-scoping-2/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"assumptions": { | ||
"iterableIsArray": true | ||
}, | ||
"targets": "node 4.0", | ||
"presets": ["env"] | ||
} |
10 changes: 10 additions & 0 deletions
10
...babel-preset-env/test/fixtures/plugins-integration/for-of-array-block-scoping-2/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function x(e) { | ||
var r = []; | ||
for (var _i2 = 0, _e2 = e; _i2 < _e2.length; _i2++) { | ||
var s = _e2[_i2]; | ||
e = null; | ||
r.push(s); | ||
} | ||
return r; | ||
} | ||
expect(x([1, 2, 3])).toEqual([1, 2, 3]); |
10 changes: 4 additions & 6 deletions
10
...s/babel-preset-env/test/fixtures/plugins-integration/for-of-array-block-scoping/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters