author | Boris Zbarsky <bzbarsky@mit.edu> |
Wed, 13 Feb 2019 08:42:45 +0000 | |
changeset 458884 | 216b765364a3 |
parent 458883 | 56575ed63592 |
child 458885 | a5ad662d5bbb |
push id | 35551 |
push user | shindli@mozilla.com |
push date | Wed, 13 Feb 2019 21:34:09 +0000 |
treeherder | mozilla-central@08f794a4928e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jandem |
bugs | 1527443 |
milestone | 67.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/jsapi.cpp | file | annotate | diff | comparison | revisions | |
js/src/jsapi.h | file | annotate | diff | comparison | revisions |
--- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1573,16 +1573,23 @@ JS::RealmCreationOptions::setNewCompartm JS::RealmCreationOptions& JS::RealmCreationOptions::setExistingCompartment( JSObject* obj) { compSpec_ = CompartmentSpecifier::ExistingCompartment; comp_ = obj->compartment(); return *this; } +JS::RealmCreationOptions& JS::RealmCreationOptions::setExistingCompartment( + JS::Compartment* compartment) { + compSpec_ = CompartmentSpecifier::ExistingCompartment; + comp_ = compartment; + return *this; +} + JS::RealmCreationOptions& JS::RealmCreationOptions::setNewCompartmentAndZone() { compSpec_ = CompartmentSpecifier::NewCompartmentAndZone; comp_ = nullptr; return *this; } const JS::RealmCreationOptions& JS::RealmCreationOptionsRef(Realm* realm) { return realm->creationOptions();
--- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -967,16 +967,17 @@ class JS_PUBLIC_API RealmCreationOptions CompartmentSpecifier compartmentSpecifier() const { return compSpec_; } // Set the compartment/zone to use for the realm. See CompartmentSpecifier // above. RealmCreationOptions& setNewCompartmentInSystemZone(); RealmCreationOptions& setNewCompartmentInExistingZone(JSObject* obj); RealmCreationOptions& setNewCompartmentAndZone(); RealmCreationOptions& setExistingCompartment(JSObject* obj); + RealmCreationOptions& setExistingCompartment(JS::Compartment* compartment); // Certain compartments are implementation details of the embedding, and // references to them should never leak out to script. This flag causes this // realm to skip firing onNewGlobalObject and makes addDebuggee a no-op for // this global. // // Debugger visibility is per-compartment, not per-realm (it's only practical // to enforce visibility on compartment boundaries), so if a realm is being