mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update std.js
This commit is contained in:
parent
f79e1e0e65
commit
83e4c02f16
13
lib/std.js
13
lib/std.js
|
@ -351,8 +351,7 @@ StdEvent.CAPTURING_PHASE = 1; // Not used but to be compatible
|
||||||
StdEvent.AT_TARGET = 2;
|
StdEvent.AT_TARGET = 2;
|
||||||
StdEvent.BUBBLING_PHASE = 3; // Not used but to be compatible
|
StdEvent.BUBBLING_PHASE = 3; // Not used but to be compatible
|
||||||
|
|
||||||
// maybe, the "EventTarget" is preserved word
|
function StdEventTarget() {
|
||||||
function StdEventableObject() {
|
|
||||||
this.__events__ = [];
|
this.__events__ = [];
|
||||||
|
|
||||||
this.dispatchEvent = function(event, __exception__) {
|
this.dispatchEvent = function(event, __exception__) {
|
||||||
|
@ -377,9 +376,9 @@ function StdEventableObject() {
|
||||||
this.__events__.push({
|
this.__events__.push({
|
||||||
"type": type,
|
"type": type,
|
||||||
"listener": listener,
|
"listener": listener,
|
||||||
"counter": StdEventableObject.__counter__
|
"counter": StdEventTarget.__counter__
|
||||||
});
|
});
|
||||||
StdEventableObject.__counter__++;
|
StdEventTarget.__counter__++;
|
||||||
} else {
|
} else {
|
||||||
throw new TypeError("EventListener must be a function");
|
throw new TypeError("EventListener must be a function");
|
||||||
}
|
}
|
||||||
|
@ -398,7 +397,7 @@ function StdEventableObject() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
StdEventableObject.__counter__ = 0;
|
StdEventTarget.__counter__ = 0;
|
||||||
|
|
||||||
function AsyncFunction(f, _filename) {
|
function AsyncFunction(f, _filename) {
|
||||||
this.f = f;
|
this.f = f;
|
||||||
|
@ -460,11 +459,11 @@ global.splitLn = splitLn;
|
||||||
global.addslashes = addslashes;
|
global.addslashes = addslashes;
|
||||||
global.AsyncFunction = AsyncFunction;
|
global.AsyncFunction = AsyncFunction;
|
||||||
|
|
||||||
exports.VERSIONINFO = "Standard Library (std.js) version 0.7.5";
|
exports.VERSIONINFO = "Standard Library (std.js) version 0.8";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
||||||
exports.Event = StdEvent;
|
exports.Event = StdEvent;
|
||||||
exports.EventableObject = StdEventableObject;
|
exports.EventTarget = StdEventTarget;
|
||||||
|
|
||||||
exports.alert = alert;
|
exports.alert = alert;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user