summaryrefslogtreecommitdiffstats
path: root/js/src/shell
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-19 01:35:24 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-19 01:35:24 +0100
commitfb96b43b5f6188233710c5f8c9c9e46baa9cb369 (patch)
tree54124a46275f833ecd9f6e63246e092a93843fb0 /js/src/shell
parent8220776c9b2e8291f0414f98ac20fbda30e00d2e (diff)
downloadUXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.gz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.lz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.tar.xz
UXP-fb96b43b5f6188233710c5f8c9c9e46baa9cb369.zip
Issue #1322 - Part 1: Remove the DOM Promise guts.
This removes all the parts guarded by SPIDERMONKEY_PROMISE
Diffstat (limited to 'js/src/shell')
-rw-r--r--js/src/shell/js.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
index 33f7d6bdc..36558a694 100644
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -154,7 +154,6 @@ static const double MAX_TIMEOUT_SECONDS = 1800.0;
# define SHARED_MEMORY_DEFAULT 0
#endif
-#ifdef SPIDERMONKEY_PROMISE
using JobQueue = GCVector<JSObject*, 0, SystemAllocPolicy>;
struct ShellAsyncTasks
@@ -167,7 +166,6 @@ struct ShellAsyncTasks
size_t outstanding;
Vector<JS::AsyncTask*> finished;
};
-#endif // SPIDERMONKEY_PROMISE
enum class ScriptKind
{
@@ -272,12 +270,10 @@ struct ShellContext
JS::PersistentRootedValue interruptFunc;
bool lastWarningEnabled;
JS::PersistentRootedValue lastWarning;
-#ifdef SPIDERMONKEY_PROMISE
JS::PersistentRootedValue promiseRejectionTrackerCallback;
JS::PersistentRooted<JobQueue> jobQueue;
ExclusiveData<ShellAsyncTasks> asyncTasks;
bool drainingJobQueue;
-#endif // SPIDERMONKEY_PROMISE
/*
* Watchdog thread state.
@@ -435,11 +431,9 @@ ShellContext::ShellContext(JSContext* cx)
interruptFunc(cx, NullValue()),
lastWarningEnabled(false),
lastWarning(cx, NullValue()),
-#ifdef SPIDERMONKEY_PROMISE
promiseRejectionTrackerCallback(cx, NullValue()),
asyncTasks(mutexid::ShellAsyncTasks, cx),
drainingJobQueue(false),
-#endif // SPIDERMONKEY_PROMISE
watchdogLock(mutexid::ShellContextWatchdog),
exitCode(0),
quitting(false),
@@ -739,7 +733,6 @@ RunModule(JSContext* cx, const char* filename, FILE* file, bool compileOnly)
return JS_CallFunction(cx, loaderObj, importFun, args, &value);
}
-#ifdef SPIDERMONKEY_PROMISE
static JSObject*
ShellGetIncumbentGlobalCallback(JSContext* cx)
{
@@ -776,12 +769,10 @@ ShellFinishAsyncTaskCallback(JS::AsyncTask* task)
asyncTasks->outstanding--;
return asyncTasks->finished.append(task);
}
-#endif // SPIDERMONKEY_PROMISE
static bool
DrainJobQueue(JSContext* cx)
{
-#ifdef SPIDERMONKEY_PROMISE
ShellContext* sc = GetShellContext(cx);
if (sc->quitting || sc->drainingJobQueue)
return true;
@@ -832,7 +823,6 @@ DrainJobQueue(JSContext* cx)
}
sc->jobQueue.clear();
sc->drainingJobQueue = false;
-#endif // SPIDERMONKEY_PROMISE
return true;
}
@@ -847,7 +837,6 @@ DrainJobQueue(JSContext* cx, unsigned argc, Value* vp)
return true;
}
-#ifdef SPIDERMONKEY_PROMISE
static void
ForwardingPromiseRejectionTrackerCallback(JSContext* cx, JS::HandleObject promise,
PromiseRejectionHandlingState state, void* data)
@@ -870,14 +859,12 @@ ForwardingPromiseRejectionTrackerCallback(JSContext* cx, JS::HandleObject promis
if (!Call(cx, callback, UndefinedHandleValue, args, &rval))
JS_ClearPendingException(cx);
}
-#endif // SPIDERMONKEY_PROMISE
static bool
SetPromiseRejectionTrackerCallback(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
-#ifdef SPIDERMONKEY_PROMISE
if (!IsCallable(args.get(0))) {
JS_ReportErrorASCII(cx,
"setPromiseRejectionTrackerCallback expects a function as its sole "
@@ -888,7 +875,6 @@ SetPromiseRejectionTrackerCallback(JSContext* cx, unsigned argc, Value* vp)
GetShellContext(cx)->promiseRejectionTrackerCallback = args[0];
JS::SetPromiseRejectionTrackerCallback(cx, ForwardingPromiseRejectionTrackerCallback);
-#endif // SPIDERMONKEY_PROMISE
args.rval().setUndefined();
return true;
}
@@ -3349,12 +3335,10 @@ WorkerMain(void* arg)
return;
}
-#ifdef SPIDERMONKEY_PROMISE
sc->jobQueue.init(cx, JobQueue(SystemAllocPolicy()));
JS::SetEnqueuePromiseJobCallback(cx, ShellEnqueuePromiseJobCallback);
JS::SetGetIncumbentGlobalCallback(cx, ShellGetIncumbentGlobalCallback);
JS::SetAsyncTaskCallbacks(cx, ShellStartAsyncTaskCallback, ShellFinishAsyncTaskCallback);
-#endif // SPIDERMONKEY_PROMISE
EnvironmentPreparer environmentPreparer(cx);
@@ -3385,11 +3369,9 @@ WorkerMain(void* arg)
JS::SetLargeAllocationFailureCallback(cx, nullptr, nullptr);
-#ifdef SPIDERMONKEY_PROMISE
JS::SetGetIncumbentGlobalCallback(cx, nullptr);
JS::SetEnqueuePromiseJobCallback(cx, nullptr);
sc->jobQueue.reset();
-#endif // SPIDERMONKEY_PROMISE
KillWatchdog(cx);
@@ -7945,12 +7927,10 @@ main(int argc, char** argv, char** envp)
if (!JS::InitSelfHostedCode(cx))
return 1;
-#ifdef SPIDERMONKEY_PROMISE
sc->jobQueue.init(cx, JobQueue(SystemAllocPolicy()));
JS::SetEnqueuePromiseJobCallback(cx, ShellEnqueuePromiseJobCallback);
JS::SetGetIncumbentGlobalCallback(cx, ShellGetIncumbentGlobalCallback);
JS::SetAsyncTaskCallbacks(cx, ShellStartAsyncTaskCallback, ShellFinishAsyncTaskCallback);
-#endif // SPIDERMONKEY_PROMISE
EnvironmentPreparer environmentPreparer(cx);
@@ -7980,11 +7960,9 @@ main(int argc, char** argv, char** envp)
JS::SetLargeAllocationFailureCallback(cx, nullptr, nullptr);
-#ifdef SPIDERMONKEY_PROMISE
JS::SetGetIncumbentGlobalCallback(cx, nullptr);
JS::SetEnqueuePromiseJobCallback(cx, nullptr);
sc->jobQueue.reset();
-#endif // SPIDERMONKEY_PROMISE
KillWatchdog(cx);