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

Fixed compile errors caused by 1.8.0

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