Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade SpiderMonkey to mozilla-central commit b66436b1a867396fd24a9e6dd7c114cb95dbd9f8 #463

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions include/JobQueue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,21 @@ explicit JobQueue(JSContext *cx);
bool init(JSContext *cx);

/**
* @brief Ask the embedding for the incumbent global.
* @brief Ask the embedding for the host defined data.
*
* SpiderMonkey doesn't itself have a notion of incumbent globals as defined
* SpiderMonkey doesn't itself have a notion of host defined data as defined
* by the HTML spec, so we need the embedding to provide this. See
* dom/script/ScriptSettings.h for details.
*
* If the embedding has the host defined data, this method should return the
* host defined data via the `data` out parameter and return `true`.
* The object in the `data` out parameter can belong to any compartment.
* If the embedding doesn't need the host defined data, this method should
* set the `data` out parameter to `nullptr` and return `true`.
* If any error happens while generating the host defined data, this method
* should set a pending exception to `cx` and return `false`.
*/
JSObject *getIncumbentGlobal(JSContext *cx) override;
bool getHostDefinedData(JSContext *cx, JS::MutableHandle<JSObject *> data) const override;

/**
* @brief Enqueue a reaction job `job` for `promise`, which was allocated at
Expand Down
2 changes: 1 addition & 1 deletion mozcentral.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a283127a5d0aa005c54d339e8ca27414b55f079b
b66436b1a867396fd24a9e6dd7c114cb95dbd9f8
5 changes: 3 additions & 2 deletions src/JobQueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ JobQueue::JobQueue(JSContext *cx) {
finalizationRegistryCallbacks = new JS::PersistentRooted<FunctionVector>(cx); // Leaks but it's OK since freed at process exit
}

JSObject *JobQueue::getIncumbentGlobal(JSContext *cx) {
return JS::CurrentGlobalOrNull(cx);
bool JobQueue::getHostDefinedData(JSContext *cx, JS::MutableHandle<JSObject *> data) const {
data.set(nullptr); // We don't need the host defined data
return true; // `true` indicates no error
}

bool JobQueue::enqueuePromiseJob(JSContext *cx,
Expand Down
Loading