Verify syntax error in js file are reported

This commit is contained in:
Sheetal Nandi 2015-09-10 14:25:44 -07:00
parent 7e30827ebe
commit 225235427a
3 changed files with 23 additions and 1 deletions

View file

@ -173,7 +173,9 @@ module Utils {
ts.forEachChild(node, child => { childNodesAndArrays.push(child); }, array => { childNodesAndArrays.push(array); });
for (let childName in node) {
if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator") {
if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator" ||
// for now ignore jsdoc comments
childName === "jsDocComment") {
continue;
}
let child = (<any>node)[childName];

View file

@ -0,0 +1,14 @@
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
tests/cases/compiler/a.js(3,6): error TS1223: 'type' tag already specified.
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
==== tests/cases/compiler/a.js (1 errors) ====
/**
* @type {number}
* @type {string}
~~~~
!!! error TS1223: 'type' tag already specified.
*/
var v;

View file

@ -0,0 +1,6 @@
// @filename: a.js
/**
* @type {number}
* @type {string}
*/
var v;