forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chakrashim: bug fixes for Error APIs
1. We parse error stack in chakra_shim to make it simliar to that of v8. However we were missing the case if stack messages has `\n`. Fixed it. Fixes: nodejs#78 2. Fixed Error.captureStackTrace Since `chakra_shim.js` that patches `Error.captureStackTrace` runs under strict mode, it was not able to get caller information. Having caller information is much reliable in captureStackTrace than matching using `function.name`. Removed `use strict` and disabled eslint rule for `use strict`. This helped in matching caller exactly regardless of name of form `o.p.q` in `Error.captureStackTrace`. Fixes: nodejs#75 3. Added missing functions on StackFrame Added following missing methods on StackFrame: * getFunction * getMethodName * getTypeName * isConstructor * isToplevel * isNative Implemented `getFunction`. `getFunction` currently works if `.stack` is called from same callsite where `new Error()` or `Error.captureStackTrace()` was called. However currently we don't record and store the callstack when these functions were called and so we lose the information of `.caller` when called later while populating `e.stack`. If we save the callstack, we would be holding references to all the functions in the callstack which doesn't seem right. I have added a TODO to solve this, but wanted to send this out so we get better coverage on node compatibility. Fixes : nodejs#70 PR-URL: nodejs/node-chakracore#85 Reviewed-By: Jianchun Xu <[email protected]>
- Loading branch information
1 parent
fa65467
commit 32b85f9
Showing
1 changed file
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters