Add null check and CR feedback

This commit is contained in:
zhengbli
2016-06-02 11:12:38 -07:00
parent 0e96c5eaf1
commit d41ac8aa9a

View File

@@ -441,14 +441,14 @@ namespace ts {
/* @internal */
export function parseIsolatedJSDocComment(content: string, start?: number, length?: number) {
const result = Parser.JSDocParser.parseIsolatedJSDocComment(content, start, length);
if (result.jsDocComment) {
if (result && result.jsDocComment) {
// because the jsDocComment was parsed out of the source file, it might
// not be covered by the fixupParentReferences.
let parentNode: Node = result.jsDocComment;
forEachChild(result.jsDocComment, visitNode);
function visitNode(n: Node): void {
if (n.parent !== parentNode) {
if (n.parent === undefined) {
n.parent = parentNode;
const saveParent = parentNode;