Set correct methods name
This commit is contained in:
8
packages/babel-plugin-proposal-decorators/test/fixtures/misc/method-name/exec.js
vendored
Normal file
8
packages/babel-plugin-proposal-decorators/test/fixtures/misc/method-name/exec.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
function decorator() {}
|
||||
|
||||
@decorator
|
||||
class Foo {
|
||||
method() {}
|
||||
}
|
||||
|
||||
expect(Foo.prototype.method.name).toBe("method");
|
||||
12
packages/babel-plugin-proposal-decorators/test/fixtures/misc/options.json
vendored
Normal file
12
packages/babel-plugin-proposal-decorators/test/fixtures/misc/options.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"plugins": [
|
||||
["proposal-decorators", { "decoratorsBeforeExport": false }],
|
||||
"proposal-class-properties",
|
||||
[
|
||||
"external-helpers",
|
||||
{
|
||||
"helperVersion": "7.1.5"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
16
packages/babel-plugin-proposal-decorators/test/fixtures/misc/to-primitive/exec.js
vendored
Normal file
16
packages/babel-plugin-proposal-decorators/test/fixtures/misc/to-primitive/exec.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
let calls = 0;
|
||||
const baz = {
|
||||
[Symbol.toPrimitive]() {
|
||||
calls++;
|
||||
return "baz";
|
||||
}
|
||||
}
|
||||
|
||||
function dec() {}
|
||||
|
||||
@dec
|
||||
class A {
|
||||
[baz]() {}
|
||||
}
|
||||
|
||||
expect(calls).toBe(1);
|
||||
Reference in New Issue
Block a user