Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : lazy.js
"use strict";

module.exports = function (t) {
	if (typeof Promise !== "function") return null; // Run tests only in ES2015+ env

	return {
		"Delays execution": function (a, d) {
			var invoked = false;
			var promise = t(function (resolve) {
				invoked = true;
				setTimeout(function () { resolve(20); }, 10);
			});

			a(invoked, false);

			setTimeout(function () {
				a(invoked, false);
				promise.then(function (value) {
					a(value, 20);
					setTimeout(d, 0); // Escape error swallowing
				});
				a(invoked, true);
			}, 15);
		},
		"Passes rejection": function (a, d) {
			var promise = t(function (resolve, reject) {
				setTimeout(function () { reject(new Error("Stop")); }, 10);
			});

			promise.catch(function (error) {
				a(error instanceof Error, true);
				a(error.message, "Stop");
				setTimeout(d, 0); // Escape error swallowing
			});
		},
		"Passes sync exception": function (a, d) {
			var promise = t(function () { throw new Error("Stop"); });

			promise.catch(function (error) {
				a(error instanceof Error, true);
				a(error.message, "Stop");
				setTimeout(d, 0); // Escape error swallowing
			});
		}
	};
};
© 2026 GrazzMean