diff --git a/app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala b/app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala index c2a10eac2..f7c170e99 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala @@ -12,68 +12,7 @@ import scala.scalajs.js.| */ @js.native @JSImport("buffer", "Buffer") -class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ -1) { - - ///////////////////////////////////////////////////////////////////////////////// - // Constructors - ///////////////////////////////////////////////////////////////////////////////// - - /** - * Use [[Buffer.alloc()]] instead. - * - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_size]] - */ - @inline - @deprecated("Use Buffer.alloc(size) instead.", since = "Node.js v6.0.0") - def this(size: Int) = this() - - /** - * Use [[Buffer.from(str,encoding)]] instead. - * - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_string_encoding]] - */ - @inline - @deprecated("Use Buffer.from(str[, encoding]) instead.", since = "Node.js v6.0.0") - def this(str: String) = this() - - /** - * Use [[Buffer.from(str,encoding)]] instead. - * - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_string_encoding]] - */ - @inline - @deprecated("Use Buffer.from(str[, encoding]) instead.", since = "Node.js v6.0.0") - def this(str: String, encoding: String) = this() - - /** - * Use [[Buffer.from(array)]] instead. - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_array]] - */ - @inline - @deprecated("Use Buffer.from(array) instead.", since = "Node.js v6.0.0") - def this(array: js.Array[Int]) = this() - - /** - * Use [[Buffer.from(buffer)]] instead. - * - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_buffer]] - */ - @inline - @deprecated("Use Buffer.from(buffer) instead.", since = "Node.js v6.0.0") - def this(buffer: Buffer) = this() - - /** - * Use [[Buffer.from(arrayBuffer,byteOffset,length)]] instead. - * - * @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_arraybuffer_byteoffset_length]] - */ - @inline - @deprecated("Use Buffer.from(arrayBuffer[, byteOffset [, length]]) instead.", since = "Node.js v6.0.0") - def this(arrayBuffer: ArrayBuffer, byteOffset: Int = js.native, length: Int = js.native) = this() - - ///////////////////////////////////////////////////////////////////////////////// - // Accessors and Mutators - ///////////////////////////////////////////////////////////////////////////////// +class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor */ -1) { /** * The index operator `[index]` can be used to get and set the octet at position `index` in `buf`. diff --git a/app/current/src/main/scala/io/scalajs/nodejs/buffer/SlowBuffer.scala b/app/current/src/main/scala/io/scalajs/nodejs/buffer/SlowBuffer.scala deleted file mode 100644 index 6334ab928..000000000 --- a/app/current/src/main/scala/io/scalajs/nodejs/buffer/SlowBuffer.scala +++ /dev/null @@ -1,21 +0,0 @@ -package io.scalajs.nodejs.buffer - -import scala.scalajs.js -import scala.scalajs.js.annotation.JSImport - -/** - * Returns an un-pooled Buffer. - * - * In order to avoid the garbage collection overhead of creating many individually allocated Buffer instances, - * by default allocations under 4KB are sliced from a single larger allocated object. This approach improves - * both performance and memory usage since v8 does not need to track and cleanup as many Persistent objects. - * - * In the case where a developer may need to retain a small chunk of memory from a pool for an indeterminate - * amount of time, it may be appropriate to create an un-pooled Buffer instance using SlowBuffer then copy - * out the relevant bits. - * @see https://nodejs.org/api/buffer.html#buffer_class_slowbuffer - */ -@deprecated("Use Buffer.allocUnsafeSlow() instead.", since = "6.0.0") -@js.native -@JSImport("buffer", "SlowBuffer") -class SlowBuffer(size: Int) extends Buffer