mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
421 B
TypeScript
24 lines
421 B
TypeScript
//// [tests/cases/conformance/es6/newTarget/newTargetNarrowing.ts] ////
|
|
|
|
//// [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;
|