fake-indexeddb
Version:
Fake IndexedDB: a pure JS in-memory implementation of the IndexedDB API
45 lines (43 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class Event {
eventPath = [];
NONE = 0;
CAPTURING_PHASE = 1;
AT_TARGET = 2;
BUBBLING_PHASE = 3;
// Flags
propagationStopped = false;
immediatePropagationStopped = false;
canceled = false;
initialized = true;
dispatched = false;
target = null;
currentTarget = null;
eventPhase = 0;
defaultPrevented = false;
isTrusted = false;
timeStamp = Date.now();
constructor(type, eventInitDict = {}) {
this.type = type;
this.bubbles = eventInitDict.bubbles !== undefined ? eventInitDict.bubbles : false;
this.cancelable = eventInitDict.cancelable !== undefined ? eventInitDict.cancelable : false;
}
preventDefault() {
if (this.cancelable) {
this.canceled = true;
}
}
stopPropagation() {
this.propagationStopped = true;
}
stopImmediatePropagation() {
this.propagationStopped = true;
this.immediatePropagationStopped = true;
}
}
var _default = exports.default = Event;
module.exports = exports.default;