First I created a test class like this below:

class Test {
 #x = 'private'
}

And then when I attempted to get that private field "#x":

const test = new Test()
console.log(test.#x)

I recieved an error like this:

SyntaxError: Private field '#x' must be declared in an enclosing class


I thought that this error message is confusing. A better one could be like 
this:

SyntaxError: Attempting to access private field '#x" 

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/f0837372-d8ea-4444-84fc-a6c9d0866656%40googlegroups.com.

Reply via email to