|
| 1 | +//// [tests/cases/compiler/declarationEmitLateBoundAssignments2.ts] //// |
| 2 | + |
| 3 | +//// [declarationEmitLateBoundAssignments2.ts] |
| 4 | +// https://github.com/microsoft/TypeScript/issues/54811 |
| 5 | + |
| 6 | +const c = "C" |
| 7 | +const num = 1 |
| 8 | +const numStr = "10" |
| 9 | +const withWhitespace = "foo bar" |
| 10 | +const emoji = "🤷♂️" |
| 11 | + |
| 12 | +export function decl() {} |
| 13 | +decl["B"] = 'foo' |
| 14 | + |
| 15 | +export function decl2() {} |
| 16 | +decl2[c] = 0 |
| 17 | + |
| 18 | +export function decl3() {} |
| 19 | +decl3[77] = 0 |
| 20 | + |
| 21 | +export function decl4() {} |
| 22 | +decl4[num] = 0 |
| 23 | + |
| 24 | +export function decl5() {} |
| 25 | +decl5["101"] = 0 |
| 26 | + |
| 27 | +export function decl6() {} |
| 28 | +decl6[numStr] = 0 |
| 29 | + |
| 30 | +export function decl7() {} |
| 31 | +decl7["qwe rty"] = 0 |
| 32 | + |
| 33 | +export function decl8() {} |
| 34 | +decl8[withWhitespace] = 0 |
| 35 | + |
| 36 | +export function decl9() {} |
| 37 | +decl9["🤪"] = 0 |
| 38 | + |
| 39 | +export function decl10() {} |
| 40 | +decl10[emoji] = 0 |
| 41 | + |
| 42 | +export const arrow = () => {} |
| 43 | +arrow["B"] = 'bar' |
| 44 | + |
| 45 | +export const arrow2 = () => {} |
| 46 | +arrow2[c] = 100 |
| 47 | + |
| 48 | +export const arrow3 = () => {} |
| 49 | +arrow3[77] = 0 |
| 50 | + |
| 51 | +export const arrow4 = () => {} |
| 52 | +arrow4[num] = 0 |
| 53 | + |
| 54 | +export const arrow5 = () => {} |
| 55 | +arrow5["101"] = 0 |
| 56 | + |
| 57 | +export const arrow6 = () => {} |
| 58 | +arrow6[numStr] = 0 |
| 59 | + |
| 60 | +export const arrow7 = () => {} |
| 61 | +arrow7["qwe rty"] = 0 |
| 62 | + |
| 63 | +export const arrow8 = () => {} |
| 64 | +arrow8[withWhitespace] = 0 |
| 65 | + |
| 66 | +export const arrow9 = () => {} |
| 67 | +arrow9["🤪"] = 0 |
| 68 | + |
| 69 | +export const arrow10 = () => {} |
| 70 | +arrow10[emoji] = 0 |
| 71 | + |
| 72 | + |
| 73 | +//// [declarationEmitLateBoundAssignments2.js] |
| 74 | +// https://github.com/microsoft/TypeScript/issues/54811 |
| 75 | +const c = "C"; |
| 76 | +const num = 1; |
| 77 | +const numStr = "10"; |
| 78 | +const withWhitespace = "foo bar"; |
| 79 | +const emoji = "🤷♂️"; |
| 80 | +export function decl() { } |
| 81 | +decl["B"] = 'foo'; |
| 82 | +export function decl2() { } |
| 83 | +decl2[c] = 0; |
| 84 | +export function decl3() { } |
| 85 | +decl3[77] = 0; |
| 86 | +export function decl4() { } |
| 87 | +decl4[num] = 0; |
| 88 | +export function decl5() { } |
| 89 | +decl5["101"] = 0; |
| 90 | +export function decl6() { } |
| 91 | +decl6[numStr] = 0; |
| 92 | +export function decl7() { } |
| 93 | +decl7["qwe rty"] = 0; |
| 94 | +export function decl8() { } |
| 95 | +decl8[withWhitespace] = 0; |
| 96 | +export function decl9() { } |
| 97 | +decl9["🤪"] = 0; |
| 98 | +export function decl10() { } |
| 99 | +decl10[emoji] = 0; |
| 100 | +export const arrow = () => { }; |
| 101 | +arrow["B"] = 'bar'; |
| 102 | +export const arrow2 = () => { }; |
| 103 | +arrow2[c] = 100; |
| 104 | +export const arrow3 = () => { }; |
| 105 | +arrow3[77] = 0; |
| 106 | +export const arrow4 = () => { }; |
| 107 | +arrow4[num] = 0; |
| 108 | +export const arrow5 = () => { }; |
| 109 | +arrow5["101"] = 0; |
| 110 | +export const arrow6 = () => { }; |
| 111 | +arrow6[numStr] = 0; |
| 112 | +export const arrow7 = () => { }; |
| 113 | +arrow7["qwe rty"] = 0; |
| 114 | +export const arrow8 = () => { }; |
| 115 | +arrow8[withWhitespace] = 0; |
| 116 | +export const arrow9 = () => { }; |
| 117 | +arrow9["🤪"] = 0; |
| 118 | +export const arrow10 = () => { }; |
| 119 | +arrow10[emoji] = 0; |
| 120 | + |
| 121 | + |
| 122 | +//// [declarationEmitLateBoundAssignments2.d.ts] |
| 123 | +export declare function decl(): void; |
| 124 | +export declare namespace decl { |
| 125 | + var B: string; |
| 126 | +} |
| 127 | +export declare function decl2(): void; |
| 128 | +export declare namespace decl2 { |
| 129 | + var C: number; |
| 130 | +} |
| 131 | +export declare function decl3(): void; |
| 132 | +export declare namespace decl3 { } |
| 133 | +export declare function decl4(): void; |
| 134 | +export declare namespace decl4 { } |
| 135 | +export declare function decl5(): void; |
| 136 | +export declare namespace decl5 { } |
| 137 | +export declare function decl6(): void; |
| 138 | +export declare namespace decl6 { } |
| 139 | +export declare function decl7(): void; |
| 140 | +export declare namespace decl7 { } |
| 141 | +export declare function decl8(): void; |
| 142 | +export declare namespace decl8 { } |
| 143 | +export declare function decl9(): void; |
| 144 | +export declare namespace decl9 { } |
| 145 | +export declare function decl10(): void; |
| 146 | +export declare namespace decl10 { } |
| 147 | +export declare const arrow: { |
| 148 | + (): void; |
| 149 | + B: string; |
| 150 | +}; |
| 151 | +export declare const arrow2: { |
| 152 | + (): void; |
| 153 | + C: number; |
| 154 | +}; |
| 155 | +export declare const arrow3: { |
| 156 | + (): void; |
| 157 | + 77: number; |
| 158 | +}; |
| 159 | +export declare const arrow4: { |
| 160 | + (): void; |
| 161 | + 1: number; |
| 162 | +}; |
| 163 | +export declare const arrow5: { |
| 164 | + (): void; |
| 165 | + "101": number; |
| 166 | +}; |
| 167 | +export declare const arrow6: { |
| 168 | + (): void; |
| 169 | + "10": number; |
| 170 | +}; |
| 171 | +export declare const arrow7: { |
| 172 | + (): void; |
| 173 | + "qwe rty": number; |
| 174 | +}; |
| 175 | +export declare const arrow8: { |
| 176 | + (): void; |
| 177 | + "foo bar": number; |
| 178 | +}; |
| 179 | +export declare const arrow9: { |
| 180 | + (): void; |
| 181 | + "\uD83E\uDD2A": number; |
| 182 | +}; |
| 183 | +export declare const arrow10: { |
| 184 | + (): void; |
| 185 | + "\uD83E\uDD37\u200D\u2642\uFE0F": number; |
| 186 | +}; |
0 commit comments