0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

25
web/node_modules/es5-ext/test/promise/#/as-callback.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
"use strict";
module.exports = function (t, a) {
if (typeof Promise !== "function") return null;
return {
Success: function (d) {
t.call(new Promise(function (resolve) { resolve("foo"); }), function (error, value) {
a(error, null);
a(value, "foo");
d();
});
},
Failure: function (d) {
var error = new Error("Rejection");
t.call(new Promise(function (resolve, reject) { reject(error); }), function (
passedError,
value
) {
a(passedError, error);
a(value, undefined);
d();
});
}
};
};

View file

@ -0,0 +1,7 @@
"use strict";
var isImplemented = require("../../../../promise/#/finally/is-implemented");
if (typeof Promise !== "function") global.Promise = require("plain-promise");
module.exports = function (a) { a(isImplemented(), true); };

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = require("./shim");

View file

@ -0,0 +1,3 @@
"use strict";
module.exports = function (t, a) { a(typeof t(), "boolean"); };

View file

@ -0,0 +1,75 @@
"use strict";
var microtaskDelay = require("../../../../function/#/microtask-delay");
if (typeof Promise !== "function") global.Promise = require("plain-promise");
module.exports = function (t, a) {
return {
Success: function (d) {
var invoked;
t.call(Promise.resolve("foo"), function () {
invoked = true;
return "bar";
}).then(
microtaskDelay.call(function (result) {
a(result, "foo");
a(invoked, true);
d();
}, microtaskDelay.call(d))
);
},
Failure: function (d) {
var invoked;
var error = new Error("Some error");
t.call(Promise.reject(error), function () {
invoked = true;
return "bar";
}).then(
microtaskDelay.call(function () {
a.never();
d();
}),
microtaskDelay.call(function (result) {
a(result, error);
a(invoked, true);
d();
})
);
},
SuccessFinallyError: function (d) {
var invoked, finallyError = new Error("Finally error");
t.call(Promise.resolve("foo"), function () {
invoked = true;
throw finallyError;
}).then(
microtaskDelay.call(function () {
a.never();
d();
}),
microtaskDelay.call(function (result) {
a(result, finallyError);
a(invoked, true);
d();
})
);
},
FailureFinallyError: function (d) {
var invoked, finallyError = new Error("Finally error");
t.call(Promise.reject(new Error("Some error")), function () {
invoked = true;
throw finallyError;
}).then(
microtaskDelay.call(function () {
a.never();
d();
}),
microtaskDelay.call(function (result) {
a(result, finallyError);
a(invoked, true);
d();
})
);
}
};
};