Skip to content

Commit

Permalink
feat: add support for TS 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb authored and tbosch committed Apr 18, 2017
1 parent 3c8a61e commit 014594f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/language-service/src/typescript_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export class TypeScriptServiceHost implements LanguageServiceHost {

let sourceFile = this.getSourceFile(fileName);
if (sourceFile) {
this.context = sourceFile.path;
this.context = (sourceFile as any).path || sourceFile.fileName;
ts.forEachChild(sourceFile, visit);
}
return result.length ? result : undefined;
Expand Down
24 changes: 12 additions & 12 deletions packages/platform-webworker/src/web_workers/shared/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ import {Injectable, RenderComponentType, RendererType2, Type, ɵstringify as str
import {RenderStore} from './render_store';


/**
* @experimental WebWorker support in Angular is currently experimental.
*/
export const enum SerializerTypes {
// RendererType2
RENDERER_TYPE_2,
// Primitive types
PRIMITIVE,
// An object stored in a RenderStore
RENDER_STORE_OBJECT,
}

/**
* Any type that does not need to be serialized (string, number, boolean)
*
Expand All @@ -25,18 +37,6 @@ export class LocationType {
public origin: string) {}
}

/**
* @experimental WebWorker support in Angular is currently experimental.
*/
export const enum SerializerTypes {
// RendererType2
RENDERER_TYPE_2,
// Primitive types
PRIMITIVE,
// An object stored in a RenderStore
RENDER_STORE_OBJECT,
}

@Injectable()
export class Serializer {
constructor(private _renderStore: RenderStore) {}
Expand Down
2 changes: 1 addition & 1 deletion tools/@angular/tsc-wrapped/src/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Symbols {
// in the parent chain). This doesn't damage the node as the binder unconditionally
// sets the parent.
externalReference.expression.parent = externalReference;
externalReference.parent = this.sourceFile;
externalReference.parent = this.sourceFile as any;
}
const from = stripQuotes(externalReference.expression.getText());
symbols.set(importEqualsDeclaration.name.text, {__symbolic: 'reference', module: from});
Expand Down
3 changes: 3 additions & 0 deletions tools/@angular/tsc-wrapped/test/typescript.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class MockNode implements ts.Node {
getText(sourceFile?: ts.SourceFile): string { return ''; }
getFirstToken(sourceFile?: ts.SourceFile): ts.Node { return null; }
getLastToken(sourceFile?: ts.SourceFile): ts.Node { return null; }
forEachChild<T>(cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T): T {
return null;
}
}

export class MockIdentifier extends MockNode implements ts.Identifier {
Expand Down

0 comments on commit 014594f

Please sign in to comment.