forked from babel/babel
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
1 parent
38397ce
commit d35563e
Showing
4 changed files
with
43 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
packages/babel-plugin-proposal-decorators/test/fixtures/misc/method-name/exec.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,8 @@ | ||
function decorator() {} | ||
|
||
@decorator | ||
class Foo { | ||
method() {} | ||
} | ||
|
||
expect(Foo.prototype.method.name).toBe("method"); |
12 changes: 12 additions & 0 deletions
12
packages/babel-plugin-proposal-decorators/test/fixtures/misc/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": [ | ||
["proposal-decorators", { "decoratorsBeforeExport": false }], | ||
"proposal-class-properties", | ||
[ | ||
"external-helpers", | ||
{ | ||
"helperVersion": "7.1.5" | ||
} | ||
] | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/babel-plugin-proposal-decorators/test/fixtures/misc/to-primitive/exec.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,16 @@ | ||
let calls = 0; | ||
const baz = { | ||
[Symbol.toPrimitive]() { | ||
calls++; | ||
return "baz"; | ||
} | ||
} | ||
|
||
function dec() {} | ||
|
||
@dec | ||
class A { | ||
[baz]() {} | ||
} | ||
|
||
expect(calls).toBe(1); |