-
-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer): fix arrow function transform
- Loading branch information
1 parent
1574334
commit d94ad96
Showing
16 changed files
with
199 additions
and
28 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
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 @@ | ||
commit: 3bcfee23 | ||
|
||
Passed: 49/58 | ||
Passed: 55/64 | ||
|
||
# All Passed: | ||
* babel-plugin-transform-nullish-coalescing-operator | ||
|
11 changes: 11 additions & 0 deletions
11
...babel-plugin-transform-arrow-functions/test/fixtures/arrow-in-class-property-key/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,11 @@ | ||
let f; | ||
|
||
class C { | ||
[f = () => this] = 1; | ||
} | ||
|
||
function outer() { | ||
class C { | ||
[f = () => this] = 1; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...abel-plugin-transform-arrow-functions/test/fixtures/arrow-in-class-property-key/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,14 @@ | ||
var _this = this; | ||
|
||
let f; | ||
|
||
class C { | ||
[f = function() { return _this; }] = 1; | ||
} | ||
|
||
function outer() { | ||
var _this2 = this; | ||
class C { | ||
[f = function() { return _this2; }] = 1; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...tests/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-extends/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,9 @@ | ||
function outer() { | ||
return () => { | ||
class C extends this {} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C extends this {} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ests/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-extends/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 outer() { | ||
var _this = this; | ||
return function() { | ||
class C extends _this {} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C extends this {} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ts/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-method-key/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,13 @@ | ||
function outer() { | ||
return () => { | ||
class C { | ||
[this]() {} | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
[this]() {} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...s/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-method-key/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,14 @@ | ||
function outer() { | ||
var _this = this; | ||
return function() { | ||
class C { | ||
[_this]() {} | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
[this]() {} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-property-key/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,13 @@ | ||
function outer() { | ||
return () => { | ||
class C { | ||
[this] = 1; | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
[this] = 1; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-property-key/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,14 @@ | ||
function outer() { | ||
var _this = this; | ||
return function() { | ||
class C { | ||
[_this] = 1; | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
[this] = 1; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ests/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-property/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,9 @@ | ||
class C { | ||
x = this; | ||
} | ||
|
||
f = () => { | ||
class C { | ||
x = this; | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
...sts/babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-property/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,9 @@ | ||
class C { | ||
x = this; | ||
} | ||
|
||
f = function() { | ||
class C { | ||
x = this; | ||
} | ||
}; |
17 changes: 17 additions & 0 deletions
17
.../babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-static-block/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,17 @@ | ||
function outer() { | ||
return () => { | ||
class C { | ||
static { | ||
t = this; | ||
} | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
static { | ||
t = this; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...babel-plugin-transform-arrow-functions/test/fixtures/this-in-class-static-block/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,17 @@ | ||
function outer() { | ||
return function() { | ||
class C { | ||
static { | ||
t = this; | ||
} | ||
} | ||
}; | ||
} | ||
|
||
function outer2() { | ||
class C { | ||
static { | ||
t = this; | ||
} | ||
} | ||
} |