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

Conditional operator is not supported in case clauses #653

Closed
renatahodovan opened this issue Oct 2, 2015 · 2 comments
Closed

Conditional operator is not supported in case clauses #653

renatahodovan opened this issue Oct 2, 2015 · 2 comments

Comments

@renatahodovan
Copy link
Contributor

Jerry version:
Checked revision: 98fc409
Build: debug.linux
OS:
Ubuntu 15.04, x86_64
Test case:
var a = "foo";
switch(a) {
    case true ? "foo" : "bar":
        print("OK");
        break;
}

Output:

    case true ? "foo" : "bar":
                             ^
ERROR: Ln 3, Col 30: Expected either ';' or newline token

According to ecma5, any expression can stand in a case clause after the 'case' keyword but ternary statements are rejected in jerry.

@wateret
Copy link
Contributor

wateret commented Oct 30, 2015

@renatahodovan
I think we can close this. Check out #666.

@egavrin
Copy link
Contributor

egavrin commented Nov 19, 2015

Works on master (f17f785)

@egavrin egavrin closed this as completed Nov 19, 2015
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

3 participants