forked from enviPath/enviPy
Current Dev State
This commit is contained in:
23
static/js/ketcher2/node_modules/timers-ext/test/delay.js
generated
vendored
Normal file
23
static/js/ketcher2/node_modules/timers-ext/test/delay.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a, d) {
|
||||
var data, count = 0
|
||||
, x = function (a, b, c) { data = [this, a, b, c, ++count]; }
|
||||
, y = t(x, 200), z = {};
|
||||
|
||||
a(data, undefined, "Setup");
|
||||
y.call(z, 111, 'foo', false);
|
||||
a(data, undefined, "Immediately");
|
||||
setTimeout(function () {
|
||||
a(data, undefined, "100ms");
|
||||
setTimeout(function () {
|
||||
a.deep(data, [z, 111, 'foo', false, 1], "250ms");
|
||||
data = null;
|
||||
clearTimeout(y());
|
||||
setTimeout(function () {
|
||||
a(data, null, "Clear");
|
||||
d();
|
||||
}, 300);
|
||||
}, 150);
|
||||
}, 100);
|
||||
};
|
||||
11
static/js/ketcher2/node_modules/timers-ext/test/max-timeout.js
generated
vendored
Normal file
11
static/js/ketcher2/node_modules/timers-ext/test/max-timeout.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a, d) {
|
||||
var invoked, id;
|
||||
id = setTimeout(function () { invoked = true; }, t);
|
||||
setTimeout(function () {
|
||||
a(invoked, undefined);
|
||||
clearTimeout(id);
|
||||
d();
|
||||
}, 100);
|
||||
};
|
||||
38
static/js/ketcher2/node_modules/timers-ext/test/once.js
generated
vendored
Normal file
38
static/js/ketcher2/node_modules/timers-ext/test/once.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a, d) {
|
||||
var called = 0, fn = t(function () { ++called; });
|
||||
|
||||
fn();
|
||||
fn();
|
||||
fn();
|
||||
setTimeout(function () {
|
||||
a(called, 1);
|
||||
|
||||
called = 0;
|
||||
fn = t(function () { ++called; }, 50);
|
||||
fn();
|
||||
fn();
|
||||
fn();
|
||||
|
||||
setTimeout(function () {
|
||||
fn();
|
||||
fn();
|
||||
|
||||
setTimeout(function () {
|
||||
fn();
|
||||
fn();
|
||||
|
||||
setTimeout(function () {
|
||||
fn();
|
||||
fn();
|
||||
|
||||
setTimeout(function () {
|
||||
a(called, 1);
|
||||
d();
|
||||
}, 70);
|
||||
}, 30);
|
||||
}, 30);
|
||||
}, 30);
|
||||
}, 10);
|
||||
};
|
||||
33
static/js/ketcher2/node_modules/timers-ext/test/throttle.js
generated
vendored
Normal file
33
static/js/ketcher2/node_modules/timers-ext/test/throttle.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a, d) {
|
||||
var called = 0, fn = t(function () { ++called; }, 50);
|
||||
|
||||
fn();
|
||||
a(called, 1);
|
||||
fn();
|
||||
fn();
|
||||
a(called, 1);
|
||||
setTimeout(function () {
|
||||
a(called, 1);
|
||||
fn();
|
||||
setTimeout(function () {
|
||||
a(called, 2);
|
||||
fn();
|
||||
fn();
|
||||
|
||||
setTimeout(function () {
|
||||
a(called, 2);
|
||||
|
||||
setTimeout(function () {
|
||||
a(called, 3);
|
||||
|
||||
setTimeout(function () {
|
||||
a(called, 3);
|
||||
d();
|
||||
}, 100);
|
||||
}, 30);
|
||||
}, 20);
|
||||
}, 30);
|
||||
}, 30);
|
||||
};
|
||||
8
static/js/ketcher2/node_modules/timers-ext/test/valid-timeout.js
generated
vendored
Normal file
8
static/js/ketcher2/node_modules/timers-ext/test/valid-timeout.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(t(NaN), 0, "NaN");
|
||||
a(t(-343), 0, "Negative");
|
||||
a(t(232342), 232342, "Positive");
|
||||
a.throws(function () { t(1e23); }, TypeError, "Too large");
|
||||
};
|
||||
Reference in New Issue
Block a user