Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: Fix Error.captureStackTrace
Browse files Browse the repository at this point in the history
Error.captureStackTrace did not convert the type of line and column
numbers to numbers while creating the v8 capture objects. This breaks
modules which assumes number types. Changed to call parseInt if line
and column numbers are defined

PR-URL: #483
Reviewed-By: Kyle Farnung <[email protected]>
Reviewed-By: Jimmy Thomson <[email protected]>
  • Loading branch information
digitalinfinity authored and kfarnung committed Mar 8, 2018
1 parent 1fc7fe3 commit cd48200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/chakrashim/lib/chakra_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
const fileDetails = stackDetails[2].split(fileDetailsSplitter);

const fileName = fileDetails[0];
const lineNumber = fileDetails[1] ? fileDetails[1] : 0;
const columnNumber = fileDetails[3] ? fileDetails[3] : 0;
const lineNumber = fileDetails[1] ? parseInt(fileDetails[1]) : 0;
const columnNumber = fileDetails[3] ? parseInt(fileDetails[3]) : 0;

errstack.push(new StackFrame(func, funcName, fileName, lineNumber,
columnNumber));
Expand Down

0 comments on commit cd48200

Please sign in to comment.