GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: make `test-eventemitter-asyncresource.js` shorter · nodejs/node@ab9c2df

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-eventemitter-asyncresource.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-eventemitter-asyncresource.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eventemitter-asyncresource.js
+11-14Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,14 @@ throws(
143143
{ code: 'ERR_INVALID_THIS' }
144144
);
145145

146-
throws(
147-
() => Reflect.get(EventEmitterAsyncResource.prototype, 'asyncId', {}),
148-
{ code: 'ERR_INVALID_THIS' }
149-
);
150-
151-
throws(
152-
() => Reflect.get(EventEmitterAsyncResource.prototype, 'triggerAsyncId', {}),
153-
{ code: 'ERR_INVALID_THIS' }
154-
);
155-
156-
throws(
157-
() => Reflect.get(EventEmitterAsyncResource.prototype, 'asyncResource', {}),
158-
{ code: 'ERR_INVALID_THIS' }
159-
);
146+
['asyncId', 'triggerAsyncId', 'asyncResource'].forEach((getter) => {
147+
throws(
148+
() => Reflect.get(EventEmitterAsyncResource.prototype, getter, {}),
149+
{
150+
code: 'ERR_INVALID_THIS',
151+
name: /TypeError/,
152+
message: 'Value of "this" must be of type EventEmitterAsyncResource',
153+
stack: new RegExp(`at get ${getter}`)
154+
}
155+
);
156+
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.