| 1 |
var value1, value2 = {}; |
| 2 |
|
| 3 |
function makeStatic(el) { |
| 4 |
el.placement = "static"; |
| 5 |
return el; |
| 6 |
} |
| 7 |
|
| 8 |
function defineBar(el) { |
| 9 |
el.extras = [{ |
| 10 |
key: "bar", |
| 11 |
kind: "method", |
| 12 |
placement: "prototype", |
| 13 |
descriptor: { |
| 14 |
value: value2, |
| 15 |
}, |
| 16 |
}]; |
| 17 |
return el; |
| 18 |
} |
| 19 |
|
| 20 |
function storeValue(el) { |
| 21 |
value1 = el.descriptor.value; |
| 22 |
return el; |
| 23 |
} |
| 24 |
|
| 25 |
class Foo { |
| 26 |
@defineBar |
| 27 |
@makeStatic |
| 28 |
@storeValue |
| 29 |
bar() {} |
| 30 |
} |
| 31 |
|
| 32 |
expect(Foo.bar).toBe(value1); |
| 33 |
expect(Foo.prototype.bar).toBe(value2); |