| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 160c88e commit c3fe907
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ function NoConstructor() { | |||
| 18 | 18 | name: 'TypeError', | |
| 19 | 19 | code: 'ERR_INVALID_ARG_TYPE', | |
| 20 | 20 | message: 'The "options.captureRejections" property must be of type boolean.' + | |
| 21 | - common.invalidArgTypeHelper(arg) | ||
| 21 | + common.invalidArgTypeHelper(arg), | ||
| 22 | 22 | } | |
| 23 | 23 | ); | |
| 24 | 24 | }); | |
@@ -160,7 +160,7 @@ function thenable() { | |||
| 160 | 160 | assert.strictEqual(resolved, undefined); | |
| 161 | 161 | rejected(_err); | |
| 162 | 162 | }); | |
| 163 | - }, 1) // Only 1 call for Promises/A+ compat. | ||
| 163 | + }, 1), // Only 1 call for Promises/A+ compat. | ||
| 164 | 164 | }); | |
| 165 | 165 | ||
| 166 | 166 | return obj; | |
@@ -235,7 +235,7 @@ function thenableThatThrows() { | |||
| 235 | 235 | Object.defineProperty(obj, 'then', { | |
| 236 | 236 | get: common.mustCall(() => { | |
| 237 | 237 | throw _err; | |
| 238 | - }, 1) // Only 1 call for Promises/A+ compat. | ||
| 238 | + }, 1), // Only 1 call for Promises/A+ compat. | ||
| 239 | 239 | }); | |
| 240 | 240 | ||
| 241 | 241 | return obj; | |
@@ -301,14 +301,14 @@ function argValidation() { | |||
| 301 | 301 | code: 'ERR_INVALID_ARG_TYPE', | |
| 302 | 302 | name: 'TypeError', | |
| 303 | 303 | message: 'The "options.captureRejections" property must be of type ' + | |
| 304 | - `boolean. Received ${received}` | ||
| 304 | + `boolean. Received ${received}`, | ||
| 305 | 305 | }); | |
| 306 | 306 | ||
| 307 | 307 | assert.throws(() => EventEmitter.captureRejections = obj, { | |
| 308 | 308 | code: 'ERR_INVALID_ARG_TYPE', | |
| 309 | 309 | name: 'TypeError', | |
| 310 | 310 | message: 'The "EventEmitter.captureRejections" property must be of ' + | |
| 311 | - `type boolean. Received ${received}` | ||
| 311 | + `type boolean. Received ${received}`, | ||
| 312 | 312 | }); | |
| 313 | 313 | } | |
| 314 | 314 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ assert.throws( | |||
| 11 | 11 | { | |
| 12 | 12 | code: 'ERR_UNHANDLED_ERROR', | |
| 13 | 13 | name: 'Error', | |
| 14 | - message: "Unhandled error. ('Accepts a string')" | ||
| 14 | + message: "Unhandled error. ('Accepts a string')", | ||
| 15 | 15 | } | |
| 16 | 16 | ); | |
| 17 | 17 | ||
@@ -20,18 +20,18 @@ assert.throws( | |||
| 20 | 20 | { | |
| 21 | 21 | code: 'ERR_UNHANDLED_ERROR', | |
| 22 | 22 | name: 'Error', | |
| 23 | - message: "Unhandled error. ({ message: 'Error!' })" | ||
| 23 | + message: "Unhandled error. ({ message: 'Error!' })", | ||
| 24 | 24 | } | |
| 25 | 25 | ); | |
| 26 | 26 | ||
| 27 | 27 | assert.throws( | |
| 28 | 28 | () => EE.emit('error', { | |
| 29 | 29 | message: 'Error!', | |
| 30 | - [util.inspect.custom]() { throw new Error(); } | ||
| 30 | + [util.inspect.custom]() { throw new Error(); }, | ||
| 31 | 31 | }), | |
| 32 | 32 | { | |
| 33 | 33 | code: 'ERR_UNHANDLED_ERROR', | |
| 34 | 34 | name: 'Error', | |
| 35 | - message: 'Unhandled error. ([object Object])' | ||
| 35 | + message: 'Unhandled error. ([object Object])', | ||
| 36 | 36 | } | |
| 37 | 37 | ); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,6 @@ for (const method of eventsMethods) { | |||
| 15 | 15 | code: 'ERR_INVALID_ARG_TYPE', | |
| 16 | 16 | name: 'TypeError', | |
| 17 | 17 | message: 'The "listener" argument must be of type function. ' + | |
| 18 | - 'Received null' | ||
| 18 | + 'Received null', | ||
| 19 | 19 | }, `event.${method}('foo', null) should throw the proper error`); | |
| 20 | 20 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ for (const obj of throwsObjs) { | |||
| 40 | 40 | code: 'ERR_OUT_OF_RANGE', | |
| 41 | 41 | name: 'RangeError', | |
| 42 | 42 | message: 'The value of "n" is out of range. ' + | |
| 43 | - `It must be a non-negative number. Received ${inspect(obj)}` | ||
| 43 | + `It must be a non-negative number. Received ${inspect(obj)}`, | ||
| 44 | 44 | } | |
| 45 | 45 | ); | |
| 46 | 46 | ||
@@ -50,7 +50,7 @@ for (const obj of throwsObjs) { | |||
| 50 | 50 | code: 'ERR_OUT_OF_RANGE', | |
| 51 | 51 | name: 'RangeError', | |
| 52 | 52 | message: 'The value of "defaultMaxListeners" is out of range. ' + | |
| 53 | - `It must be a non-negative number. Received ${inspect(obj)}` | ||
| 53 | + `It must be a non-negative number. Received ${inspect(obj)}`, | ||
| 54 | 54 | } | |
| 55 | 55 | ); | |
| 56 | 56 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ function makeHook(trackedTypes) { | |||
| 41 | 41 | ||
| 42 | 42 | before(asyncId) { log(asyncId, 'before'); }, | |
| 43 | 43 | after(asyncId) { log(asyncId, 'after'); }, | |
| 44 | - destroy(asyncId) { log(asyncId, 'destroy'); } | ||
| 44 | + destroy(asyncId) { log(asyncId, 'destroy'); }, | ||
| 45 | 45 | }).enable(); | |
| 46 | 46 | ||
| 47 | 47 | return { | |
@@ -51,7 +51,7 @@ function makeHook(trackedTypes) { | |||
| 51 | 51 | }, | |
| 52 | 52 | ids() { | |
| 53 | 53 | return new Set(eventMap.keys()); | |
| 54 | - } | ||
| 54 | + }, | ||
| 55 | 55 | }; | |
| 56 | 56 | } | |
| 57 | 57 | ||
@@ -150,7 +150,7 @@ throws( | |||
| 150 | 150 | code: 'ERR_INVALID_THIS', | |
| 151 | 151 | name: /TypeError/, | |
| 152 | 152 | message: 'Value of "this" must be of type EventEmitterAsyncResource', | |
| 153 | - stack: new RegExp(`at get ${getter}`) | ||
| 153 | + stack: new RegExp(`at get ${getter}`), | ||
| 154 | 154 | } | |
| 155 | 155 | ); | |
| 156 | 156 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ const common = require('../common'); | |||
| 5 | 5 | const assert = require('assert'); | |
| 6 | 6 | const { on, EventEmitter } = require('events'); | |
| 7 | 7 | const { | |
| 8 | - NodeEventTarget | ||
| 8 | + NodeEventTarget, | ||
| 9 | 9 | } = require('internal/event_target'); | |
| 10 | 10 | ||
| 11 | 11 | async function basic() { | |
@@ -131,18 +131,18 @@ async function next() { | |||
| 131 | 131 | ||
| 132 | 132 | assert.deepStrictEqual(results, [{ | |
| 133 | 133 | value: ['bar'], | |
| 134 | - done: false | ||
| 134 | + done: false, | ||
| 135 | 135 | }, { | |
| 136 | 136 | value: [42], | |
| 137 | - done: false | ||
| 137 | + done: false, | ||
| 138 | 138 | }, { | |
| 139 | 139 | value: undefined, | |
| 140 | - done: true | ||
| 140 | + done: true, | ||
| 141 | 141 | }]); | |
| 142 | 142 | ||
| 143 | 143 | assert.deepStrictEqual(await iterable.next(), { | |
| 144 | 144 | value: undefined, | |
| 145 | - done: true | ||
| 145 | + done: true, | ||
| 146 | 146 | }); | |
| 147 | 147 | } | |
| 148 | 148 | ||
@@ -160,19 +160,19 @@ async function nextError() { | |||
| 160 | 160 | ]); | |
| 161 | 161 | assert.deepStrictEqual(results, [{ | |
| 162 | 162 | status: 'rejected', | |
| 163 | - reason: _err | ||
| 163 | + reason: _err, | ||
| 164 | 164 | }, { | |
| 165 | 165 | status: 'fulfilled', | |
| 166 | 166 | value: { | |
| 167 | 167 | value: undefined, | |
| 168 | - done: true | ||
| 169 | - } | ||
| 168 | + done: true, | ||
| 169 | + }, | ||
| 170 | 170 | }, { | |
| 171 | 171 | status: 'fulfilled', | |
| 172 | 172 | value: { | |
| 173 | 173 | value: undefined, | |
| 174 | - done: true | ||
| 175 | - } | ||
| 174 | + done: true, | ||
| 175 | + }, | ||
| 176 | 176 | }]); | |
| 177 | 177 | assert.strictEqual(ee.listeners('error').length, 0); | |
| 178 | 178 | } | |
@@ -196,7 +196,7 @@ async function iterableThrow() { | |||
| 196 | 196 | }, { | |
| 197 | 197 | message: 'The "EventEmitter.AsyncIterator" property must be' + | |
| 198 | 198 | ' an instance of Error. Received undefined', | |
| 199 | - name: 'TypeError' | ||
| 199 | + name: 'TypeError', | ||
| 200 | 200 | }); | |
| 201 | 201 | ||
| 202 | 202 | const expected = [['bar'], [42]]; | |
@@ -258,11 +258,11 @@ async function abortableOnBefore() { | |||
| 258 | 258 | const abortedSignal = AbortSignal.abort(); | |
| 259 | 259 | [1, {}, null, false, 'hi'].forEach((signal) => { | |
| 260 | 260 | assert.throws(() => on(ee, 'foo', { signal }), { | |
| 261 | - code: 'ERR_INVALID_ARG_TYPE' | ||
| 261 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 262 | 262 | }); | |
| 263 | 263 | }); | |
| 264 | 264 | assert.throws(() => on(ee, 'foo', { signal: abortedSignal }), { | |
| 265 | - name: 'AbortError' | ||
| 265 | + name: 'AbortError', | ||
| 266 | 266 | }); | |
| 267 | 267 | } | |
| 268 | 268 | ||
@@ -271,11 +271,11 @@ async function eventTargetAbortableOnBefore() { | |||
| 271 | 271 | const abortedSignal = AbortSignal.abort(); | |
| 272 | 272 | [1, {}, null, false, 'hi'].forEach((signal) => { | |
| 273 | 273 | assert.throws(() => on(et, 'foo', { signal }), { | |
| 274 | - code: 'ERR_INVALID_ARG_TYPE' | ||
| 274 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 275 | 275 | }); | |
| 276 | 276 | }); | |
| 277 | 277 | assert.throws(() => on(et, 'foo', { signal: abortedSignal }), { | |
| 278 | - name: 'AbortError' | ||
| 278 | + name: 'AbortError', | ||
| 279 | 279 | }); | |
| 280 | 280 | } | |
| 281 | 281 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -165,12 +165,12 @@ async function abortSignalBefore() { | |||
| 165 | 165 | ||
| 166 | 166 | await Promise.all([1, {}, 'hi', null, false].map((signal) => { | |
| 167 | 167 | return rejects(once(ee, 'foo', { signal }), { | |
| 168 | - code: 'ERR_INVALID_ARG_TYPE' | ||
| 168 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 169 | 169 | }); | |
| 170 | 170 | })); | |
| 171 | 171 | ||
| 172 | 172 | return rejects(once(ee, 'foo', { signal: abortedSignal }), { | |
| 173 | - name: 'AbortError' | ||
| 173 | + name: 'AbortError', | ||
| 174 | 174 | }); | |
| 175 | 175 | } | |
| 176 | 176 | ||
@@ -179,7 +179,7 @@ async function abortSignalAfter() { | |||
| 179 | 179 | const ac = new AbortController(); | |
| 180 | 180 | ee.on('error', common.mustNotCall()); | |
| 181 | 181 | const r = rejects(once(ee, 'foo', { signal: ac.signal }), { | |
| 182 | - name: 'AbortError' | ||
| 182 | + name: 'AbortError', | ||
| 183 | 183 | }); | |
| 184 | 184 | process.nextTick(() => ac.abort()); | |
| 185 | 185 | return r; | |
@@ -217,20 +217,20 @@ async function eventTargetAbortSignalBefore() { | |||
| 217 | 217 | ||
| 218 | 218 | await Promise.all([1, {}, 'hi', null, false].map((signal) => { | |
| 219 | 219 | return rejects(once(et, 'foo', { signal }), { | |
| 220 | - code: 'ERR_INVALID_ARG_TYPE' | ||
| 220 | + code: 'ERR_INVALID_ARG_TYPE', | ||
| 221 | 221 | }); | |
| 222 | 222 | })); | |
| 223 | 223 | ||
| 224 | 224 | return rejects(once(et, 'foo', { signal: abortedSignal }), { | |
| 225 | - name: 'AbortError' | ||
| 225 | + name: 'AbortError', | ||
| 226 | 226 | }); | |
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | async function eventTargetAbortSignalAfter() { | |
| 230 | 230 | const et = new EventTarget(); | |
| 231 | 231 | const ac = new AbortController(); | |
| 232 | 232 | const r = rejects(once(et, 'foo', { signal: ac.signal }), { | |
| 233 | - name: 'AbortError' | ||
| 233 | + name: 'AbortError', | ||
| 234 | 234 | }); | |
| 235 | 235 | process.nextTick(() => ac.abort()); | |
| 236 | 236 | return r; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ const { kWeakHandler } = require('internal/event_target'); | |||
| 5 | 5 | ||
| 6 | 6 | const { | |
| 7 | 7 | deepStrictEqual, | |
| 8 | - throws | ||
| 8 | + throws, | ||
| 9 | 9 | } = require('assert'); | |
| 10 | 10 | ||
| 11 | 11 | const { getEventListeners, EventEmitter } = require('events'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | const common = require('../common'); | |
| 4 | 4 | const { | |
| 5 | 5 | setMaxListeners, | |
| 6 | - EventEmitter | ||
| 6 | + EventEmitter, | ||
| 7 | 7 | } = require('events'); | |
| 8 | 8 | const assert = require('assert'); | |
| 9 | 9 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,7 +65,7 @@ let asyncTest = Promise.resolve(); | |||
| 65 | 65 | code: 'ERR_INVALID_ARG_TYPE', | |
| 66 | 66 | name: 'TypeError', | |
| 67 | 67 | message: 'The "options" argument must be of type object.' + | |
| 68 | - common.invalidArgTypeHelper(i) | ||
| 68 | + common.invalidArgTypeHelper(i), | ||
| 69 | 69 | }) | |
| 70 | 70 | )); | |
| 71 | 71 | } | |
@@ -141,7 +141,7 @@ let asyncTest = Promise.resolve(); | |||
| 141 | 141 | handleEvent: common.mustCall(function(event) { | |
| 142 | 142 | strictEqual(event.type, 'foo'); | |
| 143 | 143 | strictEqual(this, ev2); | |
| 144 | - }) | ||
| 144 | + }), | ||
| 145 | 145 | }; | |
| 146 | 146 | ||
| 147 | 147 | eventTarget.addEventListener('foo', ev1); | |
@@ -318,15 +318,15 @@ let asyncTest = Promise.resolve(); | |||
| 318 | 318 | code: 'ERR_INVALID_ARG_TYPE', | |
| 319 | 319 | name: 'TypeError', | |
| 320 | 320 | message: 'The "event" argument must be an instance of Event.' + | |
| 321 | - common.invalidArgTypeHelper(i) | ||
| 321 | + common.invalidArgTypeHelper(i), | ||
| 322 | 322 | }); | |
| 323 | 323 | }); | |
| 324 | 324 | ||
| 325 | 325 | const err = (arg) => ({ | |
| 326 | 326 | code: 'ERR_INVALID_ARG_TYPE', | |
| 327 | 327 | name: 'TypeError', | |
| 328 | 328 | message: 'The "listener" argument must be an instance of EventListener.' + | |
| 329 | - common.invalidArgTypeHelper(arg) | ||
| 329 | + common.invalidArgTypeHelper(arg), | ||
| 330 | 330 | }); | |
| 331 | 331 | ||
| 332 | 332 | [ | |
@@ -388,7 +388,7 @@ let asyncTest = Promise.resolve(); | |||
| 388 | 388 | const event = new Event('foo'); | |
| 389 | 389 | target1.addEventListener('foo', common.mustCall((event) => { | |
| 390 | 390 | throws(() => target2.dispatchEvent(event), { | |
| 391 | - code: 'ERR_EVENT_RECURSION' | ||
| 391 | + code: 'ERR_EVENT_RECURSION', | ||
| 392 | 392 | }); | |
| 393 | 393 | })); | |
| 394 | 394 | target1.dispatchEvent(event); | |
@@ -486,7 +486,7 @@ let asyncTest = Promise.resolve(); | |||
| 486 | 486 | /a/, | |
| 487 | 487 | ].forEach((i) => { | |
| 488 | 488 | throws(() => target.dispatchEvent.call(i, event), { | |
| 489 | - code: 'ERR_INVALID_THIS' | ||
| 489 | + code: 'ERR_INVALID_THIS', | ||
| 490 | 490 | }); | |
| 491 | 491 | }); | |
| 492 | 492 | } | |
@@ -636,20 +636,20 @@ let asyncTest = Promise.resolve(); | |||
| 636 | 636 | { | |
| 637 | 637 | const ev = new Event('test'); | |
| 638 | 638 | const evConstructorName = inspect(ev, { | |
| 639 | - depth: -1 | ||
| 639 | + depth: -1, | ||
| 640 | 640 | }); | |
| 641 | 641 | strictEqual(evConstructorName, 'Event'); | |
| 642 | 642 | ||
| 643 | 643 | const inspectResult = inspect(ev, { | |
| 644 | - depth: 1 | ||
| 644 | + depth: 1, | ||
| 645 | 645 | }); | |
| 646 | 646 | ok(inspectResult.includes('Event')); | |
| 647 | 647 | } | |
| 648 | 648 | ||
| 649 | 649 | { | |
| 650 | 650 | const et = new EventTarget(); | |
| 651 | 651 | const inspectResult = inspect(et, { | |
| 652 | - depth: 1 | ||
| 652 | + depth: 1, | ||
| 653 | 653 | }); | |
| 654 | 654 | ok(inspectResult.includes('EventTarget')); | |
| 655 | 655 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments