qunitjs/qunit

qunit cannot parse private functions and properties

Closed this issue · 2 comments

Tell us about your runtime:

  • QUnit version:

2.20.0

  • Which environment are you using? (e.g., browser, Node):

node 8.5.5

  • How are you running QUnit? (e.g., QUnit CLI, Grunt, Karma, manually in browser):

cli

What are you trying to do?

Code that reproduces the problem:

class Test {
  #privateFunction() {}  // qunit does not understand this
}

What did you expect to happen?

qunit should be able to parse private functions and properties

What actually happened?

SyntaxError: Unexpected token '('

This might be to an outdated npm version, will try to upgrade

@olleharstedt The JavaScript code is interpreted by Node.js, not QUnit.

Refer to https://nodejs.org/en/download/ for how to download or upgrade your Node.js installation. If you originally installed it from a package manager (like apt-get, or Homebrew), then check https://nodejs.org/en/download/package-manager instead.

You can use MDN to learn which browsers and Node.js version support a JavaScript feature. For example, Private class properties were first released in Node.js 14.6.