提交 70430f5c 编写于 作者: D Dirk Baeumer

Fixed compile errors caused by 1.8.0

上级 033112ea
...@@ -29,7 +29,8 @@ function fifo(array:any[], size:number) { ...@@ -29,7 +29,8 @@ function fifo(array:any[], size:number) {
export function register(what: string, fn: Function): (...args: any[]) => void { export function register(what: string, fn: Function): (...args: any[]) => void {
if (true) { let disable = true; // Otherwise we have unreachable code.
if (disable) {
return () => { return () => {
// Intentional empty, disable for now because it is leaking memory // Intentional empty, disable for now because it is leaking memory
}; };
......
...@@ -107,7 +107,7 @@ export class MockNode extends MockEventTarget implements Node { ...@@ -107,7 +107,7 @@ export class MockNode extends MockEventTarget implements Node {
this.appendChild(this.ownerDocument.createTextNode(value)); this.appendChild(this.ownerDocument.createTextNode(value));
} }
removeChild(oldChild: Node): Node { public removeChild(oldChild: Node): Node {
var i = this._childNodes.indexOf(oldChild); var i = this._childNodes.indexOf(oldChild);
if(i >= 0) { if(i >= 0) {
var removed = this._childNodes.splice(i, 1); var removed = this._childNodes.splice(i, 1);
...@@ -116,6 +116,10 @@ export class MockNode extends MockEventTarget implements Node { ...@@ -116,6 +116,10 @@ export class MockNode extends MockEventTarget implements Node {
return null; return null;
} }
public contains(node: Node): boolean {
return this._childNodes.indexOf(node) !== -1;
}
appendChild(newChild: Node): Node { appendChild(newChild: Node): Node {
this._childNodes.push(newChild); this._childNodes.push(newChild);
return newChild; return newChild;
...@@ -238,6 +242,14 @@ export class MockElement extends MockNode implements Element { ...@@ -238,6 +242,14 @@ export class MockElement extends MockNode implements Element {
return filter.length ? filter[0].value : ''; return filter.length ? filter[0].value : '';
} }
get innerHTML(): string {
throw new Error('Not implemented!');
}
set innerHTML(value: string) {
throw new Error('Not implemented!');
}
getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element> { getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element> {
throw new Error('Not implemented!'); throw new Error('Not implemented!');
} }
...@@ -302,6 +314,10 @@ export class MockElement extends MockNode implements Element { ...@@ -302,6 +314,10 @@ export class MockElement extends MockNode implements Element {
throw new Error('Not implemented!'); throw new Error('Not implemented!');
} }
matches(selector: string): boolean {
throw new Error('Not implemented!');
}
// interface NodeSelector // interface NodeSelector
querySelectorAll(selectors: string): NodeListOf<Element> { querySelectorAll(selectors: string): NodeListOf<Element> {
throw new Error('Not implemented!'); throw new Error('Not implemented!');
...@@ -750,7 +766,6 @@ class AttributeValueParser implements IParserState { ...@@ -750,7 +766,6 @@ class AttributeValueParser implements IParserState {
else { else {
return this.attribute; return this.attribute;
} }
break;
default: default:
if(this.quote === false) { if(this.quote === false) {
return new ErrorState('Expected " character'); return new ErrorState('Expected " character');
......
...@@ -266,8 +266,8 @@ suite('Flow', () => { ...@@ -266,8 +266,8 @@ suite('Flow', () => {
if (true) { if (true) {
throw new Error(""); throw new Error("");
} }
assertionCount++; // assertionCount++;
syncGet(null, this); // syncGet(null, this);
}, },
function handleThird(third) { function handleThird(third) {
...@@ -332,8 +332,8 @@ suite('Flow', () => { ...@@ -332,8 +332,8 @@ suite('Flow', () => {
if (true) { if (true) {
throw new Error(""); throw new Error("");
} }
assertionCount++; // assertionCount++;
asyncGet(null, this); // asyncGet(null, this);
}, },
function handleThird(third) { function handleThird(third) {
......
...@@ -93,6 +93,6 @@ function attr(target:HTMLElement, attrName:string, attrValue:string): void { ...@@ -93,6 +93,6 @@ function attr(target:HTMLElement, attrName:string, attrValue:string): void {
target.setAttribute(attrName, attrValue); target.setAttribute(attrName, attrValue);
} }
if (false) { //TODO@Debt // if (false) { //TODO@Debt
EditorBrowserRegistry.registerEditorContribution(WorkerStatusReporter); // EditorBrowserRegistry.registerEditorContribution(WorkerStatusReporter);
} // }
\ No newline at end of file \ No newline at end of file
...@@ -112,7 +112,6 @@ export class Parser { ...@@ -112,7 +112,6 @@ export class Parser {
this.token = this.scanner.scan(); this.token = this.scanner.scan();
} }
} }
return false;
} }
public createNode(nodeType:nodes.NodeType): nodes.Node { public createNode(nodeType:nodes.NodeType): nodes.Node {
......
...@@ -115,7 +115,7 @@ export interface NamedProblemMatcher extends ProblemMatcher { ...@@ -115,7 +115,7 @@ export interface NamedProblemMatcher extends ProblemMatcher {
} }
export function isNamedProblemMatcher(value: ProblemMatcher): value is NamedProblemMatcher { export function isNamedProblemMatcher(value: ProblemMatcher): value is NamedProblemMatcher {
return Types.isString((<NamedProblemMatcher>value).name); return Types.isString((<NamedProblemMatcher>value).name) ? true : false;
} }
let valueMap: { [key: string]: string; } = { let valueMap: { [key: string]: string; } = {
......
...@@ -162,7 +162,7 @@ function isRangeWithMessageArr(something: vscode.Range[]|vscode.DecorationOption ...@@ -162,7 +162,7 @@ function isRangeWithMessageArr(something: vscode.Range[]|vscode.DecorationOption
if (something.length === 0) { if (something.length === 0) {
return true; return true;
} }
return isRangeWithMessage(something[0]); return isRangeWithMessage(something[0]) ? true : false;
} }
export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.DecorationOptions[]): IRangeWithMessage[] { export function fromRangeOrRangeWithMessage(ranges:vscode.Range[]|vscode.DecorationOptions[]): IRangeWithMessage[] {
......
...@@ -34,7 +34,7 @@ export class ShowPerformanceBox extends Action { ...@@ -34,7 +34,7 @@ export class ShowPerformanceBox extends Action {
} }
} }
if (false /* Env.enablePerformanceTools */) { // if (false /* Env.enablePerformanceTools */) {
let registry = <IWorkbenchActionRegistry>Registry.as(Extensions.WorkbenchActions); // let registry = <IWorkbenchActionRegistry>Registry.as(Extensions.WorkbenchActions);
registry.registerWorkbenchAction(new SyncActionDescriptor(ShowPerformanceBox, ID, LABEL)); // registry.registerWorkbenchAction(new SyncActionDescriptor(ShowPerformanceBox, ID, LABEL));
} // }
\ No newline at end of file \ No newline at end of file
...@@ -380,7 +380,8 @@ export class TextFileService extends AbstractTextFileService { ...@@ -380,7 +380,8 @@ export class TextFileService extends AbstractTextFileService {
// - https://github.com/Microsoft/vscode/issues/451 // - https://github.com/Microsoft/vscode/issues/451
// - Bug on Windows: When "All Files" is picked, the path gets an extra ".*" // - Bug on Windows: When "All Files" is picked, the path gets an extra ".*"
// Until these issues are resolved, we disable the dialog file extension filtering. // Until these issues are resolved, we disable the dialog file extension filtering.
if (true) { let disable = true; // Simply using if (true) flags the code afterwards as not reachable.
if (disable) {
return options; return options;
} }
......
...@@ -665,7 +665,6 @@ class ConfigurationParser { ...@@ -665,7 +665,6 @@ class ConfigurationParser {
let json = <ProblemMatcherConfig.ProblemMatcher>value; let json = <ProblemMatcherConfig.ProblemMatcher>value;
return new ProblemMatcherParser(ProblemMatcherRegistry, this.logger, this.validationStatus).parse(json); return new ProblemMatcherParser(ProblemMatcherRegistry, this.logger, this.validationStatus).parse(json);
} }
return null;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册