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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse.nodeToString incorrectly calculates range #476

Closed
jrburke opened this issue Jul 8, 2013 · 3 comments
Closed

parse.nodeToString incorrectly calculates range #476

jrburke opened this issue Jul 8, 2013 · 3 comments
Milestone

Comments

@jrburke
Copy link
Member

jrburke commented Jul 8, 2013

In particular, if there is no comment or content above the requirejs.config call, it calculates the start value off by one as the preamble incorrectly includes as \n for zero line requirejs.config calls.

Found by @robdodson, in yeoman/grunt-bower-requirejs#36

@jrburke
Copy link
Member Author

jrburke commented Jul 8, 2013

Fixed in master, can be tested via the master link: https://raw.github.com/jrburke/r.js/master/dist/r.js

@also
Copy link

also commented Jul 12, 2013

This still doesn't work well.

Given

requirejs({});

parse.nodeToString returns

{});

requirejs({}

Given

requirejs(
{});

parse.nodeToString returns

{});

{}

and finally, given

requirejs(
{}
);

parse.nodeToString returns

{}

{}

which is the only variation that works.

I was trying to use mainConfigFile with a file generated from JSON, so it had no line breaks.

@jrburke
Copy link
Member Author

jrburke commented Jul 22, 2013

Putting it 2.1.9 bucket for evaluation.

@jrburke jrburke reopened this Jul 22, 2013
@jrburke jrburke closed this as completed in efc79ed Oct 8, 2013
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

No branches or pull requests

2 participants