JavaScript: handle lack of modifiers on extracted method

The emitter expects undefined, rather than empty.  This only affects JS,
because TS applies `private` to all extracted methods.

(cherry picked from commit 9630c46ea7)
This commit is contained in:
Andrew Casey
2017-09-20 14:48:11 -07:00
parent 7dec4ae9d1
commit a1dee452fa
2 changed files with 31 additions and 1 deletions

View File

@@ -664,7 +664,7 @@ namespace ts.refactor.extractMethod {
}
newFunction = createMethod(
/*decorators*/ undefined,
modifiers,
modifiers.length ? modifiers : undefined,
range.facts & RangeFacts.IsGenerator ? createToken(SyntaxKind.AsteriskToken) : undefined,
functionName,
/*questionToken*/ undefined,