diff --git a/app/current/src/main/scala/io/scalajs/nodejs/Assert.scala b/app/current/src/main/scala/io/scalajs/nodejs/Assert.scala index 81d41bb59..8c5954176 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/Assert.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/Assert.scala @@ -25,9 +25,6 @@ trait Assert extends IEventEmitter { */ def apply(expression: js.Any, message: String = js.native): Unit = js.native - @deprecated("Use assert.deepStrictEqual() instead.", "stability 0") - def deepEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native - /** * Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the * strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes. @@ -50,12 +47,6 @@ trait Assert extends IEventEmitter { def doesNotThrow(block: js.Function, error: js.RegExp | js.Function = js.native, message: String = js.native): Unit = js.native - /** - * @see https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message - */ - @deprecated("Use assert.strictEqual() instead.", "stability 0") - def equal(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native - /** * @see https://nodejs.org/api/assert.html#assert_assert_fail_message */ @@ -75,18 +66,12 @@ trait Assert extends IEventEmitter { */ def ifError(value: js.Any): Unit = js.native - @deprecated("Use assert.notDeepStrictEqual() instead.", "stability 0") - def notDeepEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native - /** * Tests for deep strict inequality. Opposite of assert.deepStrictEqual(). * @example assert.notDeepStrictEqual(actual, expected[, message]) */ def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native - @deprecated("Use assert.notStrictEqual() instead.", "stability 0") - def notEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native - /** * Tests strict inequality as determined by the strict not equal operator ( !== ). * @example assert.notStrictEqual(actual, expected[, message]) 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 diff --git a/app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala b/app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala index c072f5d3a..fcb24c7a3 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala @@ -40,18 +40,6 @@ trait Worker extends IEventEmitter { */ def process: ChildProcess = js.native - /** - * An alias to worker.exitedAfterDisconnect. - * - * Set by calling .kill() or .disconnect(). Until then, it is undefined. - * - * The boolean worker.suicide lets you distinguish between voluntary and accidental exit, the master may choose not - * to respawn a worker based on this value. - * @return - */ - @deprecated("Deprecated: Use worker.exitedAfterDisconnect instead.", since = "6.0.0") - def suicide: Boolean = js.native - ///////////////////////////////////////////////////////////////////////////////// // Methods ///////////////////////////////////////////////////////////////////////////////// diff --git a/app/current/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala b/app/current/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala index 69f2efa23..67621b89a 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala @@ -151,13 +151,6 @@ object EventEmitter extends IEventEmitter { */ var defaultMaxListeners: Int = js.native - /** - * A class method that returns the number of listeners for the given eventName registered on the given emitter. - * @example EventEmitter.listenerCount(emitter, eventName) - */ - @deprecated("Use emitter.listenerCount() instead.", since = "4.0.0") - def listenerCount(emitter: IEventEmitter, eventName: String): Unit = js.native - @enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12) def once(emitter: IEventEmitter, eventName: String): js.Promise[js.Array[js.Any]] = js.native } diff --git a/app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala b/app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala index 76e807ff9..1734a7f12 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala @@ -225,14 +225,6 @@ trait Fs extends IEventEmitter with FSConstants { def createWriteStream(path: Path, options: FileOutputOptions = js.native): WriteStream = js.native - /** - * Test whether or not the given path exists by checking with the file system. Then call the callback argument with - * either true or false. - * @example fs.exists('/etc/passwd', (exists) => { ... }) - */ - @deprecated("Use fs.stat() or fs.access() instead.", since = "1.0.0") - def exists(path: Path, callback: js.Function1[Boolean, Any]): Unit = js.native - /** * fs.exists() should not be used to check if a file exists before calling fs.open(). Doing so introduces a race * condition since other processes may change the file's state between the two calls. Instead, user code should diff --git a/app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala b/app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala index e6ba131e6..bc2242edf 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala @@ -18,12 +18,6 @@ class Server(options: ServerOptions = js.native) extends IEventEmitter { def this(options: ServerOptions, connectionListener: js.Function) = this() def this(connectionListener: js.Function) = this() - /** - * Returns the current number of concurrent connections on the server. - */ - @deprecated("Use server.getConnections() instead.", since = "0.9.7") - def connections: Int = js.native - /** * A Boolean indicating whether or not the server is listening for connections. * @example server.listening diff --git a/app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala b/app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala index 5e12300da..5a62902bb 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala @@ -16,9 +16,6 @@ trait REPL extends IEventEmitter { var REPL_MODE_SLOPPY: js.Symbol = js.native var REPL_MODE_STRICT: js.Symbol = js.native - @deprecated("Use REPL_MODE_SLOPPY instead", "Node.js v6.0.0") - var REPL_MODE_MAGIC: js.UndefOr[js.Symbol] = js.native - def start(options: StartOptions = js.native): REPLServer = js.native def start(prompt: String): REPLServer = js.native } diff --git a/app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala b/app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala index 4f0b5f30c..e376c89ac 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala @@ -57,17 +57,6 @@ package object repl { @inline def NODE_REPL_HISTORY: Option[String] = env("NODE_REPL_HISTORY").toOption - /** - * Previously in Node.js/io.js v2.x, REPL history was controlled by using a NODE_REPL_HISTORY_FILE environment - * variable, and the history was saved in JSON format. This variable has now been deprecated, and the old - * JSON REPL history file will be automatically converted to a simplified plain text format. This new file - * will be saved to either the user's home directory, or a directory defined by the NODE_REPL_HISTORY variable, - * as documented in the Environment Variable Options. - */ - @inline - @deprecated("Use NODE_REPL_HISTORY instead.", since = "3.0.0") - def NODE_REPL_HISTORY_FILE: Option[String] = env("NODE_REPL_HISTORY_FILE").toOption - /** * Defaults to 1000. Controls how many lines of history will be persisted if history is available. * Must be a positive number. diff --git a/app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala b/app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala index e3273cf60..6586cdaae 100644 --- a/app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala +++ b/app/current/src/main/scala/io/scalajs/nodejs/util/Util.scala @@ -1,11 +1,9 @@ package io.scalajs.nodejs.util import com.thoughtworks.{enableIf, enableMembersIf} -import io.scalajs.nodejs.stream import scala.scalajs.js import scala.scalajs.js.annotation.JSImport -import scala.scalajs.js.| /** * These functions are in the module 'util'. Use require('util') to access them. @@ -19,13 +17,6 @@ import scala.scalajs.js.| @js.native trait Util extends js.Object { - /** - * Deprecated predecessor of console.error. - * @example util.debug(string) - */ - @deprecated("Use console.debug() instead.", "4.0.0") - def debug(string: String): js.Any = js.native - /** * This is used to create a function which conditionally writes to stderr based on the existence of a NODE_DEBUG * environment variable. If the section name appears in that environment variable, then the returned function will @@ -40,13 +31,6 @@ trait Util extends js.Object { */ def deprecate(function: js.Function, message: String, code: String = js.native): js.Any = js.native - /** - * Deprecated predecessor of console.error. - * @example util.error([...]) - */ - @deprecated("Use console.error() instead.", "4.0.0") - def error(varargs: js.Any*): js.Any = js.native - /** * Returns a formatted string using the first argument as a printf-like format. * @example util.format(format[, ...]) @@ -79,149 +63,6 @@ trait Util extends js.Object { val inspect: InspectObject = js.native - /** - * Returns true if the given "object" is an Array. Otherwise, returns false. - *

NOTEInternal alias for Array.isArray. - * @example util.isArray(object) - */ - @deprecated("Internal alias for Array.isArray.", "4.0.0") - def isArray(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Boolean. Otherwise, returns false. - * @example util.isBoolean(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isBoolean(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Buffer. Otherwise, returns false. - * @example util.isBuffer(object) - */ - @deprecated("Use Buffer.isBuffer() instead.", "4.0.0") - def isBuffer(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Date. Otherwise, returns false. - * @example util.isDate(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isDate(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is an Error. Otherwise, returns false. - * @example util.isError(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isError(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Function. Otherwise, returns false. - * @example util.isFunction(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isFunction(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is strictly null. Otherwise, returns false. - * @example util.isNull(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isNull(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is null or undefined. Otherwise, returns false. - * @example util.isNullOrUndefined(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isNullOrUndefined(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Number. Otherwise, returns false. - * @example util.isNumber(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isNumber(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is strictly an Object and not a Function. Otherwise, returns false. - * @example util.isObject(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isObject(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a primitive type. Otherwise, returns false. - * @example util.isPrimitive(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isPrimitive(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a RegExp. Otherwise, returns false. - * @example util.isRegExp(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isRegExp(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a String. Otherwise, returns false. - * @example util.isString(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isString(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is a Symbol. Otherwise, returns false. - * @example util.isSymbol(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isSymbol(`object`: js.Any): Boolean = js.native - - /** - * Returns true if the given "object" is undefined. Otherwise, returns false. - * @example util.isUndefined(object) - */ - @deprecated("Alternative not specified", "4.0.0") - def isUndefined(`object`: js.Any): Boolean = js.native - - /** - * Output with timestamp on stdout. - * @example util.log(string) - */ - @deprecated("Use a third party module instead.", "6.0.0") - def log(message: String): Unit = js.native - - /** - * Deprecated predecessor of console.log. - * @example util.print([...]) - */ - @deprecated("Use console.log() instead", "0.11.3") - def print(args: js.Array[js.Any]): Unit = js.native - - /** - * Deprecated predecessor of stream.pipe(). - * @example util.pump(readableStream, Writable[, callback]) - */ - @deprecated("Use ReadableStream.pipe(Writable)", "4.0.0") - def pump(readableStream: stream.IReadable, Writable: stream.IWritable, callback: js.Function): Unit = js.native - - /** - * Deprecated predecessor of console.log. - * @example util.puts([...]) - */ - @deprecated("Use console.log() instead.", "0.11.3") - def puts(args: js.Array[String] | String*): Unit = js.native - - /** - * The util._extend() method was never intended to be used outside of internal Node.js modules. - * The community found and used it anyway. It is deprecated and should not be used in new code. - * JavaScript comes with very similar built-in functionality through Object.assign(). - * @example util._extend(target, source) - */ - @deprecated("Use Object.assign() instead.", "6.0.0") - def _extend[A <: js.Any, B <: js.Any, C <: js.Any](target: A, source: B): C = js.native - def callbackify[T](original: js.Function): js.Function2[js.Any, T, Any] = js.native def promisify(original: js.Function): js.Function = js.native