Skip to content

Commit 2252354

Browse files
committed
Verify syntax error in js file are reported
1 parent 7e30827 commit 2252354

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/harness/harness.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ module Utils {
173173
ts.forEachChild(node, child => { childNodesAndArrays.push(child); }, array => { childNodesAndArrays.push(array); });
174174

175175
for (let childName in node) {
176-
if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator") {
176+
if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator" ||
177+
// for now ignore jsdoc comments
178+
childName === "jsDocComment") {
177179
continue;
178180
}
179181
let child = (<any>node)[childName];
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
2+
tests/cases/compiler/a.js(3,6): error TS1223: 'type' tag already specified.
3+
4+
5+
!!! error TS5054: Could not write file 'tests/cases/compiler/a.js' which is one of the input files.
6+
==== tests/cases/compiler/a.js (1 errors) ====
7+
/**
8+
* @type {number}
9+
* @type {string}
10+
~~~~
11+
!!! error TS1223: 'type' tag already specified.
12+
*/
13+
var v;
14+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @filename: a.js
2+
/**
3+
* @type {number}
4+
* @type {string}
5+
*/
6+
var v;

0 commit comments

Comments
 (0)