Skip to content

Commit 1a6739c

Browse files
committed
Accept new baselines
1 parent 5d3abdf commit 1a6739c

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- old.declarationEmitExpandoWithGenericConstraint.js
2+
+++ new.declarationEmitExpandoWithGenericConstraint.js
3+
@@= skipped -37, +37 lines =@@
4+
}
5+
export declare const Point: {
6+
(x: number, y: number): Point;
7+
- zero(): Point;
8+
+ zero: () => Point;
9+
};
10+
export declare const Rect: <p extends Point>(a: p, b: p) => Rect<p>;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- old.declarationEmitExpandoWithGenericConstraint.types
2+
+++ new.declarationEmitExpandoWithGenericConstraint.types
3+
@@= skipped -17, +17 lines =@@
4+
}
5+
6+
export const Point = (x: number, y: number): Point => ({ x, y });
7+
->Point : { (x: number, y: number): Point; zero(): Point; }
8+
->(x: number, y: number): Point => ({ x, y }) : { (x: number, y: number): Point; zero(): Point; }
9+
+>Point : { (x: number, y: number): Point; zero: () => Point; }
10+
+>(x: number, y: number): Point => ({ x, y }) : { (x: number, y: number): Point; zero: () => Point; }
11+
>x : number
12+
>y : number
13+
>({ x, y }) : { x: number; y: number; }
14+
@@= skipped -22, +22 lines =@@
15+
Point.zero = (): Point => Point(0, 0);
16+
>Point.zero = (): Point => Point(0, 0) : () => Point
17+
>Point.zero : () => Point
18+
->Point : { (x: number, y: number): Point; zero(): Point; }
19+
+>Point : { (x: number, y: number): Point; zero: () => Point; }
20+
>zero : () => Point
21+
>(): Point => Point(0, 0) : () => Point
22+
>Point(0, 0) : Point
23+
->Point : { (x: number, y: number): Point; zero(): Point; }
24+
+>Point : { (x: number, y: number): Point; zero: () => Point; }
25+
>0 : 0
26+
>0 : 0
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.js(8,23): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'.
2+
module.js(10,23): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'.
3+
4+
5+
==== module.js (2 errors) ====
6+
var Outer = {}
7+
Outer.Inner = function() {}
8+
Outer.Inner.prototype = {
9+
m() { },
10+
i: 1
11+
}
12+
// incremental assignments still work
13+
Outer.Inner.prototype.j = 2
14+
~
15+
!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'.
16+
/** @type {string} */
17+
Outer.Inner.prototype.k;
18+
~
19+
!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'.
20+
var inner = new Outer.Inner()
21+
inner.m()
22+
inner.i
23+
inner.j
24+
inner.k
25+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- old.jsContainerMergeTsDeclaration.types
2+
+++ new.jsContainerMergeTsDeclaration.types
3+
@@= skipped -1, +1 lines =@@
4+
5+
=== a.js ===
6+
var /*1*/x = function foo() {
7+
->x : { (): void; a(): void; }
8+
->function foo() {} : { (): void; a(): void; }
9+
->foo : { (): void; a(): void; }
10+
+>x : { (): void; a: () => void; }
11+
+>function foo() {} : { (): void; a: () => void; }
12+
+>foo : { (): void; a: () => void; }
13+
}
14+
x.a = function bar() {
15+
>x.a = function bar() {} : () => void
16+
>x.a : () => void
17+
->x : { (): void; a(): void; }
18+
+>x : { (): void; a: () => void; }
19+
>a : () => void
20+
>function bar() {} : () => void
21+
>bar : () => void
22+
}
23+
=== b.ts ===
24+
var x = function () {
25+
->x : { (): void; a(): void; }
26+
+>x : { (): void; a: () => void; }
27+
>function () { return 1;}() : number
28+
>function () { return 1;} : () => number
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--- old.typeFromPropertyAssignment13.errors.txt
2+
+++ new.typeFromPropertyAssignment13.errors.txt
3+
@@= skipped -0, +0 lines =@@
4+
-<no content>
5+
+module.js(8,23): error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'.
6+
+module.js(10,23): error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'.
7+
+
8+
+
9+
+==== module.js (2 errors) ====
10+
+ var Outer = {}
11+
+ Outer.Inner = function() {}
12+
+ Outer.Inner.prototype = {
13+
+ m() { },
14+
+ i: 1
15+
+ }
16+
+ // incremental assignments still work
17+
+ Outer.Inner.prototype.j = 2
18+
+ ~
19+
+!!! error TS2339: Property 'j' does not exist on type '{ m(): void; i: number; }'.
20+
+ /** @type {string} */
21+
+ Outer.Inner.prototype.k;
22+
+ ~
23+
+!!! error TS2339: Property 'k' does not exist on type '{ m(): void; i: number; }'.
24+
+ var inner = new Outer.Inner()
25+
+ inner.m()
26+
+ inner.i
27+
+ inner.j
28+
+ inner.k
29+
+

0 commit comments

Comments
 (0)