mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-11 05:32:14 -05:00
@@ -3834,7 +3834,7 @@ namespace ts {
|
||||
|
||||
const entries: CompletionEntry[] = [];
|
||||
|
||||
if (isRightOfDot && isSourceFileJavaScript(sourceFile)) {
|
||||
if (isSourceFileJavaScript(sourceFile)) {
|
||||
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries);
|
||||
addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames));
|
||||
}
|
||||
|
||||
15
tests/cases/fourslash/getJavaScriptGlobalCompletions1.ts
Normal file
15
tests/cases/fourslash/getJavaScriptGlobalCompletions1.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: Foo.js
|
||||
//// function f() {
|
||||
//// // helloWorld leaks from here into the global space?
|
||||
//// if (helloWorld) {
|
||||
//// return 3;
|
||||
//// }
|
||||
//// return 5;
|
||||
//// }
|
||||
////
|
||||
//// hello/**/
|
||||
|
||||
verify.completionListContains('helloWorld');
|
||||
Reference in New Issue
Block a user