22 lines
346 B
TypeScript
22 lines
346 B
TypeScript
//// [newTargetNarrowing.ts]
|
|
function foo(x: true) { }
|
|
|
|
function f() {
|
|
if (new.target.marked === true) {
|
|
foo(new.target.marked);
|
|
}
|
|
}
|
|
|
|
f.marked = true;
|
|
|
|
|
|
//// [newTargetNarrowing.js]
|
|
"use strict";
|
|
function foo(x) { }
|
|
function f() {
|
|
if (new.target.marked === true) {
|
|
foo(new.target.marked);
|
|
}
|
|
}
|
|
f.marked = true;
|