diff --git a/tests/baselines/reference/multipleDeclarations.js b/tests/baselines/reference/multipleDeclarations.js new file mode 100644 index 0000000000..5f5ac29e90 --- /dev/null +++ b/tests/baselines/reference/multipleDeclarations.js @@ -0,0 +1,17 @@ +//// [input.js] + +function C() { + this.m = null; +} +C.prototype.m = function() { + this.nothing(); +}; + + +//// [output.js] +function C() { + this.m = null; +} +C.prototype.m = function () { + this.nothing(); +}; diff --git a/tests/baselines/reference/multipleDeclarations.symbols b/tests/baselines/reference/multipleDeclarations.symbols new file mode 100644 index 0000000000..0c8569ab89 --- /dev/null +++ b/tests/baselines/reference/multipleDeclarations.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/salsa/input.js === + +function C() { +>C : Symbol(C, Decl(input.js, 0, 0)) + + this.m = null; +>m : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1)) +} +C.prototype.m = function() { +>C.prototype : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1)) +>C : Symbol(C, Decl(input.js, 0, 0)) +>prototype : Symbol(Function.prototype, Decl(lib.d.ts, --, --)) +>m : Symbol(C.m, Decl(input.js, 1, 14), Decl(input.js, 3, 1)) + + this.nothing(); +}; + diff --git a/tests/baselines/reference/multipleDeclarations.types b/tests/baselines/reference/multipleDeclarations.types new file mode 100644 index 0000000000..7c0a3de70c --- /dev/null +++ b/tests/baselines/reference/multipleDeclarations.types @@ -0,0 +1,29 @@ +=== tests/cases/conformance/salsa/input.js === + +function C() { +>C : () => void + + this.m = null; +>this.m = null : null +>this.m : any +>this : any +>m : any +>null : null +} +C.prototype.m = function() { +>C.prototype.m = function() { this.nothing();} : () => void +>C.prototype.m : any +>C.prototype : any +>C : () => void +>prototype : any +>m : any +>function() { this.nothing();} : () => void + + this.nothing(); +>this.nothing() : any +>this.nothing : any +>this : { m: () => void; } +>nothing : any + +}; + diff --git a/tests/cases/conformance/salsa/multipleDeclarations.ts b/tests/cases/conformance/salsa/multipleDeclarations.ts new file mode 100644 index 0000000000..6899be2ec8 --- /dev/null +++ b/tests/cases/conformance/salsa/multipleDeclarations.ts @@ -0,0 +1,10 @@ +// @filename: input.js +// @out: output.js +// @allowJs: true + +function C() { + this.m = null; +} +C.prototype.m = function() { + this.nothing(); +};