New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't use RegExp to extract sourcemap #20
Conversation
@@ -51,7 +49,7 @@ var createSourceMapLocatorPreprocessor = function(args, logger, helper) { | |||
if (!mapUrl) { | |||
fileMap(file.path + ".map"); | |||
} else if (/^data:application\/json/.test(mapUrl)) { | |||
inlineMap(mapUrl); | |||
inlineMap(mapUrl.slice('data:application/json'.length)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The start was only used in the regexp in inlineMap
, so not interesting and can be discarded
Would be nice to see it in the next release. At the moment I'm using my own fork with fixed branch. |
Yeah, now that io.js is merged back with node, this will probably hit a lot more people. |
Sorry guys I haven't used karma in a while and didn't have much time lately. |
Don't use RegExp to extract sourcemap
Ah, great 馃榾 I've deprecated my fork 馃槃 |
馃憤 @SimenB great find :) |
I wonder, did you switch to another project? |
Actually, no. Just working on less javascript at work 馃槖 |
After upgrading from Node 0.12 to 4.1.2 we started getting
RangeError: Maximum call stack size exceeded
from the regex getting the encoded sourcemap. Using simple slice instead makes it not explode.Probably related to this: https://code.google.com/p/v8/issues/detail?id=3878
I've published this as I need it for work: https://www.npmjs.com/package/karma-sourcemap-loader-no-base64-regexp
I'll deprecated if this is merged or somehow fixed 馃槃