Skip to content
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

Merged
merged 1 commit into from Oct 10, 2015
Merged

Don't use RegExp to extract sourcemap #20

merged 1 commit into from Oct 10, 2015

Conversation

SimenB
Copy link
Contributor

@SimenB SimenB commented Oct 9, 2015

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 馃槃

@@ -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));
Copy link
Contributor Author

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

@dmitry
Copy link

dmitry commented Oct 9, 2015

Would be nice to see it in the next release. At the moment I'm using my own fork with fixed branch.

@SimenB
Copy link
Contributor Author

SimenB commented Oct 9, 2015

Yeah, now that io.js is merged back with node, this will probably hit a lot more people.
This repo seems pretty dead (no comment from the author on any open PRs or issues), so I just published my fork

@demerzel3
Copy link
Owner

Sorry guys I haven't used karma in a while and didn't have much time lately.
I'll try to update as soon as possible.

demerzel3 added a commit that referenced this pull request Oct 10, 2015
Don't use RegExp to extract sourcemap
@demerzel3 demerzel3 merged commit a745219 into demerzel3:master Oct 10, 2015
@SimenB SimenB deleted the drop-regex-base64 branch October 10, 2015 09:21
@SimenB
Copy link
Contributor Author

SimenB commented Oct 10, 2015

Ah, great 馃榾 I've deprecated my fork 馃槃

@vvo
Copy link

vvo commented Oct 12, 2015

馃憤 @SimenB great find :)

@vvo
Copy link

vvo commented Oct 12, 2015

Sorry guys I haven't used karma in a while

I wonder, did you switch to another project?

@demerzel3
Copy link
Owner

I wonder, did you switch to another project?

Actually, no. Just working on less javascript at work 馃槖

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.

None yet

4 participants