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
Copy file name to clipboardExpand all lines: test/unit/language-extensions/__snapshots__/table.spec.ts.snap
+63Lines changed: 63 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,48 @@
1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = [tableDelete({}, \\"foo\\")];"): code 1`] =`
4
+
"foo = {
5
+
(function()
6
+
({}).foo = nil
7
+
return nil
8
+
end)()
9
+
}"
10
+
`;
11
+
12
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = [tableDelete({}, \\"foo\\")];"): diagnostics 1`] =`"main.ts(3,26): error TSTL: Table delete extension can only be called as a stand-alone statement. It cannot be used as an expression in another statement."`;
13
+
14
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = \`\${tableDelete({}, \\"foo\\")}\`;"): code 1`] =`
15
+
"foo = tostring(
16
+
(function()
17
+
({}).foo = nil
18
+
return nil
19
+
end)()
20
+
)"
21
+
`;
22
+
23
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = \`\${tableDelete({}, \\"foo\\")}\`;"): diagnostics 1`] =`"main.ts(3,28): error TSTL: Table delete extension can only be called as a stand-alone statement. It cannot be used as an expression in another statement."`;
24
+
25
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = tableDelete({}, \\"foo\\");"): code 1`] =`
26
+
"foo = (function()
27
+
({}).foo = nil
28
+
return nil
29
+
end)()"
30
+
`;
31
+
32
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("const foo = tableDelete({}, \\"foo\\");"): diagnostics 1`] =`"main.ts(3,25): error TSTL: Table delete extension can only be called as a stand-alone statement. It cannot be used as an expression in another statement."`;
33
+
34
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("declare function foo(arg: any): void; foo(tableDelete({}, \\"foo\\"));"): code 1`] =`
35
+
"foo(
36
+
_G,
37
+
(function()
38
+
({}).foo = nil
39
+
return nil
40
+
end)()
41
+
)"
42
+
`;
43
+
44
+
exports[`LuaTableDelete extension LuaTableDelete invalid use as expression ("declare function foo(arg: any): void; foo(tableDelete({}, \\"foo\\"));"): diagnostics 1`] =`"main.ts(3,55): error TSTL: Table delete extension can only be called as a stand-alone statement. It cannot be used as an expression in another statement."`;
45
+
3
46
exports[`LuaTableGet & LuaTableSet extensions LuaTableSet invalid use as expression ("const foo = [setTable({}, \\"foo\\", 3)];"): code 1`] =`
exports[`LuaTableGet & LuaTableSet extensions invalid use ("declare function foo(getTable: LuaTableGet<{}, string, number>): void; foo(getTable);"): code 1`] =`"foo(_G, getTable)"`;
63
106
64
107
exports[`LuaTableGet & LuaTableSet extensions invalid use ("declare function foo(getTable: LuaTableGet<{}, string, number>): void; foo(getTable);"): diagnostics 1`] =`"main.ts(3,88): error TSTL: This function must be called directly and cannot be referred to."`;
108
+
109
+
exports[`LuaTableHas extension invalid use ("const foo = (tableHas as any)(1, 2);"): code 1`] =`"foo = tableHas(_G, 1, 2)"`;
110
+
111
+
exports[`LuaTableHas extension invalid use ("const foo = (tableHas as any)(1, 2);"): diagnostics 1`] =`"main.ts(3,26): error TSTL: This function must be called directly and cannot be referred to."`;
exports[`LuaTableHas extension invalid use ("const foo = [tableHas];"): diagnostics 1`] =`"main.ts(3,26): error TSTL: This function must be called directly and cannot be referred to."`;
exports[`LuaTableHas extension invalid use ("const foo = \`\${tableHas}\`;"): diagnostics 1`] =`"main.ts(3,28): error TSTL: This function must be called directly and cannot be referred to."`;
exports[`LuaTableHas extension invalid use ("const foo: unknown = tableHas;"): diagnostics 1`] =`"main.ts(3,34): error TSTL: This function must be called directly and cannot be referred to."`;
124
+
125
+
exports[`LuaTableHas extension invalid use ("declare function foo(tableHas: LuaTableHas<{}, string>): void; foo(tableHas);"): code 1`] =`"foo(_G, tableHas)"`;
126
+
127
+
exports[`LuaTableHas extension invalid use ("declare function foo(tableHas: LuaTableHas<{}, string>): void; foo(tableHas);"): diagnostics 1`] =`"main.ts(3,80): error TSTL: This function must be called directly and cannot be referred to."`;
0 commit comments