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

Pr/118 parseStack respects windows paths #268

Merged
merged 8 commits into from Feb 8, 2017
Merged

Pr/118 parseStack respects windows paths #268

merged 8 commits into from Feb 8, 2017

Conversation

MaxBittker
Copy link
Contributor

@MaxBittker MaxBittker commented Feb 7, 2017

I tested this on windows and osx and everything seems to be working correctly! thank you @stambata and @seanbriceland original PR: #118

@MaxBittker MaxBittker changed the title Pr/118 Pr/118 parseStack respects windows paths Feb 8, 2017
@MaxBittker MaxBittker mentioned this pull request Feb 8, 2017
frame.context_line.should.be.type('string');
frame.context_line.trim().should.endWith('undeclared_function();');
frame.post_context.should.be.an.instanceOf(Array);
done();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an assertion here on what frame.in_app should be, and add a comment to the effect of part 4 of this comment explaining what's going on in this test? It's not initially obvious that this tests anything not existing before this PR.

stambata and others added 8 commits February 8, 2017 11:42
Please consider the proposed change.The source code of the non-native stacktrace lines was never fetched on Windows machines. That's because isInternal was always resolving to true no matter what:

```js

isInternal = line.isNative() || (frame.filename[0] !== '/' && frame.filename[0] !== '.'); 

```

I added 2 small modifications:
1) the hardcoded separator ('/') has been replaced with path.sep (please refer to: https://nodejs.org/api/path.html#path_path_sep). That way the check is valid for all platforms: '/' for linux and '\\' for windows
2) an extra check has been added: frame.filename.indexOf(':\\') != 1
That way absolute paths on windows are considered non-native.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants