Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added tests for class props with same name as class method
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
test/babel/fixtures/class-properties/same-name-as-class-method/.babelrc
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 @@ | ||
{ | ||
"plugins": ["syntax-class-properties", "../../../../../src/babel"] | ||
} |
9 changes: 9 additions & 0 deletions
9
test/babel/fixtures/class-properties/same-name-as-class-method/actual.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 Foo { | ||
bar = (a, b) => { | ||
return a(b); | ||
}; | ||
|
||
bar() { | ||
return 2 | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
test/babel/fixtures/class-properties/same-name-as-class-method/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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var _this = this; | ||
|
||
class Foo { | ||
bar = (...params) => _this.__bar__REACT_HOT_LOADER__(...params); | ||
|
||
__bar__REACT_HOT_LOADER__(a, b) { | ||
return a(b); | ||
} | ||
|
||
bar() { | ||
return 2; | ||
} | ||
} | ||
; | ||
|
||
var _temp = function () { | ||
if (typeof __REACT_HOT_LOADER__ === 'undefined') { | ||
return; | ||
} | ||
|
||
__REACT_HOT_LOADER__.register(Foo, "Foo", __FILENAME__); | ||
}(); | ||
|
||
; |