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

classes static properties false syntax error #1193

Closed
applejuiceyy opened this issue Oct 12, 2019 · 3 comments
Closed

classes static properties false syntax error #1193

applejuiceyy opened this issue Oct 12, 2019 · 3 comments

Comments

@applejuiceyy
Copy link

Nature of issue?

  • Found a bug

Details about the bug:

  • Web browser and version: 77.0.3865.75 64bit
  • Operating System: ubuntu Linux 19.04
  • Steps to reproduce this bug:

write:
class t { static w = 2; }

image

however it works perfectly

@catarak
Copy link
Member

catarak commented Oct 17, 2019

thanks for reporting! i assume this is related to the jshint parsing not being 100% up to date with the newest javascript features.

@catarak
Copy link
Member

catarak commented Oct 17, 2019

it seems like this is actually still an ES7 stage 3 proposal, so it hasn't been added to JSHint yet? see jshint/jshint#3139. the way around this is to use a getter:

class t {
  static get w() {
    return 2; 
  }
}

catarak added a commit that referenced this issue Oct 17, 2019
catarak added a commit that referenced this issue Oct 17, 2019
@catarak catarak added this to Coding-writing experience in All Projects Dec 12, 2019
@catarak
Copy link
Member

catarak commented Feb 10, 2021

Going to roll this into #1540.

@catarak catarak closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
All Projects
Code-writing experience
Development

No branches or pull requests

2 participants