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

Commit bdf6fb7

Browse files
authored
Merge pull request #161 from exoego/fix-errors-module
Fix "errors" module-related issues
2 parents 1b0bc24 + 8268399 commit bdf6fb7

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.scalajs.nodejs
22

33
import scala.scalajs.js
4-
import scala.scalajs.js.annotation.{JSGlobal, JSImport}
4+
import scala.scalajs.js.annotation.JSGlobal
55

66
/**
77
* Creates a new Error object and sets the error.message property to the provided text message.
@@ -12,7 +12,7 @@ import scala.scalajs.js.annotation.{JSGlobal, JSImport}
1212
* Error.stackTraceLimit, whichever is smaller.
1313
*/
1414
@js.native
15-
@JSImport("errors", "Error")
15+
@JSGlobal
1616
class Error(message0: String = js.native) extends js.Object {
1717

1818
/**

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package io.scalajs.nodejs
22

33
import scala.scalajs.js
4-
import scala.scalajs.js.annotation.JSImport
54
import scala.scalajs.js.|
65

76
/**
87
* System Error
98
*/
109
@js.native
11-
@JSImport("errors", "SystemError")
12-
class SystemError(message0: String = js.native) extends Error(message0) {
10+
trait SystemError extends Error {
1311

1412
/**
1513
* The error.errno property is a number or a string. The number is a negative value which corresponds
@@ -45,13 +43,6 @@ class SystemError(message0: String = js.native) extends Error(message0) {
4543
val info: js.Object = js.native
4644
}
4745

48-
/**
49-
* System Error Singleton
50-
*/
51-
@js.native
52-
@JSImport("errors", JSImport.Namespace)
53-
object SystemError extends Error
54-
5546
object SystemErrorCodes {
5647
@inline final val E2BIG = "E2BIG"
5748
@inline final val EACCES = "EACCES"

0 commit comments

Comments
 (0)