mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Type check the expression of the 'with' statement
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (8 errors) ====
|
||||
==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (10 errors) ====
|
||||
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~~~~
|
||||
!!! Cannot find name 'window'.
|
||||
var p = () => this;
|
||||
}
|
||||
|
||||
@@ -53,6 +55,8 @@
|
||||
with (window) {
|
||||
~~~~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~~~~
|
||||
!!! Cannot find name 'window'.
|
||||
var p = () => this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts (1 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode14.ts (2 errors) ====
|
||||
"use strict";
|
||||
with (a) {
|
||||
~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~
|
||||
!!! Cannot find name 'a'.
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/Statements/parserWithStatement1.d.ts (3 errors) ====
|
||||
with (foo) {
|
||||
~~~~
|
||||
!!! Statements are not allowed in ambient contexts.
|
||||
~~~
|
||||
!!! All symbols within a 'with' block will be resolved to 'any'.
|
||||
~~~
|
||||
!!! Cannot find name 'foo'.
|
||||
}
|
||||
Reference in New Issue
Block a user