Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Gruenbaum <benjamingr@gmail.com>2020-05-30 02:56:01 +0300
committerJames M Snell <jasnell@gmail.com>2020-06-24 03:08:10 +0300
commit9d324f0441688cef6b9403f2492e6d41cc6a2fc2 (patch)
treebfcbdb1faf4fec55a6eeb42eba1a5dde1b77e1c8 /lib/internal/event_target.js
parenta30babf6720f1afaa47dfc47c7e970f541cce312 (diff)
events: expose Event statics
PR-URL: https://github.com/nodejs/node/pull/34015 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/internal/event_target.js')
-rw-r--r--lib/internal/event_target.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js
index fd26a37df3f..7c34acd5c5d 100644
--- a/lib/internal/event_target.js
+++ b/lib/internal/event_target.js
@@ -125,7 +125,7 @@ class Event {
get bubbles() { return this.#bubbles; }
get composed() { return this.#composed; }
get eventPhase() {
- return this[kTarget] ? 2 : 0; // Equivalent to AT_TARGET or NONE
+ return this[kTarget] ? Event.AT_TARGET : Event.NONE;
}
get cancelBubble() { return this.#propagationStopped; }
set cancelBubble(value) {
@@ -136,6 +136,11 @@ class Event {
stopPropagation() {
this.#propagationStopped = true;
}
+
+ static NONE = 0;
+ static CAPTURING_PHASE = 1;
+ static AT_TARGET = 2;
+ static BUBBLING_PHASE = 3;
}
Object.defineProperty(Event.prototype, SymbolToStringTag, {