Skip to content

Commit

Permalink
fix #3679: remove usages of Array.values
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kosiakov <anton.kosyakov@typefox.io>
  • Loading branch information
akosyakov committed Dec 10, 2018
1 parent b01110a commit 29dd2bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"@theia/console": "^0.3.17",
"@theia/core": "^0.3.17",
"@theia/cpp": "^0.3.17",
"@theia/debug": "^0.3.17",
"@theia/debug-nodejs": "^0.3.17",
"@theia/editor": "^0.3.17",
"@theia/editor-preview": "^0.3.17",
"@theia/editorconfig": "^0.3.17",
Expand All @@ -28,6 +30,7 @@
"@theia/getting-started": "^0.3.17",
"@theia/git": "^0.3.17",
"@theia/java": "^0.3.17",
"@theia/java-debug": "^0.3.17",
"@theia/json": "^0.3.17",
"@theia/keymaps": "^0.3.17",
"@theia/languages": "^0.3.17",
Expand Down
4 changes: 2 additions & 2 deletions packages/debug/src/browser/console/debug-console-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export class ExpressionContainer implements CompositeConsoleItem {
protected elements: Promise<ExpressionContainer[]> | undefined;
async getElements(): Promise<IterableIterator<ExpressionContainer>> {
if (!this.hasElements || !this.session) {
return [].values();
return [][Symbol.iterator]();
}
if (!this.elements) {
this.elements = this.doResolve();
}
return (await this.elements).values();
return (await this.elements)[Symbol.iterator]();
}
protected async doResolve(): Promise<ExpressionContainer[]> {
const result: ExpressionContainer[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class DebugConsoleSession extends ConsoleSession {
}

getElements(): IterableIterator<ConsoleItem> {
return this.items.values();
return this.items[Symbol.iterator]();
}

protected async completions({ textDocument: { uri }, position }: CompletionParams): Promise<CompletionItem[]> {
Expand Down
2 changes: 1 addition & 1 deletion packages/debug/src/browser/editor/debug-hover-source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class DebugHoverSource extends TreeSource {

protected elements: TreeElement[] = [];
getElements(): IterableIterator<TreeElement> {
return this.elements.values();
return this.elements[Symbol.iterator]();
}

protected renderTitle(element: ExpressionItem | DebugVariable): React.ReactNode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DebugBreakpointsSource extends TreeSource {
}

getElements(): IterableIterator<TreeElement> {
return this.model.breakpoints.values();
return this.model.breakpoints[Symbol.iterator]();
}

}
2 changes: 1 addition & 1 deletion packages/debug/src/browser/view/debug-variables-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class DebugVariablesSource extends TreeSource {
async getElements(): Promise<IterableIterator<DebugScope>> {
const { currentSession } = this.model;
const scopes = currentSession ? await currentSession.getScopes() : [];
return scopes.values();
return scopes[Symbol.iterator]();
}

}

0 comments on commit 29dd2bd

Please sign in to comment.