diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6d23bd51c17..e75b195d776 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -9,9 +9,9 @@ module ts { export function getNodeConstructor(kind: SyntaxKind): new () => Node { return nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)); } - + export function createNode(kind: SyntaxKind): Node { - return new (getNodeConstructor(kind))(); + return new (getNodeConstructor(kind))(); } // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes @@ -286,11 +286,11 @@ module ts { } text = ""; } - + return text !== undefined ? createSourceFile(filename, text, languageVersion) : undefined; } - function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) { + function writeFile(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void) { function directoryExists(directoryPath: string): boolean { if (hasProperty(existingDirectories, directoryPath)) { return true; @@ -400,7 +400,7 @@ module ts { } return 0; } - + function fixupParentReferences(sourceFile: SourceFile) { // normally parent references are set during binding. // however here SourceFile data is used only for syntactic features so running the whole binding process is an overhead. @@ -422,7 +422,7 @@ module ts { forEachChild(sourceFile, walk); } - + function isEvalOrArgumentsIdentifier(node: Node): boolean { return node.kind === SyntaxKind.Identifier && ((node).text === "eval" || (node).text === "arguments"); @@ -434,8 +434,8 @@ module ts { var nodeText = getSourceTextOfNodeFromSourceFile(sourceFile,(node).expression); return nodeText === '"use strict"' || nodeText === "'use strict'"; } - - export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile { + + export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile { var parsingContext: ParsingContext; var identifiers: Map = {}; var identifierCount = 0; diff --git a/src/harness/test262Runner.ts b/src/harness/test262Runner.ts index b53011237b7..8c39880a81c 100644 --- a/src/harness/test262Runner.ts +++ b/src/harness/test262Runner.ts @@ -68,6 +68,7 @@ class Test262BaselineRunner extends RunnerBase { function serializeNode(n: ts.Node): any { var o: any = { kind: getKindName(n.kind) }; + o.containsParseError = ts.containsParseError(n); ts.forEach(Object.getOwnPropertyNames(n), propertyName => { switch (propertyName) {