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
exports[`Unsupported optional chains Language extensions: code 1`] =`
64
64
"local ____opt_0 = ({}).has
65
65
if ____opt_0 ~= nil then
66
-
local ____ = nil[3] ~= nil
67
66
end"
68
67
`;
69
68
70
-
exports[`Unsupported optional chains Language extensions: diagnostics 1`] =`"main.ts(2,17): error TSTL: Optional calls are not supported for builtin or language extension functions."`;
69
+
exports[`Unsupported optional chains Language extensions: diagnostics 1`] =`
70
+
"main.ts(2,17): error TSTL: Optional calls are not supported for builtin or language extension functions.
71
+
main.ts(2,17): error TSTL: This language extension must be called as a method."
Copy file name to clipboardExpand all lines: test/unit/language-extensions/__snapshots__/operators.spec.ts.snap
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
+
exports[`does not crash on invalid operator use global function: code 1`] =`""`;
4
+
5
+
exports[`does not crash on invalid operator use global function: diagnostics 1`] =`"main.ts(3,13): error TS2554: Expected 2 arguments, but got 1."`;
6
+
7
+
exports[`does not crash on invalid operator use method: code 1`] =`"left = {}"`;
8
+
9
+
exports[`does not crash on invalid operator use method: diagnostics 1`] =`"main.ts(5,18): error TS2554: Expected 1 arguments, but got 0."`;
10
+
11
+
exports[`does not crash on invalid operator use unary operator: code 1`] =`"op(_G)"`;
12
+
13
+
exports[`does not crash on invalid operator use unary operator: diagnostics 1`] =`"main.ts(2,31): error TS2304: Cannot find name 'LuaUnaryMinus'."`;
14
+
3
15
exports[`operator mapping - invalid use (const foo = (op as any)(1, 2);): code 1`] =`"foo = op(_G, 1, 2)"`;
4
16
5
17
exports[`operator mapping - invalid use (const foo = (op as any)(1, 2);): diagnostics 1`] =`"main.ts(3,22): error TSTL: This function must be called directly and cannot be referred to."`;
exports[`LuaTableHas extension invalid use method expression ("LuaTable<string, number>"): diagnostics 1`] = `"main.ts(3,37): error TSTL: This function must be called directly and cannot be referred to."`;
136
+
137
+
exports[`does not crash on invalid extension use global function: code 1`] = `""`;
138
+
139
+
exports[`does not crash on invalid extension use global function: diagnostics 1`] = `"main.ts(3,9): error TS2554: Expected 2 arguments, but got 1."`;
140
+
141
+
exports[`does not crash on invalid extension use method: code 1`] = `"left = {}"`;
142
+
143
+
exports[`does not crash on invalid extension use method: diagnostics 1`] = `"main.ts(5,14): error TS2554: Expected 2 arguments, but got 0."`;
0 commit comments