diff --git a/doc/api/cli.md b/doc/api/cli.md index f3accc0c29f130..25d25a3d08326b 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -218,15 +218,11 @@ or be removed in the future. To avoid these cases, any builtin function overrides should be defined upfront: - ```js const o = {}; // THROWS: Cannot assign read only property 'toString' of object o.toString = () => 'string'; -// OK -const o = { toString: () => 'string' }; - class X { constructor() { this.toString = () => 'string'; @@ -234,6 +230,11 @@ class X { } // THROWS: Cannot assign read only property 'toString' of object new X(); +``` + +```js +// OK +const o = { toString: () => 'string' }; class X { toString = undefined;