* Skip parens and ! for getting this-context of call * Add test and improve code a bit * Use skipOuterExpressions instead
13 lines
192 B
TypeScript
13 lines
192 B
TypeScript
function f(this: { n: number }) {
|
|
}
|
|
|
|
const o: { n: number, test?: (this: { n: number }) => void } = { n: 1 }
|
|
o.test = f
|
|
|
|
o.test();
|
|
o!.test();
|
|
o.test!();
|
|
o.test!!!();
|
|
(o.test!)();
|
|
(o.test)();
|
|
|