-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
node_shims.ts
44 lines (41 loc) · 967 Bytes
/
node_shims.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// https://github.com/oakserver/oak/blob/main/node_shims.ts
// Copyright 2018-2022 the oak authors. All rights reserved. MIT license.
export class ErrorEvent extends Event {
#message: string
#filename: string
#lineno: number
#colno: number
// deno-lint-ignore no-explicit-any
#error: any
get message(): string {
return this.#message
}
get filename(): string {
return this.#filename
}
get lineno(): number {
return this.#lineno
}
get colno(): number {
return this.#colno
}
// deno-lint-ignore no-explicit-any
get error(): any {
return this.#error
}
constructor(type: string, eventInitDict: ErrorEventInit = {}) {
super(type, eventInitDict)
const {
message = 'error',
filename = '',
lineno = 0,
colno = 0,
error
} = eventInitDict
this.#message = message
this.#filename = filename
this.#lineno = lineno
this.#colno = colno
this.#error = error
}
}