You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Plain JS binder errors
Issue select errors from the binder in JS files that do not have checkJS
explicitly turned on or off. These errors mirror runtime checks done by
Javascript.
* Rest of plain JS binder errors
* address PR comments
* Only issue binder errors in plain JS.
Checker errors require requesting diagnostics, which stll needs to be
peformance tested.
This commit removes one cross-file duplicate declaration error in the tests.
* fix const lint
/a.js(18,9): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
2
+
3
+
4
+
==== /a.js (1 errors) ====
5
+
class A {
6
+
/**
7
+
* Constructor
8
+
*
9
+
* @param {object} [foo={}]
10
+
*/
11
+
constructor(foo = {}) {
12
+
const key = "bar";
13
+
14
+
/**
15
+
* @type object
16
+
*/
17
+
this.foo = foo;
18
+
19
+
/**
20
+
* @type object
21
+
*/
22
+
const arguments = this.arguments;
23
+
~~~~~~~~~
24
+
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
/a.js(16,9): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
2
+
3
+
4
+
==== /a.js (1 errors) ====
5
+
class A {
6
+
/**
7
+
* @param {object} [foo={}]
8
+
*/
9
+
m(foo = {}) {
10
+
const key = "bar";
11
+
12
+
/**
13
+
* @type object
14
+
*/
15
+
this.foo = foo;
16
+
17
+
/**
18
+
* @type object
19
+
*/
20
+
const arguments = this.arguments;
21
+
~~~~~~~~~
22
+
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
tests/cases/conformance/salsa/plainJSBinderErrors.js(1,1): error TS2528: A module cannot have multiple default exports.
2
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(2,1): error TS2528: A module cannot have multiple default exports.
3
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
4
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
5
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
6
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
7
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(12,5): error TS18012: '#constructor' is a reserved word.
8
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(15,20): error TS1102: 'delete' cannot be called on an identifier in strict mode.
9
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(18,16): error TS1102: 'delete' cannot be called on an identifier in strict mode.
10
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(19,16): error TS1102: 'delete' cannot be called on an identifier in strict mode.
11
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(22,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
12
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(23,15): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
13
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(26,27): error TS1121: Octal literals are not allowed in strict mode.
14
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(27,9): error TS1101: 'with' statements are not allowed in strict mode.
15
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(33,13): error TS1344: 'A label is not allowed here.
16
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(39,7): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
17
+
tests/cases/conformance/salsa/plainJSBinderErrors.js(40,7): error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode.
!!! error TS2528: A module cannot have multiple default exports.
24
+
!!! related TS2753 tests/cases/conformance/salsa/plainJSBinderErrors.js:2:1: Another export default is here.
25
+
export default 13
26
+
~~~~~~~~~~~~~~~~~
27
+
!!! error TS2528: A module cannot have multiple default exports.
28
+
!!! related TS2752 tests/cases/conformance/salsa/plainJSBinderErrors.js:1:1: The first export default is here.
29
+
const await = 1
30
+
~~~~~
31
+
!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module.
32
+
const yield = 2
33
+
~~~~~
34
+
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
35
+
async function f() {
36
+
const await = 3
37
+
~~~~~
38
+
!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here.
39
+
}
40
+
function* g() {
41
+
const yield = 4
42
+
~~~~~
43
+
!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode.
44
+
}
45
+
class C {
46
+
#constructor = 5
47
+
~~~~~~~~~~~~
48
+
!!! error TS18012: '#constructor' is a reserved word.
49
+
deleted() {
50
+
function container(f) {
51
+
delete f
52
+
~
53
+
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
54
+
}
55
+
var g = 6
56
+
delete g
57
+
~
58
+
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
59
+
delete container
60
+
~~~~~~~~~
61
+
!!! error TS1102: 'delete' cannot be called on an identifier in strict mode.
62
+
}
63
+
evalArguments() {
64
+
const eval = 7
65
+
~~~~
66
+
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'eval'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
67
+
const arguments = 8
68
+
~~~~~~~~~
69
+
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
70
+
}
71
+
withOctal() {
72
+
const redundant = 010
73
+
~~~
74
+
!!! error TS1121: Octal literals are not allowed in strict mode.
75
+
with (redundant) {
76
+
~~~~
77
+
!!! error TS1101: 'with' statements are not allowed in strict mode.
78
+
return toFixed()
79
+
}
80
+
}
81
+
label() {
82
+
for(;;) {
83
+
label: var x = 1
84
+
~~~~~
85
+
!!! error TS1344: 'A label is not allowed here.
86
+
break label
87
+
}
88
+
return x
89
+
}
90
+
}
91
+
const eval = 9
92
+
~~~~
93
+
!!! error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
94
+
const arguments = 10
95
+
~~~~~~~~~
96
+
!!! error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode.
0 commit comments