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

feat: conditional expression supports comma operator #593

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kayoch1n
Copy link

@kayoch1n kayoch1n commented Aug 30, 2021

import { NewPage, OldPage } from "components"; // 使用按需加载的两个控件

let condition = 1, temp = '';
let Tag = condition? (temp = 'New', NewPage) : (temp = 'Old', OldPage); // 无法渲染

在条件表达式的 consequent 或者 alternate 部分使用了 comma opereator 的情况下,原来的代码仍然会导致渲染失败,类似这个issue

先前的这个 PR 对声明语句做了修复了,但是没有cover到其他表达式

@kayoch1n
Copy link
Author

kayoch1n commented Sep 2, 2021

@sorrycc 打搅一下,有时间review一下不?

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

Successfully merging this pull request may close these issues.

None yet

1 participant