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

Commit 7a0d375

Browse files
authored
Merge pull request #112 from exoego/remove-deprecated-in-nodejs
Remove items deprecated in prior to Node.js v8
2 parents 1806367 + 09ff372 commit 7a0d375

File tree

10 files changed

+1
-304
lines changed

10 files changed

+1
-304
lines changed

app/current/src/main/scala/io/scalajs/nodejs/Assert.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ trait Assert extends IEventEmitter {
2525
*/
2626
def apply(expression: js.Any, message: String = js.native): Unit = js.native
2727

28-
@deprecated("Use assert.deepStrictEqual() instead.", "stability 0")
29-
def deepEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native
30-
3128
/**
3229
* Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the
3330
* strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes.
@@ -50,12 +47,6 @@ trait Assert extends IEventEmitter {
5047
def doesNotThrow(block: js.Function, error: js.RegExp | js.Function = js.native, message: String = js.native): Unit =
5148
js.native
5249

53-
/**
54-
* @see https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message
55-
*/
56-
@deprecated("Use assert.strictEqual() instead.", "stability 0")
57-
def equal(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native
58-
5950
/**
6051
* @see https://nodejs.org/api/assert.html#assert_assert_fail_message
6152
*/
@@ -75,18 +66,12 @@ trait Assert extends IEventEmitter {
7566
*/
7667
def ifError(value: js.Any): Unit = js.native
7768

78-
@deprecated("Use assert.notDeepStrictEqual() instead.", "stability 0")
79-
def notDeepEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native
80-
8169
/**
8270
* Tests for deep strict inequality. Opposite of assert.deepStrictEqual().
8371
* @example assert.notDeepStrictEqual(actual, expected[, message])
8472
*/
8573
def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native
8674

87-
@deprecated("Use assert.notStrictEqual() instead.", "stability 0")
88-
def notEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native
89-
9075
/**
9176
* Tests strict inequality as determined by the strict not equal operator ( !== ).
9277
* @example assert.notStrictEqual(actual, expected[, message])

app/current/src/main/scala/io/scalajs/nodejs/buffer/Buffer.scala

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -12,68 +12,7 @@ import scala.scalajs.js.|
1212
*/
1313
@js.native
1414
@JSImport("buffer", "Buffer")
15-
class Buffer protected () extends Uint8Array( /* dummy to trick constructor */ -1) {
16-
17-
/////////////////////////////////////////////////////////////////////////////////
18-
// Constructors
19-
/////////////////////////////////////////////////////////////////////////////////
20-
21-
/**
22-
* Use [[Buffer.alloc()]] instead.
23-
*
24-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_size]]
25-
*/
26-
@inline
27-
@deprecated("Use Buffer.alloc(size) instead.", since = "Node.js v6.0.0")
28-
def this(size: Int) = this()
29-
30-
/**
31-
* Use [[Buffer.from(str,encoding)]] instead.
32-
*
33-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_string_encoding]]
34-
*/
35-
@inline
36-
@deprecated("Use Buffer.from(str[, encoding]) instead.", since = "Node.js v6.0.0")
37-
def this(str: String) = this()
38-
39-
/**
40-
* Use [[Buffer.from(str,encoding)]] instead.
41-
*
42-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_string_encoding]]
43-
*/
44-
@inline
45-
@deprecated("Use Buffer.from(str[, encoding]) instead.", since = "Node.js v6.0.0")
46-
def this(str: String, encoding: String) = this()
47-
48-
/**
49-
* Use [[Buffer.from(array)]] instead.
50-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_array]]
51-
*/
52-
@inline
53-
@deprecated("Use Buffer.from(array) instead.", since = "Node.js v6.0.0")
54-
def this(array: js.Array[Int]) = this()
55-
56-
/**
57-
* Use [[Buffer.from(buffer)]] instead.
58-
*
59-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_buffer]]
60-
*/
61-
@inline
62-
@deprecated("Use Buffer.from(buffer) instead.", since = "Node.js v6.0.0")
63-
def this(buffer: Buffer) = this()
64-
65-
/**
66-
* Use [[Buffer.from(arrayBuffer,byteOffset,length)]] instead.
67-
*
68-
* @see [[https://nodejs.org/api/buffer.html#buffer_new_buffer_arraybuffer_byteoffset_length]]
69-
*/
70-
@inline
71-
@deprecated("Use Buffer.from(arrayBuffer[, byteOffset [, length]]) instead.", since = "Node.js v6.0.0")
72-
def this(arrayBuffer: ArrayBuffer, byteOffset: Int = js.native, length: Int = js.native) = this()
73-
74-
/////////////////////////////////////////////////////////////////////////////////
75-
// Accessors and Mutators
76-
/////////////////////////////////////////////////////////////////////////////////
15+
class Buffer private[this] () extends Uint8Array( /* dummy to trick constructor */ -1) {
7716

7817
/**
7918
* The index operator `[index]` can be used to get and set the octet at position `index` in `buf`.

app/current/src/main/scala/io/scalajs/nodejs/buffer/SlowBuffer.scala

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/current/src/main/scala/io/scalajs/nodejs/cluster/Worker.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ trait Worker extends IEventEmitter {
4040
*/
4141
def process: ChildProcess = js.native
4242

43-
/**
44-
* An alias to worker.exitedAfterDisconnect.
45-
*
46-
* Set by calling .kill() or .disconnect(). Until then, it is undefined.
47-
*
48-
* The boolean worker.suicide lets you distinguish between voluntary and accidental exit, the master may choose not
49-
* to respawn a worker based on this value.
50-
* @return
51-
*/
52-
@deprecated("Deprecated: Use worker.exitedAfterDisconnect instead.", since = "6.0.0")
53-
def suicide: Boolean = js.native
54-
5543
/////////////////////////////////////////////////////////////////////////////////
5644
// Methods
5745
/////////////////////////////////////////////////////////////////////////////////

app/current/src/main/scala/io/scalajs/nodejs/events/EventEmitter.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ object EventEmitter extends IEventEmitter {
151151
*/
152152
var defaultMaxListeners: Int = js.native
153153

154-
/**
155-
* A class method that returns the number of listeners for the given eventName registered on the given emitter.
156-
* @example EventEmitter.listenerCount(emitter, eventName)
157-
*/
158-
@deprecated("Use emitter.listenerCount() instead.", since = "4.0.0")
159-
def listenerCount(emitter: IEventEmitter, eventName: String): Unit = js.native
160-
161154
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
162155
def once(emitter: IEventEmitter, eventName: String): js.Promise[js.Array[js.Any]] = js.native
163156
}

app/current/src/main/scala/io/scalajs/nodejs/fs/Fs.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,6 @@ trait Fs extends IEventEmitter with FSConstants {
225225
def createWriteStream(path: Path, options: FileOutputOptions = js.native): WriteStream =
226226
js.native
227227

228-
/**
229-
* Test whether or not the given path exists by checking with the file system. Then call the callback argument with
230-
* either true or false.
231-
* @example fs.exists('/etc/passwd', (exists) => { ... })
232-
*/
233-
@deprecated("Use fs.stat() or fs.access() instead.", since = "1.0.0")
234-
def exists(path: Path, callback: js.Function1[Boolean, Any]): Unit = js.native
235-
236228
/**
237229
* fs.exists() should not be used to check if a file exists before calling fs.open(). Doing so introduces a race
238230
* condition since other processes may change the file's state between the two calls. Instead, user code should

app/current/src/main/scala/io/scalajs/nodejs/net/Server.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ class Server(options: ServerOptions = js.native) extends IEventEmitter {
1818
def this(options: ServerOptions, connectionListener: js.Function) = this()
1919
def this(connectionListener: js.Function) = this()
2020

21-
/**
22-
* Returns the current number of concurrent connections on the server.
23-
*/
24-
@deprecated("Use server.getConnections() instead.", since = "0.9.7")
25-
def connections: Int = js.native
26-
2721
/**
2822
* A Boolean indicating whether or not the server is listening for connections.
2923
* @example server.listening

app/current/src/main/scala/io/scalajs/nodejs/repl/REPL.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ trait REPL extends IEventEmitter {
1616
var REPL_MODE_SLOPPY: js.Symbol = js.native
1717
var REPL_MODE_STRICT: js.Symbol = js.native
1818

19-
@deprecated("Use REPL_MODE_SLOPPY instead", "Node.js v6.0.0")
20-
var REPL_MODE_MAGIC: js.UndefOr[js.Symbol] = js.native
21-
2219
def start(options: StartOptions = js.native): REPLServer = js.native
2320
def start(prompt: String): REPLServer = js.native
2421
}

app/current/src/main/scala/io/scalajs/nodejs/repl/package.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ package object repl {
5757
@inline
5858
def NODE_REPL_HISTORY: Option[String] = env("NODE_REPL_HISTORY").toOption
5959

60-
/**
61-
* Previously in Node.js/io.js v2.x, REPL history was controlled by using a NODE_REPL_HISTORY_FILE environment
62-
* variable, and the history was saved in JSON format. This variable has now been deprecated, and the old
63-
* JSON REPL history file will be automatically converted to a simplified plain text format. This new file
64-
* will be saved to either the user's home directory, or a directory defined by the NODE_REPL_HISTORY variable,
65-
* as documented in the Environment Variable Options.
66-
*/
67-
@inline
68-
@deprecated("Use NODE_REPL_HISTORY instead.", since = "3.0.0")
69-
def NODE_REPL_HISTORY_FILE: Option[String] = env("NODE_REPL_HISTORY_FILE").toOption
70-
7160
/**
7261
* Defaults to 1000. Controls how many lines of history will be persisted if history is available.
7362
* Must be a positive number.

0 commit comments

Comments
 (0)