diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-05-18 20:33:59 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2020-01-19 15:23:50 -0800 |
commit | 7b6446260bb4c73050ab544b69d1ca2481e18d6d (patch) | |
tree | 5c8eaf16ad40135d17a0525130b560e15206499d /test/gjs-test-utils.h | |
parent | e9a802d171129aac2ac06570848710ce61ada033 (diff) | |
download | gjs-7b6446260bb4c73050ab544b69d1ca2481e18d6d.tar.gz |
js: Rename "compartments" to "realms"
In SpiderMonkey 68, a "realm" is the term for the environment belonging
to a particular global object, so when you enter the "realm" of a global
object you are executing code with that object as the global object.
"Compartments" are still a thing but they are now more focused on
security, and are used for isolating code in different browser tabs in
Firefox, for example. All code in GJS except the debugger and the
coverage collector is run within the same compartment.
Some APIs that previously operated on a global object that was passed
in, now operate on the current realm.
Diffstat (limited to 'test/gjs-test-utils.h')
-rw-r--r-- | test/gjs-test-utils.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/gjs-test-utils.h b/test/gjs-test-utils.h index 6af5d2d9..94519253 100644 --- a/test/gjs-test-utils.h +++ b/test/gjs-test-utils.h @@ -28,14 +28,16 @@ #include "gjs/context.h" -struct JSCompartment; struct JSContext; +namespace JS { +class Realm; +}; typedef struct _GjsUnitTestFixture GjsUnitTestFixture; struct _GjsUnitTestFixture { GjsContext *gjs_context; JSContext *cx; - JSCompartment *compartment; + JS::Realm* realm; }; void gjs_unit_test_fixture_setup(GjsUnitTestFixture* fx, const void* unused); |