events-ex 2.0.0-alpha.6 → 2.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.cn.md +1 -0
- package/README.md +1 -0
- package/docs/README.md +2 -0
- package/docs/classes/event.Event.md +6 -6
- package/docs/classes/event_emitter-1.EventEmitter.md +1 -1
- package/docs/classes/event_emitter.EventEmitter.md +11 -11
- package/docs/modules/all_off.md +1 -1
- package/docs/modules/consts.md +1 -1
- package/docs/modules/default_methods.md +1 -1
- package/docs/modules/has_listeners.md +1 -1
- package/docs/modules/pipe.md +1 -1
- package/docs/modules/pipe_async.md +1 -1
- package/docs/modules/unify.md +1 -1
- package/docs/modules/util_array_remove.md +1 -1
- package/docs/modules/util_object_for_each.md +1 -1
- package/docs/modules/util_string_pad.md +1 -1
- package/docs/modules/util_to_int.md +1 -1
- package/docs/modules/util_valid_callable.md +1 -1
- package/docs/modules/util_valid_object.md +1 -1
- package/docs/modules/wrap_event_emitter.md +2 -2
- package/lib/default-methods.js +34 -6
- package/package.json +1 -1
- package/src/default-methods.js +26 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.0.0-alpha.7](https://github.com/snowyu/events-ex.js/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2024-03-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* The listener throw error should not broke the notification, but it will emit error after notification. ([7dce4f6](https://github.com/snowyu/events-ex.js/commit/7dce4f68c516a0169fa4f64f3a5c5277f0c2b743))
|
|
11
|
+
|
|
5
12
|
## [2.0.0-alpha.6](https://github.com/snowyu/events-ex.js/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-15)
|
|
6
13
|
|
|
7
14
|
## [2.0.0-alpha.5](https://github.com/snowyu/events-ex.js/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2024-03-15)
|
package/README.cn.md
CHANGED
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Browser-friendly enhanced event emitter [ability][Ability] and class. It's modif
|
|
|
31
31
|
+ Adds listenerCount() class method to keep compatibility with node events.
|
|
32
32
|
* Adds async event emitting via `emitAsync` method.
|
|
33
33
|
|
|
34
|
+
Note: The listener throw error should not broke the notification, but it will emit error(`emit('error', error, 'notify', listener, args)`) after notification.
|
|
34
35
|
|
|
35
36
|
### Installation
|
|
36
37
|
|
package/docs/README.md
CHANGED
|
@@ -32,6 +32,8 @@ Browser-friendly enhanced event emitter [ability][Ability] and class. It's modif
|
|
|
32
32
|
+ Adds listenerCount() class method to keep compatibility with node events.
|
|
33
33
|
* Adds async event emitting via `emitAsync` method.
|
|
34
34
|
|
|
35
|
+
Note: The listener throw error should not broke the notification, but it will emit error(`emit('error', error, 'notify', listener, args)`) after notification.
|
|
36
|
+
|
|
35
37
|
### Installation
|
|
36
38
|
|
|
37
39
|
```bash
|
|
@@ -47,7 +47,7 @@ Event Object that contains information about the event, such as the target eleme
|
|
|
47
47
|
|
|
48
48
|
#### Defined in
|
|
49
49
|
|
|
50
|
-
[src/event.js:8](https://github.com/snowyu/events-ex.js/blob/
|
|
50
|
+
[src/event.js:8](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L8)
|
|
51
51
|
|
|
52
52
|
## Properties
|
|
53
53
|
|
|
@@ -59,7 +59,7 @@ Keep your event result here if any.
|
|
|
59
59
|
|
|
60
60
|
#### Defined in
|
|
61
61
|
|
|
62
|
-
[src/event.js:38](https://github.com/snowyu/events-ex.js/blob/
|
|
62
|
+
[src/event.js:38](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L38)
|
|
63
63
|
|
|
64
64
|
___
|
|
65
65
|
|
|
@@ -71,7 +71,7 @@ Whether stop the bubbling event
|
|
|
71
71
|
|
|
72
72
|
#### Defined in
|
|
73
73
|
|
|
74
|
-
[src/event.js:32](https://github.com/snowyu/events-ex.js/blob/
|
|
74
|
+
[src/event.js:32](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L32)
|
|
75
75
|
|
|
76
76
|
___
|
|
77
77
|
|
|
@@ -83,7 +83,7 @@ Who trigger the event
|
|
|
83
83
|
|
|
84
84
|
#### Defined in
|
|
85
85
|
|
|
86
|
-
[src/event.js:26](https://github.com/snowyu/events-ex.js/blob/
|
|
86
|
+
[src/event.js:26](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L26)
|
|
87
87
|
|
|
88
88
|
## Methods
|
|
89
89
|
|
|
@@ -101,7 +101,7 @@ The result of the event.
|
|
|
101
101
|
|
|
102
102
|
#### Defined in
|
|
103
103
|
|
|
104
|
-
[src/event.js:45](https://github.com/snowyu/events-ex.js/blob/
|
|
104
|
+
[src/event.js:45](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L45)
|
|
105
105
|
|
|
106
106
|
___
|
|
107
107
|
|
|
@@ -123,4 +123,4 @@ Initializes the event with the target object.
|
|
|
123
123
|
|
|
124
124
|
#### Defined in
|
|
125
125
|
|
|
126
|
-
[src/event.js:20](https://github.com/snowyu/events-ex.js/blob/
|
|
126
|
+
[src/event.js:20](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event.js#L20)
|
|
@@ -26,4 +26,4 @@ Class that represents an event emitter.
|
|
|
26
26
|
|
|
27
27
|
#### Defined in
|
|
28
28
|
|
|
29
|
-
[src/event-emitter.js:7](https://github.com/snowyu/events-ex.js/blob/
|
|
29
|
+
[src/event-emitter.js:7](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.js#L7)
|
|
@@ -47,7 +47,7 @@ Class that represents an event emitter.
|
|
|
47
47
|
|
|
48
48
|
#### Defined in
|
|
49
49
|
|
|
50
|
-
[src/event-emitter.d.ts:7](https://github.com/snowyu/events-ex.js/blob/
|
|
50
|
+
[src/event-emitter.d.ts:7](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L7)
|
|
51
51
|
|
|
52
52
|
## Methods
|
|
53
53
|
|
|
@@ -72,7 +72,7 @@ The result of the event.
|
|
|
72
72
|
|
|
73
73
|
#### Defined in
|
|
74
74
|
|
|
75
|
-
[src/event-emitter.d.ts:38](https://github.com/snowyu/events-ex.js/blob/
|
|
75
|
+
[src/event-emitter.d.ts:38](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L38)
|
|
76
76
|
|
|
77
77
|
___
|
|
78
78
|
|
|
@@ -97,7 +97,7 @@ A promise that resolves with the result of the event.
|
|
|
97
97
|
|
|
98
98
|
#### Defined in
|
|
99
99
|
|
|
100
|
-
[src/event-emitter.d.ts:44](https://github.com/snowyu/events-ex.js/blob/
|
|
100
|
+
[src/event-emitter.d.ts:44](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L44)
|
|
101
101
|
|
|
102
102
|
___
|
|
103
103
|
|
|
@@ -121,7 +121,7 @@ Returns the count of listeners that are registered to listen for the specified e
|
|
|
121
121
|
|
|
122
122
|
#### Defined in
|
|
123
123
|
|
|
124
|
-
[src/event-emitter.d.ts:66](https://github.com/snowyu/events-ex.js/blob/
|
|
124
|
+
[src/event-emitter.d.ts:66](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L66)
|
|
125
125
|
|
|
126
126
|
___
|
|
127
127
|
|
|
@@ -145,7 +145,7 @@ Returns an array of functions that are registered to listen for the specified ev
|
|
|
145
145
|
|
|
146
146
|
#### Defined in
|
|
147
147
|
|
|
148
|
-
[src/event-emitter.d.ts:59](https://github.com/snowyu/events-ex.js/blob/
|
|
148
|
+
[src/event-emitter.d.ts:59](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L59)
|
|
149
149
|
|
|
150
150
|
___
|
|
151
151
|
|
|
@@ -174,7 +174,7 @@ If the listener is not a function.
|
|
|
174
174
|
|
|
175
175
|
#### Defined in
|
|
176
176
|
|
|
177
|
-
[src/event-emitter.d.ts:32](https://github.com/snowyu/events-ex.js/blob/
|
|
177
|
+
[src/event-emitter.d.ts:32](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L32)
|
|
178
178
|
|
|
179
179
|
___
|
|
180
180
|
|
|
@@ -203,7 +203,7 @@ If the listener is not a function.
|
|
|
203
203
|
|
|
204
204
|
#### Defined in
|
|
205
205
|
|
|
206
|
-
[src/event-emitter.d.ts:16](https://github.com/snowyu/events-ex.js/blob/
|
|
206
|
+
[src/event-emitter.d.ts:16](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L16)
|
|
207
207
|
|
|
208
208
|
___
|
|
209
209
|
|
|
@@ -232,7 +232,7 @@ If the listener is not a function.
|
|
|
232
232
|
|
|
233
233
|
#### Defined in
|
|
234
234
|
|
|
235
|
-
[src/event-emitter.d.ts:24](https://github.com/snowyu/events-ex.js/blob/
|
|
235
|
+
[src/event-emitter.d.ts:24](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L24)
|
|
236
236
|
|
|
237
237
|
___
|
|
238
238
|
|
|
@@ -256,7 +256,7 @@ Removes all listeners for a specific event or all events from an event emitter.
|
|
|
256
256
|
|
|
257
257
|
#### Defined in
|
|
258
258
|
|
|
259
|
-
[src/event-emitter.d.ts:51](https://github.com/snowyu/events-ex.js/blob/
|
|
259
|
+
[src/event-emitter.d.ts:51](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L51)
|
|
260
260
|
|
|
261
261
|
___
|
|
262
262
|
|
|
@@ -276,7 +276,7 @@ ___
|
|
|
276
276
|
|
|
277
277
|
#### Defined in
|
|
278
278
|
|
|
279
|
-
[src/event-emitter.d.ts:52](https://github.com/snowyu/events-ex.js/blob/
|
|
279
|
+
[src/event-emitter.d.ts:52](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L52)
|
|
280
280
|
|
|
281
281
|
___
|
|
282
282
|
|
|
@@ -297,4 +297,4 @@ ___
|
|
|
297
297
|
|
|
298
298
|
#### Defined in
|
|
299
299
|
|
|
300
|
-
[src/event-emitter.d.ts:67](https://github.com/snowyu/events-ex.js/blob/
|
|
300
|
+
[src/event-emitter.d.ts:67](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/event-emitter.d.ts#L67)
|
package/docs/modules/all_off.md
CHANGED
|
@@ -41,4 +41,4 @@ Removes all listeners for a specific event or all events from an event emitter.
|
|
|
41
41
|
|
|
42
42
|
#### Defined in
|
|
43
43
|
|
|
44
|
-
[src/all-off.js:12](https://github.com/snowyu/events-ex.js/blob/
|
|
44
|
+
[src/all-off.js:12](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/all-off.js#L12)
|
package/docs/modules/consts.md
CHANGED
|
@@ -48,4 +48,4 @@ Renames and re-exports [getEventableMethods](default_methods.md#geteventablemeth
|
|
|
48
48
|
|
|
49
49
|
#### Defined in
|
|
50
50
|
|
|
51
|
-
[src/default-methods.js:8](https://github.com/snowyu/events-ex.js/blob/
|
|
51
|
+
[src/default-methods.js:8](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/default-methods.js#L8)
|
|
@@ -37,4 +37,4 @@ Renames and re-exports [hasListeners](has_listeners.md#haslisteners)
|
|
|
37
37
|
|
|
38
38
|
#### Defined in
|
|
39
39
|
|
|
40
|
-
[src/has-listeners.js:10](https://github.com/snowyu/events-ex.js/blob/
|
|
40
|
+
[src/has-listeners.js:10](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/has-listeners.js#L10)
|
package/docs/modules/pipe.md
CHANGED
|
@@ -46,4 +46,4 @@ Creates a pipeline between two event emitters, so that any events emitted by the
|
|
|
46
46
|
|
|
47
47
|
#### Defined in
|
|
48
48
|
|
|
49
|
-
[src/pipe.js:21](https://github.com/snowyu/events-ex.js/blob/
|
|
49
|
+
[src/pipe.js:21](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/pipe.js#L21)
|
|
@@ -46,4 +46,4 @@ Creates a pipeline between two event emitters, so that any events emitted by the
|
|
|
46
46
|
|
|
47
47
|
#### Defined in
|
|
48
48
|
|
|
49
|
-
[src/pipe-async.js:21](https://github.com/snowyu/events-ex.js/blob/
|
|
49
|
+
[src/pipe-async.js:21](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/pipe-async.js#L21)
|
package/docs/modules/unify.md
CHANGED
|
@@ -43,4 +43,4 @@ Unifies the event listeners of two event emitter objects so that they share the
|
|
|
43
43
|
|
|
44
44
|
#### Defined in
|
|
45
45
|
|
|
46
|
-
[src/unify.js:17](https://github.com/snowyu/events-ex.js/blob/
|
|
46
|
+
[src/unify.js:17](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/unify.js#L17)
|
|
@@ -36,4 +36,4 @@ Renames and re-exports [remove](util_array_remove.md#remove)
|
|
|
36
36
|
|
|
37
37
|
#### Defined in
|
|
38
38
|
|
|
39
|
-
[src/util/array-remove.js:5](https://github.com/snowyu/events-ex.js/blob/
|
|
39
|
+
[src/util/array-remove.js:5](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/array-remove.js#L5)
|
|
@@ -38,4 +38,4 @@ Renames and re-exports [forEach](util_object_for_each.md#foreach)
|
|
|
38
38
|
|
|
39
39
|
#### Defined in
|
|
40
40
|
|
|
41
|
-
[src/util/object-for-each.js:6](https://github.com/snowyu/events-ex.js/blob/
|
|
41
|
+
[src/util/object-for-each.js:6](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/object-for-each.js#L6)
|
|
@@ -37,4 +37,4 @@ Renames and re-exports [pad](util_string_pad.md#pad)
|
|
|
37
37
|
|
|
38
38
|
#### Defined in
|
|
39
39
|
|
|
40
|
-
[src/util/string-pad.js:8](https://github.com/snowyu/events-ex.js/blob/
|
|
40
|
+
[src/util/string-pad.js:8](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/string-pad.js#L8)
|
|
@@ -36,4 +36,4 @@ Renames and re-exports [toInt](util_to_int.md#toint)
|
|
|
36
36
|
|
|
37
37
|
#### Defined in
|
|
38
38
|
|
|
39
|
-
[src/util/to-int.js:2](https://github.com/snowyu/events-ex.js/blob/
|
|
39
|
+
[src/util/to-int.js:2](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/to-int.js#L2)
|
|
@@ -36,4 +36,4 @@ Renames and re-exports [validCallable](util_valid_callable.md#validcallable)
|
|
|
36
36
|
|
|
37
37
|
#### Defined in
|
|
38
38
|
|
|
39
|
-
[src/util/valid-callable.js:1](https://github.com/snowyu/events-ex.js/blob/
|
|
39
|
+
[src/util/valid-callable.js:1](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/valid-callable.js#L1)
|
|
@@ -36,4 +36,4 @@ Renames and re-exports [validObject](util_valid_object.md#validobject)
|
|
|
36
36
|
|
|
37
37
|
#### Defined in
|
|
38
38
|
|
|
39
|
-
[src/util/valid-object.js:3](https://github.com/snowyu/events-ex.js/blob/
|
|
39
|
+
[src/util/valid-object.js:3](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/util/valid-object.js#L3)
|
|
@@ -30,7 +30,7 @@ Renames and re-exports [wrapEventEmitter](wrap_event_emitter.md#wrapeventemitter
|
|
|
30
30
|
|
|
31
31
|
#### Defined in
|
|
32
32
|
|
|
33
|
-
[src/wrap-event-emitter.js:6](https://github.com/snowyu/events-ex.js/blob/
|
|
33
|
+
[src/wrap-event-emitter.js:6](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/wrap-event-emitter.js#L6)
|
|
34
34
|
|
|
35
35
|
## Functions
|
|
36
36
|
|
|
@@ -54,4 +54,4 @@ o or new Event instance
|
|
|
54
54
|
|
|
55
55
|
#### Defined in
|
|
56
56
|
|
|
57
|
-
[src/wrap-event-emitter.js:33](https://github.com/snowyu/events-ex.js/blob/
|
|
57
|
+
[src/wrap-event-emitter.js:33](https://github.com/snowyu/events-ex.js/blob/7dce4f6/src/wrap-event-emitter.js#L33)
|
package/lib/default-methods.js
CHANGED
|
@@ -95,16 +95,30 @@ function getEventableMethods(aClass) {
|
|
|
95
95
|
const args = r.args;
|
|
96
96
|
const listeners = r.listeners;
|
|
97
97
|
const evt = (0, _event.Event)(this);
|
|
98
|
+
const errs = [];
|
|
98
99
|
try {
|
|
99
100
|
let i = 0;
|
|
100
101
|
let listener;
|
|
101
102
|
while (listener = listeners[i]) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
try {
|
|
104
|
+
_notify(listener, evt, args);
|
|
105
|
+
if (evt.stopped) {
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
} catch (err) {
|
|
109
|
+
errs.push({
|
|
110
|
+
err: err,
|
|
111
|
+
listener: listener
|
|
112
|
+
});
|
|
105
113
|
}
|
|
106
114
|
++i;
|
|
107
115
|
}
|
|
116
|
+
if (errs.length) {
|
|
117
|
+
for (let i = 0; i < errs.length; i++) {
|
|
118
|
+
const it = errs[i];
|
|
119
|
+
this.emit('error', it.err, 'notify', it.listener, args);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
108
122
|
} finally {
|
|
109
123
|
// eslint-disable-next-line no-unsafe-finally
|
|
110
124
|
return evt.end();
|
|
@@ -124,11 +138,25 @@ function getEventableMethods(aClass) {
|
|
|
124
138
|
const args = r.args;
|
|
125
139
|
const listeners = r.listeners;
|
|
126
140
|
const evt = (0, _event.Event)(this);
|
|
141
|
+
const errs = [];
|
|
127
142
|
try {
|
|
128
143
|
for (const listener of listeners) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
try {
|
|
145
|
+
await _notify(listener, evt, args);
|
|
146
|
+
if (evt.stopped) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
} catch (err) {
|
|
150
|
+
errs.push({
|
|
151
|
+
err: err,
|
|
152
|
+
listener: listener
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (errs.length) {
|
|
157
|
+
for (let i = 0; i < errs.length; i++) {
|
|
158
|
+
const it = errs[i];
|
|
159
|
+
this.emit('error', it.err, 'notify', it.listener, args);
|
|
132
160
|
}
|
|
133
161
|
}
|
|
134
162
|
} finally {
|
package/package.json
CHANGED
package/src/default-methods.js
CHANGED
|
@@ -92,14 +92,25 @@ export function getEventableMethods(aClass) {
|
|
|
92
92
|
const args = r.args
|
|
93
93
|
const listeners = r.listeners
|
|
94
94
|
const evt = Event(this)
|
|
95
|
+
const errs = []
|
|
95
96
|
try {
|
|
96
97
|
let i = 0
|
|
97
98
|
let listener
|
|
98
99
|
while (listener = listeners[i]){
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
try {
|
|
101
|
+
_notify(listener, evt, args)
|
|
102
|
+
if (evt.stopped) {break}
|
|
103
|
+
} catch(err) {
|
|
104
|
+
errs.push({err: err, listener: listener})
|
|
105
|
+
}
|
|
101
106
|
++i
|
|
102
107
|
}
|
|
108
|
+
if (errs.length) {
|
|
109
|
+
for (let i=0;i<errs.length;i++) {
|
|
110
|
+
const it = errs[i]
|
|
111
|
+
this.emit('error', it.err, 'notify', it.listener, args)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
103
114
|
} finally {
|
|
104
115
|
// eslint-disable-next-line no-unsafe-finally
|
|
105
116
|
return evt.end()
|
|
@@ -117,10 +128,21 @@ export function getEventableMethods(aClass) {
|
|
|
117
128
|
const args = r.args
|
|
118
129
|
const listeners = r.listeners
|
|
119
130
|
const evt = Event(this)
|
|
131
|
+
const errs = []
|
|
120
132
|
try {
|
|
121
133
|
for (const listener of listeners) {
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
try {
|
|
135
|
+
await _notify(listener, evt, args);
|
|
136
|
+
if (evt.stopped) {break}
|
|
137
|
+
} catch(err) {
|
|
138
|
+
errs.push({err: err, listener: listener})
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (errs.length) {
|
|
142
|
+
for (let i=0;i<errs.length;i++) {
|
|
143
|
+
const it = errs[i]
|
|
144
|
+
this.emit('error', it.err, 'notify', it.listener, args)
|
|
145
|
+
}
|
|
124
146
|
}
|
|
125
147
|
} finally {
|
|
126
148
|
// eslint-disable-next-line no-unsafe-finally
|