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

introduce a warning with misusage binding in dev mode #4084

Closed
wants to merge 4 commits into from
Closed

introduce a warning with misusage binding in dev mode #4084

wants to merge 4 commits into from

Conversation

defcc
Copy link
Member

@defcc defcc commented Nov 1, 2016

As discused in #4060 , we could introduce a warning in dev mode for v-bind with literal to avoid unnessary rendering.

@yyx990803
Copy link
Member

See #4060 (comment)

But this is a pretty smart way to detect pure literals ;)

@yyx990803 yyx990803 closed this Nov 1, 2016
}

try {
func()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While being a savvy technique, this is also very very dangerous. It will introduce code execution, especially if expression is passed from user input or database.

Copy link
Member Author

@defcc defcc Nov 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En, this is just a check in dev mode. If the expression passed down is plain js code like 'alert(1)', it'll be warned.

<component :val="alert(1)"></component>

@defcc defcc deleted the misusage-binding-warning branch November 2, 2016 05:20
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.

3 participants