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

Extension method should not expose value #263

Merged
merged 1 commit into from
Jun 5, 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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package object buffer {
/**
* Buffer Extensions
*/
implicit final class BufferExtensions(val buffer: Buffer) extends AnyVal {
implicit final class BufferExtensions(private val buffer: Buffer) extends AnyVal {

/**
* Syntactic sugar for concatenating a buffer
Expand Down Expand Up @@ -71,13 +71,13 @@ package object buffer {
* Note that this is a property on the buffer module returned by require('buffer'), not on the
* Buffer global or a Buffer instance.
*/
val INSPECT_MAX_BYTES = BufferNamespace.INSPECT_MAX_BYTES
val INSPECT_MAX_BYTES: UID = BufferNamespace.INSPECT_MAX_BYTES

/**
* On 32-bit architectures, this value is (2^30)-1 (~1GB). On 64-bit architectures, this value is (2^31)-1 (~2GB).F
* Note that this is a property on the buffer module returned by require('buffer'), not on the Buffer global or a Buffer instance.
*/
val kMaxLength = BufferNamespace.kMaxLength
val kMaxLength: Double = BufferNamespace.kMaxLength

@js.native
@JSImport("buffer", JSImport.Namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package object http {
/**
* Http Extensions
*/
implicit final class HttpExtensions(val http: Http) extends AnyVal {
implicit final class HttpExtensions(private val http: Http) extends AnyVal {

/**
* @see [[Http.createServer()]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package object https {
/**
* Https Extensions
*/
implicit final class HttpExtensions(val https: Https) extends AnyVal {
implicit final class HttpExtensions(private val https: Https) extends AnyVal {

/**
* Like http.get() but for HTTPS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ package object nodejs {
@JSGlobal("setTimeout")
object setTimeout extends SetTimeout

implicit final class ErrorExtensions(val error: Error) extends AnyVal {
implicit final class ErrorExtensions(private val error: Error) extends AnyVal {
@inline
def toException(): Exception = js.JavaScriptException(error.message)
}
Expand Down