File: chainedPrototypeAssignment.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (105 lines) | stat: -rw-r--r-- 2,655 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
=== tests/cases/conformance/salsa/use.js ===
/// <reference path='./types.d.ts'/>
var mod = require('./mod');
>mod : typeof import("tests/cases/conformance/salsa/mod")
>require('./mod') : typeof import("tests/cases/conformance/salsa/mod")
>require : (name: string) => any
>'./mod' : "./mod"

var a = new mod.A()
>a : A & { m(n: number): number; }
>new mod.A() : A & { m(n: number): number; }
>mod.A : typeof A
>mod : typeof import("tests/cases/conformance/salsa/mod")
>A : typeof A

var b = new mod.B()
>b : B & { m(n: number): number; }
>new mod.B() : B & { m(n: number): number; }
>mod.B : typeof B
>mod : typeof import("tests/cases/conformance/salsa/mod")
>B : typeof B

a.m('nope')
>a.m('nope') : number
>a.m : (n: number) => number
>a : A & { m(n: number): number; }
>m : (n: number) => number
>'nope' : "nope"

b.m('not really')
>b.m('not really') : number
>b.m : (n: number) => number
>b : B & { m(n: number): number; }
>m : (n: number) => number
>'not really' : "not really"

=== tests/cases/conformance/salsa/types.d.ts ===
declare function require(name: string): any;
>require : (name: string) => any
>name : string

declare var exports: any;
>exports : any

=== tests/cases/conformance/salsa/mod.js ===
/// <reference path='./types.d.ts'/>
var A = function() {
>A : typeof A
>function() {    this.a = 1} : typeof A

    this.a = 1
>this.a = 1 : 1
>this.a : any
>this : any
>a : any
>1 : 1
}
var B = function() {
>B : typeof B
>function() {    this.b = 2} : typeof B

    this.b = 2
>this.b = 2 : 2
>this.b : any
>this : any
>b : any
>2 : 2
}
exports.A = A
>exports.A = A : typeof A
>exports.A : typeof A
>exports : typeof import("tests/cases/conformance/salsa/mod")
>A : typeof A
>A : typeof A

exports.B = B
>exports.B = B : typeof B
>exports.B : typeof B
>exports : typeof import("tests/cases/conformance/salsa/mod")
>B : typeof B
>B : typeof B

A.prototype = B.prototype = {
>A.prototype = B.prototype = {    /** @param {number} n */    m(n) {        return n + 1    }} : { m(n: number): number; }
>A.prototype : { m(n: number): number; }
>A : typeof A
>prototype : { m(n: number): number; }
>B.prototype = {    /** @param {number} n */    m(n) {        return n + 1    }} : { m(n: number): number; }
>B.prototype : { m(n: number): number; }
>B : typeof B
>prototype : { m(n: number): number; }
>{    /** @param {number} n */    m(n) {        return n + 1    }} : { m(n: number): number; }

    /** @param {number} n */
    m(n) {
>m : (n: number) => number
>n : number

        return n + 1
>n + 1 : number
>n : number
>1 : 1
    }
}