Skip to content

Conversation

@marionebl
Copy link
Contributor

Hardens the structural typecheck performed in mapSourcePosition before executing originalPositionFor methods on sourceMap.map objects.

This addresses a bug I encountered with electron-updater while working on https://github.com/meetalva/alva/, where Promise values somehow end up in sourceMap.map, causing the app to crash with stack traces like this.

-/app.asar/node_modules/source-map-support/source-map-support.js:214
    var originalPosition = sourceMap.map.originalPositionFor(position);
                                         ^

TypeError: sourceMap.map.originalPositionFor is not a function
    at mapSourcePosition (-/app.asar/node_modules/source-map-support/source-map-support.js:214:42)
    at wrapCallSite (-/app.asar/node_modules/source-map-support/source-map-support.js:358:20)
    at -/app.asar/node_modules/source-map-support/source-map-support.js:395:26
    at Array.map (<anonymous>)
    at Function.prepareStackTrace (-/app.asar/node_modules/source-map-support/source-map-support.js:394:24)
    at process.emit (-/app.asar/node_modules/source-map-support/source-map-support.js:453:52)
    at process._fatalException (internal/bootstrap/node.js:488:27)

Unfortunately I don't know how this happens exactly. Debugging this proves rather hard due to the exception only being raised when starting the built electron-builder application.

@marionebl
Copy link
Contributor Author

Failing Travis jobs seem to be unrelated.

@LinusU
Copy link
Collaborator

LinusU commented Jan 11, 2019

Sorry for not getting back to you earlier, the Travis failure seems indeed unrelated, will try and fix it...

@LinusU
Copy link
Collaborator

LinusU commented Jan 11, 2019

Fixed, thanks for the PR!

@LinusU LinusU merged commit 3eb7541 into evanw:master Jan 11, 2019
@marionebl
Copy link
Contributor Author

Thank you!

@marionebl marionebl deleted the fix-harden-structural-typecheck branch January 11, 2019 17:15
@LinusU
Copy link
Collaborator

LinusU commented Jan 11, 2019

Published as v0.5.10 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants