File: declarationEmitReadonlyComputedProperty.symbols

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (34 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
=== tests/cases/compiler/bug.ts ===
export const SYMBOL = Symbol()
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))

export interface Interface {
>Interface : Symbol(Interface, Decl(bug.ts, 0, 30))

  readonly [SYMBOL]: string; // remove readonly and @showEmit to see the expected error
>[SYMBOL] : Symbol(Interface[SYMBOL], Decl(bug.ts, 2, 28))
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
}

export function createInstance(): Interface {
>createInstance : Symbol(createInstance, Decl(bug.ts, 4, 1))
>Interface : Symbol(Interface, Decl(bug.ts, 0, 30))

  return {
    [SYMBOL]: ''
>[SYMBOL] : Symbol([SYMBOL], Decl(bug.ts, 7, 10))
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
  }
}

=== tests/cases/compiler/index.ts ===
import { createInstance } from './bug'
>createInstance : Symbol(createInstance, Decl(index.ts, 0, 8))

export const spread = {
>spread : Symbol(spread, Decl(index.ts, 2, 12))

  ...createInstance(),
>createInstance : Symbol(createInstance, Decl(index.ts, 0, 8))
}