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 — events: define event handler as enumerable · nodejs/node@6e21e82

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • event_target.js
  • test/parallel
    • test-eventtarget.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/event_target.js‎

Copy file name to clipboardExpand all lines: lib/internal/event_target.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,9 @@ function defineEventHandler(emitter, name) {
591591
emitter.addEventListener(name, value);
592592
}
593593
eventHandlerValue = value;
594-
}
594+
},
595+
configurable: true,
596+
enumerable: true
595597
});
596598
}
597599
module.exports = {
Collapse file

‎test/parallel/test-eventtarget.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-eventtarget.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,3 +517,10 @@ let asyncTest = Promise.resolve();
517517
}));
518518
target.dispatchEvent(new Event('foo'));
519519
}
520+
{
521+
const target = new EventTarget();
522+
defineEventHandler(target, 'foo');
523+
const descriptor = Object.getOwnPropertyDescriptor(target, 'onfoo');
524+
strictEqual(descriptor.configurable, true);
525+
strictEqual(descriptor.enumerable, true);
526+
}

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.