]> zoso.dev Git - buffer.git/commitdiff
Show warning for unimplemented .lastIndexOf
authorFeross Aboukhadijeh <feross@feross.org>
Mon, 8 Aug 2016 05:09:15 +0000 (22:09 -0700)
committerFeross Aboukhadijeh <feross@feross.org>
Mon, 8 Aug 2016 05:09:15 +0000 (22:09 -0700)
Instead of letting the Uint8Array implementation's .lastIndexOf be
exposed, since that one has a different interface.

index.js

index 8aa809126d81c1f27f395ce51f13229867d88798..834bea0de5fc1941dae7f08426cf38a96e5bd547 100644 (file)
--- a/index.js
+++ b/index.js
@@ -725,6 +725,10 @@ Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
   throw new TypeError('val must be string, number or Buffer')
 }
 
+Buffer.prototype.lastIndexOf = function () {
+  throw new Error('Not implemented yet. PR welcome! https://github.com/feross/buffer/issues/114')
+}
+
 Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
   return this.indexOf(val, byteOffset, encoding) !== -1
 }