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

$http.delete shows warning "avoid using JavaScript unary operator as property name" #11090

Open
frOracle opened this issue Feb 7, 2020 · 3 comments · May be fixed by #11143 or #11409
Open

$http.delete shows warning "avoid using JavaScript unary operator as property name" #11090

frOracle opened this issue Feb 7, 2020 · 3 comments · May be fixed by #11143 or #11409

Comments

@frOracle
Copy link

@frOracle frOracle commented Feb 7, 2020

Version

2.6.11

Reproduction link

https://codepen.io/frOracle/pen/vYOEEVW

Steps to reproduce

use $http.delete in @click

What is expected?

$http.delete is a function, not unary operator

What is actually happening?

a warning "avoid using JavaScript unary operator as property name"


Related #5464

@posva posva changed the title $http.delete with warning "avoid using JavaScript unary operator as property name" $http.delete shows warning "avoid using JavaScript unary operator as property name" Feb 7, 2020
@posva posva removed the bug label Feb 7, 2020
@posva
Copy link
Member

@posva posva commented Feb 7, 2020

I think the point of this was to avoid problems by using keys in object with names like delete (looking at the commit where the file was changed to emit this error will probably have more info). Depending on that, we could avoid it on the expression if it's prefixed by an object.
It's still a warning, so it doesn't break the app.
The workaround is using $http['delete'], which is quite verbose

For anybody willing to give this a try: I marked this as a good first issue but it might be harder than I think because it depends on the logic that exists regarding the warning

@simwipado
Copy link

@simwipado simwipado commented Feb 8, 2020

created PR #11092 for this #issue

tyschroed added a commit to tyschroed/vue that referenced this issue Feb 25, 2020
Update error-detector to look for `.` prefix, indicating function is associated with an object

fix vuejs#11090
tyschroed added a commit to tyschroed/vue that referenced this issue Feb 25, 2020
aryavb added a commit to aryavb/vue that referenced this issue May 23, 2020
@aryavb aryavb linked a pull request that will close this issue May 23, 2020
6 of 13 tasks complete
@aryavb
Copy link

@aryavb aryavb commented May 23, 2020

PR #11409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.