mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
18 lines
558 B
TypeScript
18 lines
558 B
TypeScript
//// [tests/cases/compiler/blockScopedFunctionDeclarationStrictES6.ts] ////
|
|
|
|
//// [blockScopedFunctionDeclarationStrictES6.ts]
|
|
"use strict";
|
|
if (true) {
|
|
function foo() { } // Allowed to declare block scope function
|
|
foo(); // This call should be ok
|
|
}
|
|
foo(); // Cannot find name since foo is block scoped
|
|
|
|
//// [blockScopedFunctionDeclarationStrictES6.js]
|
|
"use strict";
|
|
if (true) {
|
|
function foo() { } // Allowed to declare block scope function
|
|
foo(); // This call should be ok
|
|
}
|
|
foo(); // Cannot find name since foo is block scoped
|