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 <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann (רפאל פלחי) <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent 69af43e commit 705f259

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/api/cli.md

+5-4
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
const o = {};
224223
// THROWS: Cannot assign read only property 'toString' of object
225224
o.toString = () => 'string';
226225

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

238239
class X {
239240
toString = undefined;

0 commit comments

Comments
 (0)