| 1 |
expect(() => { |
| 2 |
var i = 0; |
| 3 |
var j = 0; |
| 4 |
|
| 5 |
function getKeyI() { |
| 6 |
return (i++).toString(); |
| 7 |
} |
| 8 |
function getKeyJ() { |
| 9 |
return (j++).toString(); |
| 10 |
} |
| 11 |
|
| 12 |
let elements = []; |
| 13 |
|
| 14 |
function dec(fn, context) { |
| 15 |
elements.push({ fn, context }); |
| 16 |
} |
| 17 |
|
| 18 |
class Foo { |
| 19 |
@dec |
| 20 |
[getKeyI()]() { |
| 21 |
return 1; |
| 22 |
} |
| 23 |
|
| 24 |
@dec |
| 25 |
[getKeyJ()]() { |
| 26 |
return 2; |
| 27 |
} |
| 28 |
} |
| 29 |
}).toThrow("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: 0") |