Commit Graph

67 Commits

Author SHA1 Message Date
Pablo Alonso Garcia
d722c97762 swallow SJAX errors during in-browser translation 2016-12-14 13:50:53 +01:00
Ben McCurdy
49c3cb3767 Fix toString shim 2016-10-17 20:10:34 -07:00
kpdecker
80ee6aadd7 Use global hook flag rather than module local 2016-10-09 18:12:41 -05:00
kpdecker
ca0038978f Include source url for inline maps
This fixes relative url mapping for inline source maps.
2016-10-09 18:12:41 -05:00
kpdecker
2369eea005 Add support for runtime inline source maps
Adds the hookRequire option which monkey patches _compile to support require extension hooks that use inline source maps. This is necessary because the default retrieveFile implementations point to the original source file when doing runtime transpilation and thus don’t have the source map attached.
2016-10-09 18:12:41 -05:00
Linus Unnebäck
7b73305cb2 Merge pull request #124 from tomhughes/source-map-update
Source map update
2016-09-29 11:14:25 +02:00
Bazyli Brzóska
f6427b9ec7 Use 'node' version when using Electron with nodeIntegration enabled 2016-07-04 09:45:04 +02:00
Merott Movahedi
91c828e375 return native code CallSite as is 2016-04-05 21:08:10 +01:00
Tom Hughes
ae2d81b21f Coerce line numbers to numbers 2016-01-24 10:56:32 +00:00
kpdecker
b40cc2539e Allow for multiple install calls
This allows for multiple libraries to utilize this without stepping on each other’s toes.

This makes the retrieve helpers additive, giving priority to the last retrieve method registered. In the event of a miss, the next method is called up to and including the default behavior. The `overrideRetriveFile` and `overrideRetrieveSourceMap` flags are added if this behavior is not desired but this is something that most libraries should avoid to be good citizens.

Flagged behaviors will now be on if any of the install calls dictate that they would be.

Fix for #91
2015-10-30 13:36:14 -05:00
mads
3c344dc996 Support for forcing the mode (auto, browser or node) (fix #102) 2015-10-22 18:33:55 +02:00
Melvin Groenhoff
976b50fa65 Change RegExp to be less greedy (Fixes #87). 2015-07-27 17:06:00 +02:00
Linus Unnebäck
93a7c8a22e check for process object 2015-06-22 11:09:42 +02:00
Linus Unnebäck
d557e580f6 mimic node more closely 2015-06-17 13:19:57 +02:00
Linus Unnebäck
b6a96e067e support charset in data url 2015-06-17 13:14:41 +02:00
Julien Fontanet
21036a2e67 Fix lines on Node (fix #70). 2015-06-02 15:53:30 +02:00
Phips Peter
a97856ae4a Adding path cleaning
For some reason, some files will have a trailing new line for their
name. This code cleans up the path to no longer have the trailing space.
2015-05-29 00:07:39 -07:00
Julien Fontanet
ce68c4af2d Merge pull request #56 from timoxley/response-code
Check for 200 response code.
2015-05-27 10:58:38 +02:00
Julien Fontanet
00cba1988f Better fix for #36 (thanks @pspeter3). 2015-05-26 10:38:10 +02:00
Joe Esposito
49d64e7753 Remove leading newline from getErrorSource. 2015-05-23 14:21:45 -04:00
Joshua Ma
677fba8e8e Remove extraneous utf-8 argument to retrieveFile 2015-05-18 11:07:55 -07:00
Martin Probst
b3fd2b9353 fix: find the *last* sourceMappingURL in the source document.
This fixes odd behaviour for source files that contain the literal string
'//# sourceMappingURL=' somewhere in the actual source code.
2015-05-18 17:33:50 +02:00
Marco Minetti
d85089bea0 Merge pull request #58 from marcominetti/fix/57
Fixed sourcemap url detection.
2015-05-15 14:32:38 +02:00
Marco Minetti
0020b8c1b4 Fixed sourcemap url detection. 2015-05-15 14:29:08 +02:00
Julien Fontanet
62046eb482 Merge pull request #37 from moonpyk/master
Making use of console.error
2015-05-15 11:24:32 +02:00
Julien Fontanet
6056457014 Explainatory comment. 2015-05-15 10:54:22 +02:00
Tim Oxley
fcac27c283 Check for 200 response code.
Without this check, missing sourcemaps cause the package to continue as
if the 404 message is the sourcemap, leading to crashes when responses
like "Not Found" cannot be parsed as source maps.
2015-05-13 16:43:56 +08:00
Julien Fontanet
07f5f5937b Very basic fix for #36. 2015-04-07 16:56:19 +02:00
Lois Desplat
50fe13d63d Check XMLHttpRequest is a function for isInBrowser 2015-02-28 20:31:59 -08:00
Vlad GURDIGA
af37071383 Handle missing source maps
mapSourcePosition() will try to load the compiled script’s text and
extract its source map. When the source map is found, the module will
cache it, but when the script just doesn’t have any source map at all,
the module doesn’t remember that, and will load the script text again at
every subsequent call.
2015-02-24 17:42:16 +02:00
Clément Bourgeois
c4435f6b5c Making use of console.error
NodeJS outputs errors to stderr. Making use of console.error(...) instead of console.log(...) makes node-source-map-support compatible with IDEs like Webstorm to get stack traces.
2014-11-03 19:39:43 +01:00
Evan Wallace
3b154ff43e work around a new V8 change breaking stuff by manually forwarding relevant member functions in the CallSite wrapper instead of using the prototype chain and by copy/pasting the toString() CallSite implementation (fixes #35) 2014-10-22 01:09:11 -07:00
Evan Wallace
636b1b28e4 version bump and build for npm, also test for SourceMap HTTP header 2014-07-03 08:41:06 -07:00
Jamie Wong
a9ceaf67c3 Support specifying sourcemap via HTTP headers
As noted in
https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit,
the URL for sourcemaps can be specified via a 'SourceMap' header. It was
previously called 'X-SourceMap', so let's support that too.
2014-07-01 17:11:34 -04:00
Evan Wallace
649da9a3e5 be careful about a null url for data URLs 2014-04-26 12:25:21 -07:00
Evan Wallace
7fa445e16f Merge pull request #26 from ashaffer/patch-1
should not return a url when we have a dataUrl
2014-04-26 12:19:26 -07:00
Evan Wallace
f8930e837c Merge pull request #24 from ddude/master
added retrieveFile option
2014-04-26 12:17:44 -07:00
Evan Wallace
f0354b662a add support for sourcesContent, closes #25 2014-04-26 12:15:02 -07:00
Evan Wallace
095d0ae63b merged and fixed tests 2014-04-26 11:43:54 -07:00
Evan Wallace
ce163815a8 Merge pull request #28 from manuelschneider/exportWrapCallSite
exporting wrapCallSite directly for other components to be used
2014-04-26 11:16:44 -07:00
Evan Wallace
4afea4855d fix column numbers 2014-04-26 11:15:38 -07:00
Manuel Schneider
076eb22176 exporting wrapCallSite directly for other components to be used 2014-02-04 01:25:01 +01:00
David Bushong
eea7eac6bc separate source display from uncaughtException
If you have your own uncaughtException handler, you might still like the
pretty source display from handleUncaughtExceptions: true; therefore
expose it as exports.getErrorSource(err)
2013-12-22 14:28:04 -08:00
ashaffer
27d844f02c should not return a url when we have a dataUrl 2013-12-11 12:30:20 -08:00
Jeremie Pelletier
fffaca5b2f added retrieveFile option 2013-12-03 15:49:34 -05:00
Evan Wallace
bb81e8d380 version bump and build for npm 2013-11-10 13:19:41 -08:00
Rick Kilgore
21bb6544aa only install once if called multiple times in same vm
I have a problem using this module in my unit tests, because I don't
have a central place to put the

    require('source-map-support').install();

statement.  So I end up having to put it in every unit test, and once
I've written enough tests, I start getting an annoying error about using
up too much memory.

This change makes is so if you call install() multiple times in the same
vm, it only actually installs once.
2013-11-07 19:10:12 -08:00
Evan Wallace
a3008a2348 use the source-map module again now that it works with typescript 2013-08-21 18:08:13 -07:00
Evan Wallace
340839e9fa temporarily use my patched source-map library until Mozilla fixes theirs 2013-08-15 22:48:52 -07:00
Evan Wallace
bbe8c603ab swallow SJAX errors during in-browser translation 2013-08-03 07:25:01 -07:00