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

Comments

Projects
None yet
2 participants
@jrburke
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

This comment has been minimized.

Show comment
Hide comment
@jrburke

jrburke Jul 8, 2013

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@also

also 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.

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

This comment has been minimized.

Show comment
Hide comment
@jrburke

jrburke Jul 22, 2013

Member

Putting it 2.1.9 bucket for evaluation.

Member

jrburke commented Jul 22, 2013

Putting it 2.1.9 bucket for evaluation.

@jrburke jrburke reopened this Jul 22, 2013

@jrburke jrburke closed this in efc79ed Oct 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment