mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Adding regression test
This commit is contained in:
29
tests/baselines/reference/circularObjectLiteralAccessors.js
Normal file
29
tests/baselines/reference/circularObjectLiteralAccessors.js
Normal file
@@ -0,0 +1,29 @@
|
||||
//// [circularObjectLiteralAccessors.ts]
|
||||
|
||||
// Repro from #6000
|
||||
|
||||
const a = {
|
||||
b: {
|
||||
get foo(): string {
|
||||
return a.foo;
|
||||
},
|
||||
set foo(value: string) {
|
||||
a.foo = value;
|
||||
}
|
||||
},
|
||||
foo: ''
|
||||
};
|
||||
|
||||
//// [circularObjectLiteralAccessors.js]
|
||||
// Repro from #6000
|
||||
var a = {
|
||||
b: {
|
||||
get foo() {
|
||||
return a.foo;
|
||||
},
|
||||
set foo(value) {
|
||||
a.foo = value;
|
||||
}
|
||||
},
|
||||
foo: ''
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/compiler/circularObjectLiteralAccessors.ts ===
|
||||
|
||||
// Repro from #6000
|
||||
|
||||
const a = {
|
||||
>a : Symbol(a, Decl(circularObjectLiteralAccessors.ts, 3, 5))
|
||||
|
||||
b: {
|
||||
>b : Symbol(b, Decl(circularObjectLiteralAccessors.ts, 3, 11))
|
||||
|
||||
get foo(): string {
|
||||
>foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 4, 8), Decl(circularObjectLiteralAccessors.ts, 7, 10))
|
||||
|
||||
return a.foo;
|
||||
>a.foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 11, 6))
|
||||
>a : Symbol(a, Decl(circularObjectLiteralAccessors.ts, 3, 5))
|
||||
>foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 11, 6))
|
||||
|
||||
},
|
||||
set foo(value: string) {
|
||||
>foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 4, 8), Decl(circularObjectLiteralAccessors.ts, 7, 10))
|
||||
>value : Symbol(value, Decl(circularObjectLiteralAccessors.ts, 8, 16))
|
||||
|
||||
a.foo = value;
|
||||
>a.foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 11, 6))
|
||||
>a : Symbol(a, Decl(circularObjectLiteralAccessors.ts, 3, 5))
|
||||
>foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 11, 6))
|
||||
>value : Symbol(value, Decl(circularObjectLiteralAccessors.ts, 8, 16))
|
||||
}
|
||||
},
|
||||
foo: ''
|
||||
>foo : Symbol(foo, Decl(circularObjectLiteralAccessors.ts, 11, 6))
|
||||
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
=== tests/cases/compiler/circularObjectLiteralAccessors.ts ===
|
||||
|
||||
// Repro from #6000
|
||||
|
||||
const a = {
|
||||
>a : { b: { foo: string; }; foo: string; }
|
||||
>{ b: { get foo(): string { return a.foo; }, set foo(value: string) { a.foo = value; } }, foo: ''} : { b: { foo: string; }; foo: string; }
|
||||
|
||||
b: {
|
||||
>b : { foo: string; }
|
||||
>{ get foo(): string { return a.foo; }, set foo(value: string) { a.foo = value; } } : { foo: string; }
|
||||
|
||||
get foo(): string {
|
||||
>foo : string
|
||||
|
||||
return a.foo;
|
||||
>a.foo : string
|
||||
>a : { b: { foo: string; }; foo: string; }
|
||||
>foo : string
|
||||
|
||||
},
|
||||
set foo(value: string) {
|
||||
>foo : string
|
||||
>value : string
|
||||
|
||||
a.foo = value;
|
||||
>a.foo = value : string
|
||||
>a.foo : string
|
||||
>a : { b: { foo: string; }; foo: string; }
|
||||
>foo : string
|
||||
>value : string
|
||||
}
|
||||
},
|
||||
foo: ''
|
||||
>foo : string
|
||||
>'' : string
|
||||
|
||||
};
|
||||
15
tests/cases/compiler/circularObjectLiteralAccessors.ts
Normal file
15
tests/cases/compiler/circularObjectLiteralAccessors.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// @target: es5
|
||||
|
||||
// Repro from #6000
|
||||
|
||||
const a = {
|
||||
b: {
|
||||
get foo(): string {
|
||||
return a.foo;
|
||||
},
|
||||
set foo(value: string) {
|
||||
a.foo = value;
|
||||
}
|
||||
},
|
||||
foo: ''
|
||||
};
|
||||
Reference in New Issue
Block a user