From 4a9b1209aeffb33ddbc6c7358e2a0e901cb8eee9 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Fri, 10 Jun 2016 14:11:31 -0700 Subject: [PATCH] Test adding members to JS variables whose initialisers are functions --- ...salsaMethodsOnAssignedFunctionExpressions.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/cases/fourslash/salsaMethodsOnAssignedFunctionExpressions.ts diff --git a/tests/cases/fourslash/salsaMethodsOnAssignedFunctionExpressions.ts b/tests/cases/fourslash/salsaMethodsOnAssignedFunctionExpressions.ts new file mode 100644 index 00000000000..a73207c01d2 --- /dev/null +++ b/tests/cases/fourslash/salsaMethodsOnAssignedFunctionExpressions.ts @@ -0,0 +1,17 @@ +/// +// @allowJs: true +// @Filename: something.js +////var C = function () { } +/////** +//// * The prototype method. +//// * @param {string} a Parameter definition. +//// */ +////function f(a) {} +////C.prototype.m = f; +//// +////var x = new C(); +////x/*1*/./*2*/m(); +goTo.marker('1'); +verify.quickInfoIs('var x: {\n m: (a: string) => void;\n}'); +goTo.marker('2'); +verify.completionListContains('m', '(property) C.m: (a: string) => void', 'The prototype method.');