mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #736 from Microsoft/unary_operators_strict_mode
use operator token when checking unary expressions in strict mode
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
tests/cases/compiler/deleteOperatorInStrictMode.ts(3,8): error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
|
||||
|
||||
==== tests/cases/compiler/deleteOperatorInStrictMode.ts (1 errors) ====
|
||||
"use strict"
|
||||
var a;
|
||||
delete a;
|
||||
~
|
||||
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode15.ts(2,8): error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode15.ts(2,8): error TS2304: Cannot find name 'a'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode15.ts (1 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode15.ts (2 errors) ====
|
||||
"use strict";
|
||||
delete a;
|
||||
~
|
||||
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [parserStrictMode15.ts]
|
||||
"use strict";
|
||||
delete a;
|
||||
|
||||
//// [parserStrictMode15.js]
|
||||
"use strict";
|
||||
delete a;
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts (1 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts (2 errors) ====
|
||||
"use strict";
|
||||
++eval;
|
||||
~~~~
|
||||
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||
~~~~
|
||||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [parserStrictMode7.ts]
|
||||
"use strict";
|
||||
++eval;
|
||||
|
||||
//// [parserStrictMode7.js]
|
||||
"use strict";
|
||||
++eval;
|
||||
@@ -0,0 +1,62 @@
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(3,3): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(4,3): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(5,3): error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(6,3): error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(7,1): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(8,1): error TS1100: Invalid use of 'eval' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(9,1): error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(10,1): error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(3,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(4,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(5,3): error TS2304: Cannot find name 'arguments'.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(6,3): error TS2304: Cannot find name 'arguments'.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(7,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(8,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(9,1): error TS2304: Cannot find name 'arguments'.
|
||||
tests/cases/compiler/unaryOperatorsInStrictMode.ts(10,1): error TS2304: Cannot find name 'arguments'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/unaryOperatorsInStrictMode.ts (16 errors) ====
|
||||
"use strict"
|
||||
|
||||
++eval;
|
||||
~~~~
|
||||
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||
~~~~
|
||||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
--eval;
|
||||
~~~~
|
||||
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||
~~~~
|
||||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
++arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'arguments'.
|
||||
--arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'arguments'.
|
||||
eval++;
|
||||
~~~~
|
||||
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||
~~~~
|
||||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
eval--;
|
||||
~~~~
|
||||
!!! error TS1100: Invalid use of 'eval' in strict mode.
|
||||
~~~~
|
||||
!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
arguments++;
|
||||
~~~~~~~~~
|
||||
!!! error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'arguments'.
|
||||
arguments--;
|
||||
~~~~~~~~~
|
||||
!!! error TS1100: Invalid use of 'arguments' in strict mode.
|
||||
~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'arguments'.
|
||||
|
||||
3
tests/cases/compiler/deleteOperatorInStrictMode.ts
Normal file
3
tests/cases/compiler/deleteOperatorInStrictMode.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict"
|
||||
var a;
|
||||
delete a;
|
||||
10
tests/cases/compiler/unaryOperatorsInStrictMode.ts
Normal file
10
tests/cases/compiler/unaryOperatorsInStrictMode.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict"
|
||||
|
||||
++eval;
|
||||
--eval;
|
||||
++arguments;
|
||||
--arguments;
|
||||
eval++;
|
||||
eval--;
|
||||
arguments++;
|
||||
arguments--;
|
||||
Reference in New Issue
Block a user