File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -657,11 +657,8 @@ added: v8.2.0
657657-->
658658
659659* ` object ` {Object} An object supporting ` Symbol.toPrimitive ` or ` valueOf() ` .
660- * ` offsetOrEncoding ` {integer|string} A byte-offset or encoding, depending on
661- the value returned either by ` object.valueOf() ` or
662- ` object[Symbol.toPrimitive]() ` .
663- * ` length ` {integer} A length, depending on the value returned either by
664- ` object.valueOf() ` or ` object[Symbol.toPrimitive]() ` .
660+ * ` offsetOrEncoding ` {integer|string} A byte-offset or encoding.
661+ * ` length ` {integer} A length.
665662
666663For objects whose ` valueOf() ` function returns a value not strictly equal to
667664` object ` , returns ` Buffer.from(object.valueOf(), offsetOrEncoding, length) ` .
@@ -672,7 +669,7 @@ const buf = Buffer.from(new String('this is a test'));
672669```
673670
674671For objects that support ` Symbol.toPrimitive ` , returns
675- ` Buffer.from(object[Symbol.toPrimitive](), offsetOrEncoding, length ) ` .
672+ ` Buffer.from(object[Symbol.toPrimitive]('string' ), offsetOrEncoding) ` .
676673
677674``` js
678675class Foo {
You can’t perform that action at this time.
0 commit comments