initial commit

This commit is contained in:
Blue 2018-08-05 00:46:25 +03:00 committed by Юрий Губич
commit 4b60ece582
327 changed files with 28286 additions and 0 deletions

29
libjs/wTest/test.js Normal file
View file

@ -0,0 +1,29 @@
"use strict";
var Class = require("../utils/subscribable");
var Test = Class.inherit({
"className": "Test",
"constructor": function(name) {
Class.fn.constructor.call(this);
this._name = name;
this._actions = [];
},
"run": function() {
this.trigger("start", this._name);
var succsess = this._actions.length;
for (var i = 0; i < this._actions.length; ++i) {
this.trigger("progress", this._name, i + 1, this._actions.length);
try {
this._actions[i].call(this);
} catch (e) {
this.trigger("fail", this._name, i + 1, e);
--succsess;
}
}
this.trigger("end", this._name, succsess, this._actions.length);
}
});
module.exports = Test;