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

Remove deprecated library things (not deprecated in Node.js) #188

Merged
merged 1 commit into from
Feb 24, 2020
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
16 changes: 0 additions & 16 deletions app/current/src/main/scala/io/scalajs/nodejs/buffer/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@ package object buffer {
js.Iterator.IteratorOps(buffer.entries()).toIterator.flatMap(_.lastOption).map(n => f"$n%02x").mkString
}

/**
* Buffer Extensions
*/
@deprecated("Use io.scalajs.nodejs.buffer package object instead", "v0.10.0")
implicit final class BufferObjExtensions(val unused: Buffer.type) extends AnyVal {
@deprecated("Use io.scalajs.nodejs.buffer.transcode instead", "v0.10.0")
def transcode(source: Uint8Array, fromEnc: String, toEnc: String): Buffer =
BufferNamespace.transcode(source, fromEnc, toEnc)
@deprecated("Use io.scalajs.nodejs.buffer.INSPECT_MAX_BYTES instead", "v0.10.0")
def INSPECT_MAX_BYTES = BufferNamespace.INSPECT_MAX_BYTES
@deprecated("Use io.scalajs.nodejs.buffer.kMaxLength instead", "v0.10.0")
def kMaxLength = BufferNamespace.kMaxLength
@deprecated("Use io.scalajs.nodejs.buffer.constants instead", "v0.10.0")
def constants = io.scalajs.nodejs.buffer.constants
}

/**
* Re-encodes the given `Buffer` or `Uint8Array` instance from one character encoding to another.
* Returns a new `Buffer` instance.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package io.scalajs.nodejs.os

import scala.scalajs.js
import scala.scalajs.js.annotation.JSBracketAccess

@js.native
trait OSConstants extends js.Object {
@deprecated("Use named members", "v0.10.0")
@JSBracketAccess
def apply(key: String): js.Any = js.native

val UV_UDP_REUSEADDR: Int = js.native
val dlopen: OSDlopenConstants = js.native
val errno: OSErrnoConstants = js.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.scalajs.nodejs.events.IEventEmitter
import io.scalajs.nodejs.tty.{ReadStream, WriteStream}

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSBracketAccess, JSGlobal}
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.|

/**
Expand Down Expand Up @@ -481,10 +481,6 @@ trait ResourceUsage extends js.Object {

@js.native
trait Features extends js.Object {
@deprecated("Use named members", "v0.10.0")
@JSBracketAccess
def apply(key: String): Boolean = js.native

val debug: Boolean = js.native
val uv: Boolean = js.native
val ipv6: Boolean = js.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ package object process {
type ExitCode = Int
type SendHandle = net.Socket | net.Server

@deprecated("Use io.scalajs.nodejs.Error", "v0.10.0")
type Warning = Error

/**
* Process Object Extensions
* @param process the given [[Process process]]
Expand Down
13 changes: 0 additions & 13 deletions app/current/src/main/scala/io/scalajs/util/NodeJSConverters.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,18 @@ class BufferTest extends AnyFunSpec {
// package object method
assert(buffer.transcode(Buffer.from("hello"), "utf8", "ascii").toString("ascii") === "hello")
assert(buffer.transcode(Buffer.from("€"), "utf8", "ascii").toString("ascii") === "?")

// extension method
assert(Buffer.transcode(Buffer.from("hello"), "utf8", "ascii").toString("ascii") === "hello")
assert(Buffer.transcode(Buffer.from("€"), "utf8", "ascii").toString("ascii") === "?")
}

it("should support fields") {
// package object method
assert(buffer.INSPECT_MAX_BYTES > 0)
assert(buffer.kMaxLength > 0)

// extension method
assert(Buffer.INSPECT_MAX_BYTES > 0)
assert(Buffer.kMaxLength > 0)
}

it("should support constants") {
// package object method
assert(buffer.constants.MAX_LENGTH > 0)
assert(buffer.constants.MAX_STRING_LENGTH > 0)

// extension method
assert(Buffer.constants.MAX_LENGTH > 0)
assert(Buffer.constants.MAX_STRING_LENGTH > 0)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package child_process

import io.scalajs.nodejs.buffer.Buffer
import io.scalajs.nodejs.TestHelper._
import io.scalajs.util.NodeJSConverters._

import scala.concurrent.{ExecutionContext, Promise}
import scala.scalajs.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.scalajs.nodejs.fs

import io.scalajs.nodejs.setImmediate
import io.scalajs.util.NodeJSConverters._
import io.scalajs.nodejs.TestHelper._

import scala.concurrent.{ExecutionContext, Promise}
Expand Down
52 changes: 0 additions & 52 deletions core/src/main/scala/io/scalajs/util/DateHelper.scala

This file was deleted.

44 changes: 0 additions & 44 deletions core/src/main/scala/io/scalajs/util/JSONHelper.scala

This file was deleted.

41 changes: 0 additions & 41 deletions core/src/main/scala/io/scalajs/util/ScalaJsHelper.scala

This file was deleted.