Bug 1499679 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

With Bug 1499448, we'll be able to declare private fields on ES classes.

Given the following piece of code: 
```js
class MyClass {
  #myPrivate = "this is private";
  myPublic = "this is public";
}  

const x = new MyClass();
x;
```

we should provide a way for the user to access the `#myPrivate` property.

This could be by directly showing them in the console output: 

> → x;
> ← ▶︎ myClass { myPublic: "this is public", #myPrivate: "this is private" } 

We might not want to show them directly as the can be confused with public properties, but could give access when inspecting the object: 


> → x;
> ← ▼ myClass
>   |     myPublic: "this is public"
>   |   ▼ <private>
>   |   |    #myPrivate: "this is private"
>   |   ▶︎ <prototype>
With Bug 1499448, we'll be able to declare private fields on ES classes.

Given the following piece of code: 

```js
class MyClass {
  #myPrivate = "this is private";
  myPublic = "this is public";
}  

const x = new MyClass();
x;
```

we should provide a way for the user to access the `#myPrivate` property.

This could be by directly showing them in the console output: 

> → x;
> ← ▶︎ myClass { myPublic: "this is public", #myPrivate: "this is private" } 

We might not want to show them directly as the can be confused with public properties, but could give access when inspecting the object: 


> → x;
> ← ▼ myClass
>   |     myPublic: "this is public"
>   |   ▼ <private>
>   |   |    #myPrivate: "this is private"
>   |   ▶︎ <prototype>

Back to Bug 1499679 Comment 0