diff --git a/tests/baselines/reference/jsContainerMergeJsContainer.symbols b/tests/baselines/reference/jsContainerMergeJsContainer.symbols new file mode 100644 index 00000000000..1f4728d50de --- /dev/null +++ b/tests/baselines/reference/jsContainerMergeJsContainer.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/salsa/a.js === +// #24131 +const a = {}; +>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0)) + +a.d = function() {}; +>a.d : Symbol(d, Decl(a.js, 1, 13), Decl(b.js, 0, 2)) +>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0)) +>d : Symbol(d, Decl(a.js, 1, 13), Decl(b.js, 0, 2)) + +=== tests/cases/conformance/salsa/b.js === +a.d.prototype = {}; +>a.d.prototype : Symbol(d.prototype, Decl(b.js, 0, 0)) +>a.d : Symbol(d, Decl(a.js, 1, 13), Decl(b.js, 0, 2)) +>a : Symbol(a, Decl(a.js, 1, 5), Decl(a.js, 1, 13), Decl(b.js, 0, 0)) +>d : Symbol(d, Decl(a.js, 1, 13), Decl(b.js, 0, 2)) +>prototype : Symbol(d.prototype, Decl(b.js, 0, 0)) + diff --git a/tests/baselines/reference/jsContainerMergeJsContainer.types b/tests/baselines/reference/jsContainerMergeJsContainer.types new file mode 100644 index 00000000000..fa5c74f5b05 --- /dev/null +++ b/tests/baselines/reference/jsContainerMergeJsContainer.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/salsa/a.js === +// #24131 +const a = {}; +>a : { [x: string]: any; d: typeof d; } +>{} : { [x: string]: any; d: typeof d; } + +a.d = function() {}; +>a.d = function() {} : typeof d +>a.d : typeof d +>a : { [x: string]: any; d: typeof d; } +>d : typeof d +>function() {} : typeof d + +=== tests/cases/conformance/salsa/b.js === +a.d.prototype = {}; +>a.d.prototype = {} : { [x: string]: any; } +>a.d.prototype : { [x: string]: any; } +>a.d : typeof d +>a : { [x: string]: any; d: typeof d; } +>d : typeof d +>prototype : { [x: string]: any; } +>{} : { [x: string]: any; } + diff --git a/tests/cases/conformance/salsa/jsContainerMergeJsContainer.ts b/tests/cases/conformance/salsa/jsContainerMergeJsContainer.ts new file mode 100644 index 00000000000..3d6cbb35b75 --- /dev/null +++ b/tests/cases/conformance/salsa/jsContainerMergeJsContainer.ts @@ -0,0 +1,10 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true + +// #24131 +// @Filename: a.js +const a = {}; +a.d = function() {}; +// @Filename: b.js +a.d.prototype = {};