File: objectLiteralThisWidenedOnUse.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (47 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (4)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
=== tests/cases/compiler/objectLiteralThisWidenedOnUse.ts ===
interface Foo { bar: boolean; }
>bar : boolean

var GlobalIns = {
>GlobalIns : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }
>{  prop1: 1,  prop2: 2,  prop3: 3,  test () {    this.accept_foo(this);  },  accept_foo (foo: Foo): boolean {    return !!foo && !!foo.bar;  }} : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }

  prop1: 1,
>prop1 : number
>1 : 1

  prop2: 2,
>prop2 : number
>2 : 2

  prop3: 3,
>prop3 : number
>3 : 3

  test () {
>test : () => void

    this.accept_foo(this);
>this.accept_foo(this) : boolean
>this.accept_foo : (foo: Foo) => boolean
>this : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }
>accept_foo : (foo: Foo) => boolean
>this : { prop1: number; prop2: number; prop3: number; test(): void; accept_foo(foo: Foo): boolean; }

  },
  accept_foo (foo: Foo): boolean {
>accept_foo : (foo: Foo) => boolean
>foo : Foo

    return !!foo && !!foo.bar;
>!!foo && !!foo.bar : boolean
>!!foo : boolean
>!foo : boolean
>foo : Foo
>!!foo.bar : boolean
>!foo.bar : boolean
>foo.bar : boolean
>foo : Foo
>bar : boolean
  }
};