Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ts.Completions {
const entries: CompletionEntry[] = [];

if (isSourceFileJavaScript(sourceFile)) {
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ false);
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true);
addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames));
}
else {
Expand Down
71 changes: 71 additions & 0 deletions tests/cases/fourslash/completionListInvalidMemberNames3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/// <reference path='fourslash.ts' />

// @allowjs: true

// @Filename: test.js
////interface Symbol {
//// /** Returns a string representation of an object. */
//// toString(): string;

//// /** Returns the primitive value of the specified object. */
//// valueOf(): Object;
////}

////interface SymbolConstructor {
//// /**
//// * A reference to the prototype.
//// */
//// readonly prototype: Symbol;

//// /**
//// * Returns a new unique Symbol value.
//// * @param description Description of the new Symbol object.
//// */
//// (description?: string | number): symbol;

//// /**
//// * Returns a Symbol object from the global symbol registry matching the given key if found.
//// * Otherwise, returns a new symbol with this key.
//// * @param key key to search for.
//// */
//// for(key: string): symbol;

//// /**
//// * Returns a key from the global symbol registry matching the given Symbol if found.
//// * Otherwise, returns a undefined.
//// * @param sym Symbol to find the key for.
//// */
//// keyFor(sym: symbol): string | undefined;
////}

////declare var Symbol: SymbolConstructor;/// <reference path="lib.es2015.symbol.d.ts" />

////interface SymbolConstructor {
//// /**
//// * A method that determines if a constructor object recognizes an object as one of the
//// * constructor�s instances. Called by the semantics of the instanceof operator.
//// */
//// readonly hasInstance: symbol;
////}

////interface Function {
//// /**
//// * Determines whether the given value inherits from this function if this function was used
//// * as a constructor function.
//// *
//// * A constructor function can control which objects are recognized as its instances by
//// * 'instanceof' by overriding this method.
//// */
//// [Symbol.hasInstance](value: any): boolean;
////}

////interface SomeInterface {
//// (value: number): any;
////}

////var _ : SomeInterface;
////_./**/

goTo.marker();

verify.not.completionListContains("[Symbol.hasInstance]");