Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
112 additions
and
2 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
5 changes: 5 additions & 0 deletions
5
...el-plugin-transform-classes/test/fixtures/assumption-setClassMethods/literal-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,5 @@ | ||
class Foo { | ||
"bar"() { | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...l-plugin-transform-classes/test/fixtures/assumption-setClassMethods/literal-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,13 @@ | ||
var Foo = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function Foo() { | ||
babelHelpers.classCallCheck(this, Foo); | ||
} | ||
|
||
var _proto = Foo.prototype; | ||
|
||
_proto["bar"] = function bar() {}; | ||
|
||
return Foo; | ||
}(); |
6 changes: 6 additions & 0 deletions
6
...m-classes/test/fixtures/assumption-setClassMethods/method-return-type-annotation/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,6 @@ | ||
// @flow | ||
class C { | ||
m(x: number): string { | ||
return 'a'; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...asses/test/fixtures/assumption-setClassMethods/method-return-type-annotation/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,10 @@ | ||
{ | ||
"plugins": [ | ||
"external-helpers", | ||
"transform-function-name", | ||
["transform-classes", { "loose": true }], | ||
"transform-spread", | ||
"transform-block-scoping", | ||
"syntax-flow" | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
...-classes/test/fixtures/assumption-setClassMethods/method-return-type-annotation/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 @@ | ||
// @flow | ||
var C = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function C() {} | ||
|
||
var _proto = C.prototype; | ||
|
||
_proto.m = function m(x: number): string { | ||
return 'a'; | ||
}; | ||
|
||
return C; | ||
}(); |
5 changes: 5 additions & 0 deletions
5
...ransform-classes/test/fixtures/assumption-setClassMethods/method-reuse-prototype/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,5 @@ | ||
class Test { | ||
a() {} | ||
static b() {} | ||
c() {} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ansform-classes/test/fixtures/assumption-setClassMethods/method-reuse-prototype/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 @@ | ||
var Test = /*#__PURE__*/function () { | ||
"use strict"; | ||
|
||
function Test() { | ||
babelHelpers.classCallCheck(this, Test); | ||
} | ||
|
||
var _proto = Test.prototype; | ||
|
||
_proto.a = function a() {}; | ||
|
||
Test.b = function b() {}; | ||
|
||
_proto.c = function c() {}; | ||
|
||
return Test; | ||
}(); |
12 changes: 12 additions & 0 deletions
12
...ages/babel-plugin-transform-classes/test/fixtures/assumption-setClassMethods/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,12 @@ | ||
{ | ||
"plugins": [ | ||
["external-helpers", { "helperVersion": "7.100.0" }], | ||
"transform-function-name", | ||
"transform-classes", | ||
["transform-spread", { "loose": true }], | ||
"transform-block-scoping" | ||
], | ||
"assumptions": { | ||
"setClassMethods": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...asses/test/fixtures/assumption-setClassMethods/program-with-use-strict-directive/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,7 @@ | ||
"use strict"; | ||
|
||
class Foo { | ||
method() { | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...sses/test/fixtures/assumption-setClassMethods/program-with-use-strict-directive/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,13 @@ | ||
"use strict"; | ||
|
||
var Foo = /*#__PURE__*/function () { | ||
function Foo() { | ||
babelHelpers.classCallCheck(this, Foo); | ||
} | ||
|
||
var _proto = Foo.prototype; | ||
|
||
_proto.method = function method() {}; | ||
|
||
return Foo; | ||
}(); |