Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Remove items deprecated in prior to Node.js v8 #112

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions app/current/src/main/scala/io/scalajs/nodejs/Assert.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
*/
Expand All @@ -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])
Expand Down
63 changes: 1 addition & 62 deletions app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
/////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 0 additions & 8 deletions app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 0 additions & 11 deletions app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading