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
fix: improve confusing TS1107 error for mislabeled jump targets
Improve diagnostics by not eagerly reporting 'Jump target cannot
cross function boundary' until encountering the actual target label.
This correctly emits the TS1104 or TS1116 errors if the target lacks
an enclosing iteration or switch statement.
Fixes: #30408
Copy file name to clipboardExpand all lines: tests/baselines/reference/plainJSBinderErrors.errors.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ plainJSBinderErrors.js(22,15): error TS1210: Code contained in a class is evalua
12
12
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
13
plainJSBinderErrors.js(27,9): error TS1101: 'with' statements are not allowed in strict mode.
14
14
plainJSBinderErrors.js(33,13): error TS1344: 'A label is not allowed here.
15
-
plainJSBinderErrors.js(34,13): error TS1107: Jump target cannot cross function boundary.
15
+
plainJSBinderErrors.js(34,13): error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
16
16
plainJSBinderErrors.js(39,7): error TS1215: Invalid use of 'eval'. Modules are automatically in strict mode.
17
17
plainJSBinderErrors.js(40,7): error TS1215: Invalid use of 'arguments'. Modules are automatically in strict mode.
18
18
@@ -83,7 +83,7 @@ plainJSBinderErrors.js(40,7): error TS1215: Invalid use of 'arguments'. Modules
83
83
!!! error TS1344: 'A label is not allowed here.
84
84
break label
85
85
~~~~~~~~~~~
86
-
!!! error TS1107: Jump target cannot cross function boundary.
86
+
!!! error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
0 commit comments