Skip to content

Commit

Permalink
Merge pull request #766 from null-a/error-handling-in-imh
Browse files Browse the repository at this point in the history
Make error handling work with caching transform.
  • Loading branch information
stuhlmueller committed Jan 20, 2017
2 parents 294990b + 87aa47c commit bffdd1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/errors/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function addressToWpplCallStack(address, addressMap) {
var stack = addressToStack(address);
return _.chain(stack).map(function(id) {
var loc = addressMap[id];
return loc && {
return loc && loc.start && {
fileName: loc.source,
lineNumber: loc.start.line,
columnNumber: loc.start.column,
Expand Down
9 changes: 9 additions & 0 deletions tests/test-stack-trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ var testDefs = [
{line: 11, col: 9, name: 'f'},
{line: 10, col: 0, name: 'Enumerate'}],
debug: true
},

{ name: 'with caching transform',
code: ["Infer({method: 'incrementalMH',",
' model: function() {',
' assert.ok(false);',
'}});'].join('\n'),
stack: [{line: 3, col: 9, name: 'ok'}],
debug: true
}
];

Expand Down

0 comments on commit bffdd1b

Please sign in to comment.