newGlobal changes

19 views
Skip to first unread message

Jan de Mooij

unread,
Jan 13, 2019, 4:30:22 AM1/13/19
to JS Internals list, Holler, Christian, Kwong, Gary
Hi all,

I made some changes to how newGlobal works in the JS shell, to improve our
test coverage:

1. newGlobal now creates the new global in the caller's compartment.
Shell tests that require the global to be in a new compartment (for example
because they use the Debugger API or things like nukeAllCCWs) have been
updated to use newGlobal({newCompartment: true}).

2. To ensure we don't lose test coverage for the
cross-compartment-global case, a --more-compartments flag has been added to
the shell. This flag makes newGlobal create a new compartment by default,
as it did before. I added this flag to some of the shell flag combinations
we use in automation, to make sure jit-tests and jsreftests in the shell
run in both same-compartment and cross-compartment environments.

If you don't have a good reason to use the newCompartment or
sameCompartmentAs options, just use plain newGlobal() so we run your test
in both configurations.

Note that our chrome globals (windows and sandboxes) are already
same-compartment, so we actually ship both of these configurations in
Firefox.

Cheers,
Jan
Reply all
Reply to author
Forward
0 new messages