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

Infinite loop in parseObject for empty objects when !verbose #15

Closed
dvdsgl opened this issue Aug 25, 2017 · 1 comment
Closed

Infinite loop in parseObject for empty objects when !verbose #15

dvdsgl opened this issue Aug 25, 2017 · 1 comment
Labels

Comments

@dvdsgl
Copy link

dvdsgl commented Aug 25, 2017

case objectStates.PROPERTY: {
    if (token.type === tokenTypes.RIGHT_BRACE) {
        if (settings.verbose) {
            object.loc = location(
                startToken.loc.start.line,
                startToken.loc.start.column,
                startToken.loc.start.offset,
                token.loc.end.line,
                token.loc.end.column,
                token.loc.end.offset,
                settings.source
            );
            return {
                value: object,
                index: index + 1
            };
        }

Should be

case objectStates.PROPERTY: {
    if (token.type === tokenTypes.RIGHT_BRACE) {
        if (settings.verbose) {
            object.loc = location(
                startToken.loc.start.line,
                startToken.loc.start.column,
                startToken.loc.start.offset,
                token.loc.end.line,
                token.loc.end.column,
                token.loc.end.offset,
                settings.source
            );
        }
        return {
            value: object,
            index: index + 1
        };
@vtrushin
Copy link
Owner

@dvdsgl Fixed! Thanks!

@vtrushin vtrushin added the bug label Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants