-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer/arrow-functions): _this = this should be inserted aft…
…er super call expression
- Loading branch information
Showing
13 changed files
with
138 additions
and
57 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
10 changes: 0 additions & 10 deletions
10
...s/babel-plugin-transform-class-properties/test/fixtures/private-loose/foobar/options.json
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...ides/babel-plugin-transform-class-properties/test/fixtures/private-loose/foobar/output.js
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...des/babel-plugin-transform-class-properties/test/fixtures/private-loose/foobar/reason.txt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...es/babel-plugin-transform-class-properties/test/fixtures/public-loose/foobar/options.json
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...rides/babel-plugin-transform-class-properties/test/fixtures/public-loose/foobar/output.js
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...ides/babel-plugin-transform-class-properties/test/fixtures/public-loose/foobar/reason.txt
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
17 changes: 17 additions & 0 deletions
17
...-plugin-transform-async-to-generator/test/fixtures/class/this-after-super-nested/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 @@ | ||
class Outer { | ||
constructor() { | ||
async () => { return [this, 2]; }; | ||
|
||
class Inner extends Outer{ | ||
constructor() { | ||
if (condition) { | ||
const _super = super() | ||
this.fn = async () => { return [this, 1]; }; | ||
} | ||
|
||
super() | ||
async () => { return [this, 2]; }; | ||
} | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...plugin-transform-async-to-generator/test/fixtures/class/this-after-super-nested/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,28 @@ | ||
class Outer { | ||
constructor() { | ||
var _this = this; | ||
babelHelpers.asyncToGenerator(function* () { | ||
return [_this, 2]; | ||
}); | ||
|
||
class Inner extends Outer { | ||
constructor() { | ||
var _this2; | ||
|
||
if (condition) { | ||
const _super = super(); | ||
_this2 = this; | ||
this.fn = babelHelpers.asyncToGenerator(function* () { | ||
return [_this2, 1]; | ||
}); | ||
} | ||
|
||
super(); | ||
_this2 = this; | ||
babelHelpers.asyncToGenerator(function* () { | ||
return [_this2, 2]; | ||
}); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...s/babel-plugin-transform-async-to-generator/test/fixtures/class/this-after-super/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 @@ | ||
class C extends S { | ||
constructor() { | ||
if (condition) { | ||
const _super = super() | ||
this.fn = async () => { return [this, 1]; }; | ||
} | ||
|
||
super() | ||
async () => { return [this, 2]; }; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../babel-plugin-transform-async-to-generator/test/fixtures/class/this-after-super/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,18 @@ | ||
class C extends S { | ||
constructor() { | ||
var _this; | ||
if (condition) { | ||
const _super = super(); | ||
_this = this; | ||
this.fn = babelHelpers.asyncToGenerator(function* () { | ||
return [_this, 1]; | ||
}); | ||
} | ||
|
||
super(); | ||
_this = this; | ||
babelHelpers.asyncToGenerator(function* () { | ||
return [_this, 2]; | ||
}); | ||
} | ||
} |