|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`No Hoisting ("const foo = bar(); export function bar() { return \\"bar\\"; }"): code 1`] = ` |
| 4 | +"local ____exports = {} |
| 5 | +local foo = ____exports.bar(nil) |
| 6 | +function ____exports.bar(self) |
| 7 | + return \\"bar\\" |
| 8 | +end |
| 9 | +return ____exports" |
| 10 | +`; |
| 11 | + |
| 12 | +exports[`No Hoisting ("const foo = bar(); export function bar() { return \\"bar\\"; }"): diagnostics 1`] = `"main.ts(1,13): error TSTL: Identifier 'bar' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 13 | + |
| 14 | +exports[`No Hoisting ("const foo = bar(); function bar() { return \\"bar\\"; }"): code 1`] = ` |
| 15 | +"local foo = bar(_G) |
| 16 | +function bar(self) |
| 17 | + return \\"bar\\" |
| 18 | +end" |
| 19 | +`; |
| 20 | + |
| 21 | +exports[`No Hoisting ("const foo = bar(); function bar() { return \\"bar\\"; }"): diagnostics 1`] = `"main.ts(1,13): error TSTL: Identifier 'bar' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 22 | + |
| 23 | +exports[`No Hoisting ("export const foo = bar(); function bar() { return \\"bar\\"; }"): code 1`] = ` |
| 24 | +"local ____exports = {} |
| 25 | +____exports.foo = bar(nil) |
| 26 | +local function bar(self) |
| 27 | + return \\"bar\\" |
| 28 | +end |
| 29 | +return ____exports" |
| 30 | +`; |
| 31 | + |
| 32 | +exports[`No Hoisting ("export const foo = bar(); function bar() { return \\"bar\\"; }"): diagnostics 1`] = `"main.ts(1,20): error TSTL: Identifier 'bar' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 33 | + |
| 34 | +exports[`No Hoisting ("export namespace O { export function f() { return I.foo; } namespace I { export let foo = \\"foo\\"; } }"): code 1`] = ` |
| 35 | +"local ____exports = {} |
| 36 | +____exports.O = {} |
| 37 | +local O = ____exports.O |
| 38 | +do |
| 39 | + function O.f(self) |
| 40 | + return I.foo |
| 41 | + end |
| 42 | + local I = {} |
| 43 | + do |
| 44 | + I.foo = \\"foo\\" |
| 45 | + end |
| 46 | +end |
| 47 | +return ____exports" |
| 48 | +`; |
| 49 | + |
| 50 | +exports[`No Hoisting ("export namespace O { export function f() { return I.foo; } namespace I { export let foo = \\"foo\\"; } }"): diagnostics 1`] = `"main.ts(1,51): error TSTL: Identifier 'I' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 51 | + |
| 52 | +exports[`No Hoisting ("foo = \\"foo\\"; export var foo;"): code 1`] = ` |
| 53 | +"local ____exports = {} |
| 54 | +____exports.foo = \\"foo\\" |
| 55 | +return ____exports" |
| 56 | +`; |
| 57 | + |
| 58 | +exports[`No Hoisting ("foo = \\"foo\\"; export var foo;"): diagnostics 1`] = `"main.ts(1,1): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 59 | + |
| 60 | +exports[`No Hoisting ("foo = \\"foo\\"; var foo;"): code 1`] = `"foo = \\"foo\\""`; |
| 61 | + |
| 62 | +exports[`No Hoisting ("foo = \\"foo\\"; var foo;"): diagnostics 1`] = `"main.ts(1,1): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 63 | + |
| 64 | +exports[`No Hoisting ("function bar() { return E.A; } enum E { A = \\"foo\\" }"): code 1`] = ` |
| 65 | +"function bar(self) |
| 66 | + return E.A |
| 67 | +end |
| 68 | +E = {} |
| 69 | +E.A = \\"foo\\"" |
| 70 | +`; |
| 71 | + |
| 72 | +exports[`No Hoisting ("function bar() { return E.A; } enum E { A = \\"foo\\" }"): diagnostics 1`] = `"main.ts(1,25): error TSTL: Identifier 'E' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 73 | + |
| 74 | +exports[`No Hoisting ("function bar() { return NS.foo; } namespace NS { export let foo = \\"foo\\"; }"): code 1`] = ` |
| 75 | +"function bar(self) |
| 76 | + return NS.foo |
| 77 | +end |
| 78 | +NS = NS or {} |
| 79 | +do |
| 80 | + NS.foo = \\"foo\\" |
| 81 | +end" |
| 82 | +`; |
| 83 | + |
| 84 | +exports[`No Hoisting ("function bar() { return NS.foo; } namespace NS { export let foo = \\"foo\\"; }"): diagnostics 1`] = `"main.ts(1,25): error TSTL: Identifier 'NS' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 85 | + |
| 86 | +exports[`No Hoisting ("function makeFoo() { return new Foo(); } class Foo {}"): code 1`] = ` |
| 87 | +"require(\\"lualib_bundle\\"); |
| 88 | +function makeFoo(self) |
| 89 | + return __TS__New(Foo) |
| 90 | +end |
| 91 | +Foo = __TS__Class() |
| 92 | +Foo.name = \\"Foo\\" |
| 93 | +function Foo.prototype.____constructor(self) |
| 94 | +end" |
| 95 | +`; |
| 96 | + |
| 97 | +exports[`No Hoisting ("function makeFoo() { return new Foo(); } class Foo {}"): diagnostics 1`] = `"main.ts(1,33): error TSTL: Identifier 'Foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 98 | + |
| 99 | +exports[`No Hoisting ("function setBar() { const bar = { foo }; } let foo = \\"foo\\";"): code 1`] = ` |
| 100 | +"function setBar(self) |
| 101 | + local bar = {foo = foo} |
| 102 | +end |
| 103 | +local foo = \\"foo\\"" |
| 104 | +`; |
| 105 | + |
| 106 | +exports[`No Hoisting ("function setBar() { const bar = { foo }; } let foo = \\"foo\\";"): diagnostics 1`] = `"main.ts(1,35): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 107 | + |
| 108 | +exports[`No Hoisting ("function setBar() { const bar = foo; } const foo = \\"foo\\";"): code 1`] = ` |
| 109 | +"function setBar(self) |
| 110 | + local bar = foo |
| 111 | +end |
| 112 | +local foo = \\"foo\\"" |
| 113 | +`; |
| 114 | + |
| 115 | +exports[`No Hoisting ("function setBar() { const bar = foo; } const foo = \\"foo\\";"): diagnostics 1`] = `"main.ts(1,33): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 116 | + |
| 117 | +exports[`No Hoisting ("function setBar() { const bar = foo; } export const foo = \\"foo\\";"): code 1`] = ` |
| 118 | +"local ____exports = {} |
| 119 | +local function setBar(self) |
| 120 | + local bar = ____exports.foo |
| 121 | +end |
| 122 | +____exports.foo = \\"foo\\" |
| 123 | +return ____exports" |
| 124 | +`; |
| 125 | + |
| 126 | +exports[`No Hoisting ("function setBar() { const bar = foo; } export const foo = \\"foo\\";"): diagnostics 1`] = `"main.ts(1,33): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 127 | + |
| 128 | +exports[`No Hoisting ("function setBar() { const bar = foo; } export let foo = \\"foo\\";"): code 1`] = ` |
| 129 | +"local ____exports = {} |
| 130 | +local function setBar(self) |
| 131 | + local bar = ____exports.foo |
| 132 | +end |
| 133 | +____exports.foo = \\"foo\\" |
| 134 | +return ____exports" |
| 135 | +`; |
| 136 | + |
| 137 | +exports[`No Hoisting ("function setBar() { const bar = foo; } export let foo = \\"foo\\";"): diagnostics 1`] = `"main.ts(1,33): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
| 138 | + |
| 139 | +exports[`No Hoisting ("function setBar() { const bar = foo; } let foo = \\"foo\\";"): code 1`] = ` |
| 140 | +"function setBar(self) |
| 141 | + local bar = foo |
| 142 | +end |
| 143 | +local foo = \\"foo\\"" |
| 144 | +`; |
| 145 | + |
| 146 | +exports[`No Hoisting ("function setBar() { const bar = foo; } let foo = \\"foo\\";"): diagnostics 1`] = `"main.ts(1,33): error TSTL: Identifier 'foo' was referenced before it was declared. The declaration must be moved before the identifier's use, or hoisting must be enabled."`; |
0 commit comments