René's URL Explorer Experiment


Title: Fix method for getting function name for stack frames · Issue #40 · cspotcode/node-source-map-support · GitHub

Open Graph Title: Fix method for getting function name for stack frames · Issue #40 · cspotcode/node-source-map-support

X Title: Fix method for getting function name for stack frames · Issue #40 · cspotcode/node-source-map-support

Description: From jestjs/jest#12786 (comment) // hubba.test.js function BadCode() { throw new Error('noo'); } function run(fn) { fn(); } run(BadCode); compiled to: "use strict"; function BadCode() { throw new Error('noo'); } function run(fn) { fn(); ...

Open Graph Description: From jestjs/jest#12786 (comment) // hubba.test.js function BadCode() { throw new Error('noo'); } function run(fn) { fn(); } run(BadCode); compiled to: "use strict"; function BadCode() { throw new E...

X Description: From jestjs/jest#12786 (comment) // hubba.test.js function BadCode() { throw new Error('noo'); } function run(fn) { fn(); } run(BadCode); compiled to: "use strict"; function BadCo...

Opengraph URL: https://github.com/cspotcode/node-source-map-support/issues/40

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix method for getting function name for stack frames","articleBody":"From https://github.com/facebook/jest/pull/12786#issuecomment-1114869813\r\n\r\n```\r\n// hubba.test.js\r\nfunction BadCode() {\r\n  throw new Error('noo');\r\n}\r\n\r\nfunction run(fn) {\r\n  fn();\r\n}\r\n\r\nrun(BadCode);\r\n```\r\ncompiled to:\r\n```\r\n\"use strict\";\r\n\r\nfunction BadCode() {\r\n  throw new Error('noo');\r\n}\r\n\r\nfunction run(fn) {\r\n  fn();\r\n}\r\n\r\nrun(BadCode);\r\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJCYWRDb2RlIiwiRXJyb3IiLCJydW4iLCJmbiJdLCJzb3VyY2VzIjpbImh1YmJhLnRlc3QuanMiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gQmFkQ29kZSgpIHtcbiAgdGhyb3cgbmV3IEVycm9yKCdub28nKTtcbn1cblxuZnVuY3Rpb24gcnVuKGZuKSB7XG4gIGZuKCk7XG59XG5cbnJ1bihCYWRDb2RlKTtcbiJdLCJtYXBwaW5ncyI6Ijs7QUFBQSxTQUFTQSxPQUFULEdBQW1CO0VBQ2pCLE1BQU0sSUFBSUMsS0FBSixDQUFVLEtBQVYsQ0FBTjtBQUNEOztBQUVELFNBQVNDLEdBQVQsQ0FBYUMsRUFBYixFQUFpQjtFQUNmQSxFQUFFO0FBQ0g7O0FBRURELEdBQUcsQ0FBQ0YsT0FBRCxDQUFIIn0=\r\n```\r\n\r\nStack trace with source-mapping is wrong:\r\n```\r\nError: noo\r\n    at fn (/Users/simen/repos/jest/hubba.test.js:2:9) \u003c----- this stack frame should say `BadCode`\r\n    at run (/Users/simen/repos/jest/hubba.test.js:6:3)\r\n    at Object.\u003canonymous> (/Users/simen/repos/jest/hubba.test.js:9:1)\r\n```\r\n\r\nsource-map-support's algorithm for getting the name of a stack frame: it checks the location of the *next* stack frame.  That is why the bug is showing us `at fn` when it should be showing us `at BadCode`.  The stack frame happens within `BadCode`, but the location of the *next* stack frame is the invocation site: `fn()`\r\n\r\nWe would see the same issue with the second stack frame if we did `const runIt = run; runIt(BadCode)`  Because it's checking the name at the callsite, it's not checking the invokee's name.\r\n\r\nPretty sure this is not correct and stack frames actually expose additional information we can use to get the correct answer.\r\n\r\nIn addition to `frame.getLineNumber()` and `frame.getColumnNumber()`, we have `frame.getEnclosingLineNumber()` and `frame.getEnclosingColumnNumber()` which are the location of the invoked function.  For example:\r\n\r\n```\r\n// getEnclosing*Number() gives us location A\r\n// get*Number() gives us location B\r\n/*A*/function run() {}\r\n/*B*/run()\r\n```\r\n","author":{"url":"https://github.com/cspotcode","@type":"Person","name":"cspotcode"},"datePublished":"2022-05-02T18:09:12Z","url":"https://github.com/cspotcode/node-source-map-support/issues/40"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:82720273-0251-086e-a43f-878f0d33e2b9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD6C:D16D6:1217912:18E0EEE:6AFB719F
html-safe-nonce8a9dd6d17014c63c8ad5fb8b804cd94a45f4d284abad82bd9927443c898a634a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDZDOkQxNkQ2OjEyMTc5MTI6MThFMEVFRTo2QUZCNzE5RiIsInZpc2l0b3JfaWQiOiIzNDg3Njg4NDM1OTk5NDA0NDQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2a4e1333ac5a38df68542badcc9ea51477d9f983c72150ea807b0f1b4e81b495
hovercard-subject-tagissue:1223183150
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cspotcode/node-source-map-support/40/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1f61015ff32f46f9fd8c2d8a02c80360611515413a4efdf3b5118b719edefad7/cspotcode/node-source-map-support/issues/40
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1f61015ff32f46f9fd8c2d8a02c80360611515413a4efdf3b5118b719edefad7/cspotcode/node-source-map-support/issues/40
og:image:altFrom jestjs/jest#12786 (comment) // hubba.test.js function BadCode() { throw new Error('noo'); } function run(fn) { fn(); } run(BadCode); compiled to: "use strict"; function BadCode() { throw new E...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecspotcode
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
turbo-cache-controlno-preview
go-importgithub.com/cspotcode/node-source-map-support git https://github.com/cspotcode/node-source-map-support.git
octolytics-dimension-user_id376504
octolytics-dimension-user_logincspotcode
octolytics-dimension-repository_id310942201
octolytics-dimension-repository_nwocspotcode/node-source-map-support
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id310942201
octolytics-dimension-repository_network_root_nwocspotcode/node-source-map-support
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/cspotcode/node-source-map-support/issues/40#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcspotcode%2Fnode-source-map-support%2Fissues%2F40
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcspotcode%2Fnode-source-map-support%2Fissues%2F40
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cspotcode%2Fnode-source-map-support
Reloadhttps://github.com/cspotcode/node-source-map-support/issues/40
Reloadhttps://github.com/cspotcode/node-source-map-support/issues/40
Reloadhttps://github.com/cspotcode/node-source-map-support/issues/40
cspotcodehttps://github.com/cspotcode
node-source-map-supporthttps://github.com/cspotcode/node-source-map-support
Codehttps://github.com/cspotcode/node-source-map-support
Issues12 (12)https://github.com/cspotcode/node-source-map-support/issues
Pull requests2 (2)https://github.com/cspotcode/node-source-map-support/pulls
Actionshttps://github.com/cspotcode/node-source-map-support/actions
Projectshttps://github.com/cspotcode/node-source-map-support/projects
Security and qualityhttps://github.com/cspotcode/node-source-map-support/security
Insightshttps://github.com/cspotcode/node-source-map-support/pulse
https://github.com/cspotcode/node-source-map-support
New issuehttps://github.com/login?return_to=https://github.com/cspotcode/node-source-map-support/issues/40
New issuehttps://github.com/login?return_to=https://github.com/cspotcode/node-source-map-support/issues/40
#41https://github.com/cspotcode/node-source-map-support/pull/41
Fix method for getting function name for stack frameshttps://github.com/cspotcode/node-source-map-support/issues/40#top
#41https://github.com/cspotcode/node-source-map-support/pull/41
https://github.com/cspotcode
cspotcodehttps://github.com/cspotcode
on May 2, 2022https://github.com/cspotcode/node-source-map-support/issues/40#issue-1223183150
jestjs/jest#12786 (comment)https://github.com/jestjs/jest/pull/12786#issuecomment-1114869813
https://github.com/cspotcode
cspotcodehttps://github.com/cspotcode
on May 8, 2022https://github.com/cspotcode/node-source-map-support/issues/40#issuecomment-1120470947
jestjs/jest#12786 (comment)https://github.com/jestjs/jest/pull/12786#issuecomment-1120470852
Sign up for freehttps://github.com/signup?return_to=https://github.com/cspotcode/node-source-map-support/issues/40
Sign in to commenthttps://github.com/login?return_to=https://github.com/cspotcode/node-source-map-support/issues/40
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.