Skip to content

Commit 69dc96d

Browse files
committed
handle hidden lines
1 parent a3d5bae commit 69dc96d

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎v4-cokapi/backends/javascript/jslogger.js‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ Debug.DebugEvent = { Break: 1,
7474
7575
TypeScript TODOs:
7676
77-
- stuff with inheritance and auto-generated code have no corresponding
78-
lines in the .ts file, so maybe the conservative thing to do is to
79-
*SKIP* those steps, since we have nothing sensible to render for them
80-
anyhow? e.g., see demo2.ts Inheritance example from
81-
http://www.typescriptlang.org/Playground)
82-
8377
- display more than one error in the trace when there's a TypeScript
8478
compiler error. right now we display only the first error for simplicity.
8579
80+
- add regression tests
81+
8682
*/
8783

8884

@@ -584,6 +580,16 @@ function listener(event, execState, eventData, data) {
584580
//log('TS:', tsPos.line, tsPos.column);
585581
line = tsPos.line;
586582
col = tsPos.column;
583+
584+
// TypeScript features that lead to auto-generated hidden JS code
585+
// (e.g., inheritance) leave no corresponding lines in the .ts file,
586+
// so the conservative thing to do is to *SKIP* those steps, since we
587+
// have nothing sensible to render for them anyhow
588+
if (line === null || line === undefined) {
589+
assert(stepType !== undefined);
590+
execState.prepareStep(stepType); // set debugger to stop at next step
591+
return; // get outta here early!
592+
}
587593
}
588594

589595
curTraceEntry.line = line;

0 commit comments

Comments
 (0)