mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
PR feedback
- Cacheing the script target - Added missing return - Reworded error messages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictClass.ts(4,22): error TS1251: In ES5 or lower, function declarations are not allowed in block scope. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictClass.ts(4,22): error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictClass.ts(7,9): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/compiler/blockScopedFunctionDeclarationInStrictClass.ts(7,9): error
|
||||
if (true) {
|
||||
function foo() { }
|
||||
~~~
|
||||
!!! error TS1251: In ES5 or lower, function declarations are not allowed in block scope. Class definitions are automatically in strict mode.
|
||||
!!! error TS1251: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode.
|
||||
foo(); // ok
|
||||
}
|
||||
foo(); // not ok
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictModule.ts(2,14): error TS1252: In ES5 or lower, function declarations are not allowed in block scope. Modules are automatically in strict mode.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictModule.ts(2,14): error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationInStrictModule.ts(6,10): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ tests/cases/compiler/blockScopedFunctionDeclarationInStrictModule.ts(6,10): erro
|
||||
if (true) {
|
||||
function foo() { }
|
||||
~~~
|
||||
!!! error TS1252: In ES5 or lower, function declarations are not allowed in block scope. Modules are automatically in strict mode.
|
||||
!!! error TS1252: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode.
|
||||
foo(); // ok
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts(3,14): error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts(3,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts(6,1): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts(6,1): error TS23
|
||||
if (true) {
|
||||
function foo() { } // Error to declare function in block scope
|
||||
~~~
|
||||
!!! error TS1250: In ES5 or lower, function declarations are not allowed in block scope in strict mode.
|
||||
!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'.
|
||||
foo(); // This call should be ok
|
||||
}
|
||||
foo(); // Error to find name foo
|
||||
|
||||
Reference in New Issue
Block a user