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

incorrect new-line insertion after "yield" #1206

Closed
kotarondo opened this issue Jun 16, 2017 · 0 comments
Closed

incorrect new-line insertion after "yield" #1206

kotarondo opened this issue Jun 16, 2017 · 0 comments

Comments

@kotarondo
Copy link

Description

I got syntax error after js-beautify.

Input

The code looked like this before beautification:

function* gen() {
    yield function() {};
}

Expected Output

No change.

Actual Output

The code actually looked like this after beautification:

function* gen() {
    yield
    function() {};
}

Steps to Reproduce

% node test.js
// no error

% js-beautify -r test.js
beautified test.js
% node test.js
test.js:4
    function() {};
            ^

SyntaxError: Unexpected token (
@kotarondo kotarondo changed the title incorrect new-line after "yield" incorrect new-line insertion after "yield" Jun 16, 2017
@bitwiseman bitwiseman added this to the v1.7.0 milestone Jun 16, 2017
bitwiseman added a commit to bitwiseman/js-beautify that referenced this issue Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants