File tree 1 file changed +3
-6
lines changed
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
657
657
-->
658
658
659
659
* ` 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.
665
662
666
663
For objects whose ` valueOf() ` function returns a value not strictly equal to
667
664
` object ` , returns ` Buffer.from(object.valueOf(), offsetOrEncoding, length) ` .
@@ -672,7 +669,7 @@ const buf = Buffer.from(new String('this is a test'));
672
669
```
673
670
674
671
For objects that support ` Symbol.toPrimitive ` , returns
675
- ` Buffer.from(object[Symbol.toPrimitive](), offsetOrEncoding, length ) ` .
672
+ ` Buffer.from(object[Symbol.toPrimitive]('string' ), offsetOrEncoding) ` .
676
673
677
674
``` js
678
675
class Foo {
You can’t perform that action at this time.
0 commit comments