Skip to content

How to update globals on a SES Compartment #2727

Answered by chetbox
chetbox asked this question in Q&A
Discussion options

You must be logged in to vote

I have found I can simply use the following to update globals available within SES:

for (const [key, value] of Object.entries(globals1)) {
  compartment.globalThis[key] = value;
}

I had assumed I could not do this because globalThis is a getter but I'm glad it works!

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@chetbox
Comment options

@chetbox
Comment options

Answer selected by chetbox
@mhofman
Comment options

@chetbox
Comment options

@mhofman
Comment options

@chetbox
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants