mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
10 lines
331 B
TypeScript
10 lines
331 B
TypeScript
// `new.target` inside a class-field function expression builds a
|
|
// self-referential type through the containing class — the mapType depth
|
|
// guard fences it instead of overflowing the remote-AST walk (invariant
|
|
// signature 04).
|
|
class A {
|
|
d = function () { return new.target; };
|
|
}
|
|
const a = new A();
|
|
console.log(typeof a.d);
|