forked from lightscript/babel-plugin-lightscript
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
37 changed files
with
88 additions
and
202 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
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
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,9 +1,7 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(10), i = 0, _len = _arr2.length; i < _len; i++) { | ||
_arr.push(x = f(i)); | ||
} | ||
|
||
return _arr; | ||
})(); |
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
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,14 +1,11 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(10), i = 0, _len = _arr2.length; i < _len; i++) { | ||
function f() { | ||
return function g() { | ||
return i; | ||
}; | ||
} | ||
_arr.push(f); | ||
} | ||
|
||
return _arr; | ||
}return _arr; | ||
})(); |
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,12 +1,9 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(10), i = 0, _len = _arr2.length; i < _len; i++) { | ||
function f() { | ||
return i; | ||
} | ||
_arr.push(f); | ||
} | ||
|
||
return _arr; | ||
}return _arr; | ||
})(); |
5 changes: 1 addition & 4 deletions
5
test/fixtures/comprehensions/declared-inner-function/expected.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,13 +1,10 @@ | ||
const closures = (() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(3), i = 0, _len = _arr2.length; i < _len; i++) { | ||
const x = g(i); | ||
function g(x) { | ||
return x + 1; | ||
} | ||
_arr.push(g); | ||
} | ||
|
||
return _arr; | ||
}return _arr; | ||
})(); |
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,10 +1,6 @@ | ||
(() => { | ||
const _obj = {}; | ||
|
||
for (let _i = 0, _len = arr.length; _i < _len; _i++) { | ||
const x = arr[_i]; | ||
_obj[x] = f(x); | ||
} | ||
|
||
return _obj; | ||
const x = arr[_i];_obj[x] = f(x); | ||
}return _obj; | ||
})(); |
5 changes: 1 addition & 4 deletions
5
test/fixtures/comprehensions/object-declared-inner-function/expected.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,13 +1,10 @@ | ||
(() => { | ||
const _obj = {}; | ||
|
||
for (let _arr = Array(3), i = 0, _len = _arr.length; i < _len; i++) { | ||
const x = g(i); | ||
|
||
_obj[i] = function g(x) { | ||
return x + 1; | ||
}; | ||
} | ||
|
||
return _obj; | ||
}return _obj; | ||
})(); |
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,10 +1,6 @@ | ||
(() => { | ||
const _obj = {}; | ||
|
||
for (let _i = 0, _len = arr.length; _i < _len; _i++) { | ||
const x = arr[_i]; | ||
_obj[x] = f(x); | ||
} | ||
|
||
return _obj; | ||
const x = arr[_i];_obj[x] = f(x); | ||
}return _obj; | ||
})(); |
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,11 +1,8 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(10), i = 0, _len = _arr2.length; i < _len; i++) { | ||
const x = f(i); | ||
|
||
_arr.push(x); | ||
} | ||
|
||
return _arr; | ||
})(); | ||
}return _arr; | ||
})(); |
2 changes: 0 additions & 2 deletions
2
test/fixtures/enhanced-comprehensions/assignment-expr/expected.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,9 +1,7 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _arr2 = Array(10), i = 0, _len = _arr2.length; i < _len; i++) { | ||
_arr.push(x = f(i)); | ||
} | ||
|
||
return _arr; | ||
})(); |
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
test/fixtures/enhanced-comprehensions/basic-object/expected.js
This file was deleted.
Oops, something went wrong.
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,11 +1,7 @@ | ||
(() => { | ||
const _arr = []; | ||
|
||
for (let _i = 0, _len = y.length; _i < _len; _i++) { | ||
const x = y[_i]; | ||
|
||
_arr.push(x); | ||
} | ||
|
||
return _arr; | ||
}return _arr; | ||
})(); |
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
Oops, something went wrong.