Verify syntax error in js file are reported
This commit is contained in:
parent
7e30827ebe
commit
225235427a
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
6
tests/cases/compiler/jsFileCompilationSyntaxError.ts
Normal file
6
tests/cases/compiler/jsFileCompilationSyntaxError.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
// @filename: a.js
|
||||
/**
|
||||
* @type {number}
|
||||
* @type {string}
|
||||
*/
|
||||
var v;
|
Loading…
Reference in a new issue