This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28505 - Synchronous XHR removal makes patching Error.prepareStackTrace impossible
Summary: Synchronous XHR removal makes patching Error.prepareStackTrace impossible
Status: RESOLVED INVALID
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-17 16:58 UTC by Evan Wallace
Modified: 2016-08-12 08:47 UTC (History)
4 users (show)

See Also:
annevk: needinfo? (evan.exe)


Attachments

Description Evan Wallace 2015-04-17 16:58:18 UTC
I've got a library that fixes Error.prototype.stack in V8 to work with source maps because Google refuses to fix this themselves (http://crbug.com/376409). However, it's recently come to my attention (https://github.com/evanw/node-source-map-support/issues/49) that this is about to break due to removal of synchronous XHR (https://xhr.spec.whatwg.org/#sync-warning).

Because of the way the API Error.prepareStackTrace API works, I need to fetch the source map before returning from the callback. I can't know what the URLs will be ahead of time and fetch them because 1) errors may happen before the source map download completes and 2) new code with the "//# sourceMappingURL" pragma can be created with eval at any time.

I understand the goals of removing synchronous XHR but my library legitimately needs this feature. Breaking this feature will greatly harm debugging for languages that are cross-compiled to JavaScript. The slowness of synchronous XHR doesn't matter here because it's just for debugging, not for production environments.

What are people's thoughts on this? Is there maybe some way to add a way in the spec to still allow synchronous XHR in certain circumstances?
Comment 1 Simon Pieters 2015-04-20 11:38:00 UTC
Is it not better to fix the bug in V8?

The bug you point to is marked as fixed. Can you file a new issue with the remaining bug(s) and make it block https://code.google.com/p/chromium/issues/detail?id=392311 ?
Comment 2 Anne 2016-08-12 08:47:26 UTC
If this continuous to be a problem, please contribute to this thread on GitHub: https://github.com/whatwg/xhr/issues/20

Thanks!