summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/TestingFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/builtin/TestingFunctions.cpp')
-rw-r--r--js/src/builtin/TestingFunctions.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
index b521e2bb3..a9a307da7 100644
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1328,7 +1328,6 @@ OOMTest(JSContext* cx, unsigned argc, Value* vp)
}
#endif
-#ifdef SPIDERMONKEY_PROMISE
static bool
SettlePromiseNow(JSContext* cx, unsigned argc, Value* vp)
{
@@ -1437,43 +1436,6 @@ RejectPromise(JSContext* cx, unsigned argc, Value* vp)
return result;
}
-#else
-
-static const js::Class FakePromiseClass = {
- "Promise", JSCLASS_IS_ANONYMOUS
-};
-
-static bool
-MakeFakePromise(JSContext* cx, unsigned argc, Value* vp)
-{
- CallArgs args = CallArgsFromVp(argc, vp);
-
- RootedObject obj(cx, NewObjectWithGivenProto(cx, &FakePromiseClass, nullptr));
- if (!obj)
- return false;
-
- JS::dbg::onNewPromise(cx, obj);
- args.rval().setObject(*obj);
- return true;
-}
-
-static bool
-SettleFakePromise(JSContext* cx, unsigned argc, Value* vp)
-{
- CallArgs args = CallArgsFromVp(argc, vp);
- if (!args.requireAtLeast(cx, "settleFakePromise", 1))
- return false;
- if (!args[0].isObject() || args[0].toObject().getClass() != &FakePromiseClass) {
- JS_ReportErrorASCII(cx, "first argument must be a (fake) Promise object");
- return false;
- }
-
- RootedObject promise(cx, &args[0].toObject());
- JS::dbg::onPromiseSettled(cx, promise);
- return true;
-}
-#endif // SPIDERMONKEY_PROMISE
-
static unsigned finalizeCount = 0;
static void
@@ -4190,7 +4152,6 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = {
" This is also disabled when --fuzzing-safe is specified."),
#endif
-#ifdef SPIDERMONKEY_PROMISE
JS_FN_HELP("settlePromiseNow", SettlePromiseNow, 1, 0,
"settlePromiseNow(promise)",
" 'Settle' a 'promise' immediately. This just marks the promise as resolved\n"
@@ -4207,20 +4168,6 @@ JS_FN_HELP("resolvePromise", ResolvePromise, 2, 0,
JS_FN_HELP("rejectPromise", RejectPromise, 2, 0,
"rejectPromise(promise, reason)",
" Reject a Promise by calling the JSAPI function JS::RejectPromise."),
-#else
- JS_FN_HELP("makeFakePromise", MakeFakePromise, 0, 0,
-"makeFakePromise()",
-" Create an object whose [[Class]] name is 'Promise' and call\n"
-" JS::dbg::onNewPromise on it before returning it. It doesn't actually have\n"
-" any of the other behavior associated with promises."),
-
- JS_FN_HELP("settleFakePromise", SettleFakePromise, 1, 0,
-"settleFakePromise(promise)",
-" 'Settle' a 'promise' created by makeFakePromise(). This doesn't have any\n"
-" observable effects outside of firing any onPromiseSettled hooks set on\n"
-" Debugger instances that are observing the given promise's global as a\n"
-" debuggee."),
-#endif // SPIDERMONKEY_PROMISE
JS_FN_HELP("makeFinalizeObserver", MakeFinalizeObserver, 0, 0,
"makeFinalizeObserver()",