Title: Parentheses in node file paths are filtered out · Issue #62 · stacktracejs/error-stack-parser · GitHub
Open Graph Title: Parentheses in node file paths are filtered out · Issue #62 · stacktracejs/error-stack-parser
X Title: Parentheses in node file paths are filtered out · Issue #62 · stacktracejs/error-stack-parser
Description: Expected Behavior When parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's fileName. e.g. path/to/my (top secret) project/fil...
Open Graph Description: Expected Behavior When parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's fileName. ...
X Description: Expected Behavior When parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's fileNa...
Opengraph URL: https://github.com/stacktracejs/error-stack-parser/issues/62
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Parentheses in node file paths are filtered out","articleBody":"## Expected Behavior\r\n\r\nWhen parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's `fileName`.\r\n\r\ne.g. \r\n\r\n path/to/my (top secret) project/file.js\r\nremains as\r\n\r\n path/to/my (top secret) project/file.js\r\n\r\n## Current Behavior\r\n\r\nParentheses are stripped out of the path.\r\n\r\ne.g. \r\n\r\n path/to/my (top secret) project/file.js\r\nbecomes\r\n\r\n path/to/my top secret project/file.js`\r\n\r\n## Steps to Reproduce (for bugs)\r\n\r\nI wrote a failing test for it that reproduces the problem, in a branch which you can see [here](https://github.com/stacktracejs/error-stack-parser/compare/master...mattwynne:allow-parens-in-node-filename?expand=1).\r\n\r\n## Context\r\n\r\nThis has caused us some problems running Cucumber-JS's own tests if the developer's environment has parens in the path. See https://github.com/cucumber/cucumber-js/issues/1735\r\n\r\n## Your Environment\r\n* stacktrace.js version: [v2.0.2](https://github.com/cucumber/cucumber-js/blob/main/package.json#L196)\r\n* Browser Name and version: n/a\r\n* Operating System and version (desktop or mobile): OSX 11.4\r\n\r\n## Possible Solution\r\n\r\nIf you want to submit a PR with a fix for this, you'll need to start by forking this repo. If you install the [`gh`](https://github.com/cli/cli) command-line tool, you can do that with:\r\n\r\n $ gh repo fork stacktracejs/error-stack-parser\r\n\r\nThat should hopefully fork the repo to your GitHub account and then create a local clone of it.\r\n\r\nIn the new directory of the local clone, you can then create a branch, and pull in my commit with the failing test:\r\n\r\n $ git checkout -b allow-parens-in-node-filename\r\n $ git pull git@github.com:mattwynne/error-stack-parser.git allow-parens-in-node-filename\r\n\r\nTry running the tests, and you should see one failing:\r\n\r\n npm install\r\n npm test\r\n\r\n```\r\nnpm test\r\n\r\n\u003e error-stack-parser@2.0.6 test\r\n\u003e karma start karma.conf.js --single-run\r\n\r\n19 07 2021 14:32:05.968:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/\r\n19 07 2021 14:32:05.971:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited\r\n19 07 2021 14:32:05.975:INFO [launcher]: Starting browser PhantomJS\r\n19 07 2021 14:32:07.389:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket S7DEMBo_p_scyXL8AAAA with id 77822057\r\nPhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR LOG: 'DEPRECATION:', 'Setting specFilter directly on Env is deprecated and will be removed in a future version of Jasmine, please use the specFilter option in `configure`'\r\n\r\n ErrorStackParser\r\n #parse\r\n ✓ should parse Safari 7 Error.stack\r\n ✓ should parse Safari 8 Error.stack\r\n ✓ should parse nested eval() from Safari 9\r\n ✓ should parse Firefox 31 Error.stack\r\n ✓ should parse nested eval() from Firefox 43\r\n ✓ should parse function names containing @ in Firefox 43 Error.stack\r\n ✓ should parse IE 10 Error stacks\r\n ✓ should parse Opera 11 Error messages\r\n ✓ should parse IE 11 Error stacks\r\n ✓ should parse stack traces with @ in the URL\r\n ✓ should parse Opera 25 Error stacks\r\n ✓ should parse stack traces with @ in the URL and the method\r\n ✓ should parse Opera 9.27 Error messages\r\n ✓ should parse Safari 6 Error.stack\r\n ✓ should not parse IE 9 Error\r\n ✓ should handle webpack eval stacks\r\n ✓ should handle spaces in Node.js stacks\r\n ✓ should parse nested eval() from Edge\r\n ✓ should handle newlines in Error stack messages\r\n ✓ should parse Opera 10 Error messages\r\n ✗ should handle parentheses in Node.js stacks\r\n\tExpected '/var/app/scratch/my project top secret/index.js' to equal '/var/app/scratch/my project (top secret)/index.js'.\r\n\t\u003cJasmine\u003e\r\n\tspec/error-stack-parser-spec.js:237:52\r\n\t\u003cJasmine\u003e\r\n\r\n ✓ should parse V8 Error.stack\r\n ✓ should parse error stacks with Constructors\r\n ✓ should parse V8 entries with no location\r\n ✓ should parse V8 Error.stack entries with port numbers\r\n ✓ should parse nested eval() from V8\r\n\r\nPhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 26 of 26 (1 FAILED) (0.35 secs / 0.313 secs)\r\nTOTAL: 1 FAILED, 25 SUCCESS\r\n\r\n\r\n1) should handle parentheses in Node.js stacks\r\n ErrorStackParser #parse\r\n Expected '/var/app/scratch/my project top secret/index.js' to equal '/var/app/scratch/my project (top secret)/index.js'.\r\n\u003cJasmine\u003e\r\nspec/error-stack-parser-spec.js:237:52\r\n\u003cJasmine\u003e\r\n```\r\n\r\nNow you just need to fiddle with the code until that test passes :)","author":{"url":"https://github.com/mattwynne","@type":"Person","name":"mattwynne"},"datePublished":"2021-07-19T21:39:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/62/error-stack-parser/issues/62"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:78477af6-a769-d15f-3787-ea856e9f0cb8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B672:3FD06A:1012D3B:164CDA3:696F3C99 |
| html-safe-nonce | 875e439b5e5bf12a4b44a16b2ff9e9672d1b279d4f2b4aacc6249ce972b1645e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjcyOjNGRDA2QToxMDEyRDNCOjE2NENEQTM6Njk2RjNDOTkiLCJ2aXNpdG9yX2lkIjoiNjMzODAzNzE4MTI0NjgxNTM4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c2028875330b268e1a10c6011a92a35bd725abaa46b739618d2f6b86eeeeb933 |
| hovercard-subject-tag | issue:948049733 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stacktracejs/error-stack-parser/62/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3921d53e824d8549641d5f09362114afdd3b56e4b5d5ce213caf8f4f75e9c38/stacktracejs/error-stack-parser/issues/62 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3921d53e824d8549641d5f09362114afdd3b56e4b5d5ce213caf8f4f75e9c38/stacktracejs/error-stack-parser/issues/62 |
| og:image:alt | Expected Behavior When parsing the stack for a file that happens to have parentheses in its name, I expected those parentheses to still be there when I got the parsed StackFrame object's fileName. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mattwynne |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/stacktracejs/error-stack-parser git https://github.com/stacktracejs/error-stack-parser.git |
| octolytics-dimension-user_id | 6131251 |
| octolytics-dimension-user_login | stacktracejs |
| octolytics-dimension-repository_id | 15014773 |
| octolytics-dimension-repository_nwo | stacktracejs/error-stack-parser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 15014773 |
| octolytics-dimension-repository_network_root_nwo | stacktracejs/error-stack-parser |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width