initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
14
github/codeql-action-v1/node_modules/nise/lib/event/custom-event.js
generated
vendored
Normal file
14
github/codeql-action-v1/node_modules/nise/lib/event/custom-event.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
|
||||
var Event = require("./event");
|
||||
|
||||
function CustomEvent(type, customData, target) {
|
||||
this.initEvent(type, false, false, target);
|
||||
this.detail = customData.detail || null;
|
||||
}
|
||||
|
||||
CustomEvent.prototype = new Event();
|
||||
|
||||
CustomEvent.prototype.constructor = CustomEvent;
|
||||
|
||||
module.exports = CustomEvent;
|
||||
122
github/codeql-action-v1/node_modules/nise/lib/event/event-target.js
generated
vendored
Normal file
122
github/codeql-action-v1/node_modules/nise/lib/event/event-target.js
generated
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
"use strict";
|
||||
|
||||
function flattenOptions(options) {
|
||||
if (options !== Object(options)) {
|
||||
return {
|
||||
capture: Boolean(options),
|
||||
once: false,
|
||||
passive: false
|
||||
};
|
||||
}
|
||||
return {
|
||||
capture: Boolean(options.capture),
|
||||
once: Boolean(options.once),
|
||||
passive: Boolean(options.passive)
|
||||
};
|
||||
}
|
||||
function not(fn) {
|
||||
return function() {
|
||||
return !fn.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
function hasListenerFilter(listener, capture) {
|
||||
return function(listenerSpec) {
|
||||
return (
|
||||
listenerSpec.capture === capture &&
|
||||
listenerSpec.listener === listener
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
var EventTarget = {
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener
|
||||
addEventListener: function addEventListener(
|
||||
event,
|
||||
listener,
|
||||
providedOptions
|
||||
) {
|
||||
// 3. Let capture, passive, and once be the result of flattening more options.
|
||||
// Flatten property before executing step 2,
|
||||
// feture detection is usually based on registering handler with options object,
|
||||
// that has getter defined
|
||||
// addEventListener("load", () => {}, {
|
||||
// get once() { supportsOnce = true; }
|
||||
// });
|
||||
var options = flattenOptions(providedOptions);
|
||||
|
||||
// 2. If callback is null, then return.
|
||||
if (listener === null || listener === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.eventListeners = this.eventListeners || {};
|
||||
this.eventListeners[event] = this.eventListeners[event] || [];
|
||||
|
||||
// 4. If context object’s associated list of event listener
|
||||
// does not contain an event listener whose type is type,
|
||||
// callback is callback, and capture is capture, then append
|
||||
// a new event listener to it, whose type is type, callback is
|
||||
// callback, capture is capture, passive is passive, and once is once.
|
||||
if (
|
||||
!this.eventListeners[event].some(
|
||||
hasListenerFilter(listener, options.capture)
|
||||
)
|
||||
) {
|
||||
this.eventListeners[event].push({
|
||||
listener: listener,
|
||||
capture: options.capture,
|
||||
once: options.once
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
|
||||
removeEventListener: function removeEventListener(
|
||||
event,
|
||||
listener,
|
||||
providedOptions
|
||||
) {
|
||||
if (!this.eventListeners || !this.eventListeners[event]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. Let capture be the result of flattening options.
|
||||
var options = flattenOptions(providedOptions);
|
||||
|
||||
// 3. If there is an event listener in the associated list of
|
||||
// event listeners whose type is type, callback is callback,
|
||||
// and capture is capture, then set that event listener’s
|
||||
// removed to true and remove it from the associated list of event listeners.
|
||||
this.eventListeners[event] = this.eventListeners[event].filter(
|
||||
not(hasListenerFilter(listener, options.capture))
|
||||
);
|
||||
},
|
||||
|
||||
dispatchEvent: function dispatchEvent(event) {
|
||||
if (!this.eventListeners || !this.eventListeners[event.type]) {
|
||||
return Boolean(event.defaultPrevented);
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var type = event.type;
|
||||
var listeners = self.eventListeners[type];
|
||||
|
||||
// Remove listeners, that should be dispatched once
|
||||
// before running dispatch loop to avoid nested dispatch issues
|
||||
self.eventListeners[type] = listeners.filter(function(listenerSpec) {
|
||||
return !listenerSpec.once;
|
||||
});
|
||||
listeners.forEach(function(listenerSpec) {
|
||||
var listener = listenerSpec.listener;
|
||||
if (typeof listener === "function") {
|
||||
listener.call(self, event);
|
||||
} else {
|
||||
listener.handleEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
return Boolean(event.defaultPrevented);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = EventTarget;
|
||||
24
github/codeql-action-v1/node_modules/nise/lib/event/event.js
generated
vendored
Normal file
24
github/codeql-action-v1/node_modules/nise/lib/event/event.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
|
||||
function Event(type, bubbles, cancelable, target) {
|
||||
this.initEvent(type, bubbles, cancelable, target);
|
||||
}
|
||||
|
||||
Event.prototype = {
|
||||
initEvent: function(type, bubbles, cancelable, target) {
|
||||
this.type = type;
|
||||
this.bubbles = bubbles;
|
||||
this.cancelable = cancelable;
|
||||
this.target = target;
|
||||
this.currentTarget = target;
|
||||
},
|
||||
|
||||
// eslint-disable-next-line no-empty-function
|
||||
stopPropagation: function() {},
|
||||
|
||||
preventDefault: function() {
|
||||
this.defaultPrevented = true;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Event;
|
||||
8
github/codeql-action-v1/node_modules/nise/lib/event/index.js
generated
vendored
Normal file
8
github/codeql-action-v1/node_modules/nise/lib/event/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
Event: require("./event"),
|
||||
ProgressEvent: require("./progress-event"),
|
||||
CustomEvent: require("./custom-event"),
|
||||
EventTarget: require("./event-target")
|
||||
};
|
||||
22
github/codeql-action-v1/node_modules/nise/lib/event/progress-event.js
generated
vendored
Normal file
22
github/codeql-action-v1/node_modules/nise/lib/event/progress-event.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
|
||||
var Event = require("./event");
|
||||
|
||||
function ProgressEvent(type, progressEventRaw, target) {
|
||||
this.initEvent(type, false, false, target);
|
||||
this.loaded =
|
||||
typeof progressEventRaw.loaded === "number"
|
||||
? progressEventRaw.loaded
|
||||
: null;
|
||||
this.total =
|
||||
typeof progressEventRaw.total === "number"
|
||||
? progressEventRaw.total
|
||||
: null;
|
||||
this.lengthComputable = Boolean(progressEventRaw.total);
|
||||
}
|
||||
|
||||
ProgressEvent.prototype = new Event();
|
||||
|
||||
ProgressEvent.prototype.constructor = ProgressEvent;
|
||||
|
||||
module.exports = ProgressEvent;
|
||||
Loading…
Add table
Add a link
Reference in a new issue