Skip to content

Commit 705f259

Browse files
committed
doc: split example into two
This makes sure the "good" and "bad" examples are split into two. Otherwise it'll result in an parse error. PR-URL: #27670 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
1 parent 69af43e commit 705f259

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎doc/api/cli.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,22 +218,23 @@ or be removed in the future.
218218

219219
To avoid these cases, any builtin function overrides should be defined upfront:
220220

221-
<!-- eslint-disable no-redeclare -->
222221
```js
223222
consto= {};
224223
// THROWS: Cannot assign read only property 'toString' of object
225224
o.toString= () =>'string';
226225

227-
// OK
228-
consto= { toString: () =>'string' };
229-
230226
classX {
231227
constructor() {
232228
this.toString= () =>'string';
233229
}
234230
}
235231
// THROWS: Cannot assign read only property 'toString' of object
236232
newX();
233+
```
234+
235+
```js
236+
// OK
237+
consto= { toString: () =>'string' };
237238

238239
classX {
239240
toString =undefined;

0 commit comments

Comments
 (0)