Skip to content

Commit

Permalink
Additional notes for globalLexicals snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Jul 4, 2020
1 parent 864e630 commit ee0098e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ses/src/compartment-shim.js
Expand Up @@ -170,6 +170,10 @@ export class Compartment {
// the compartment constructor, but the compartment only respects the
// original values and they are constants in the scope of evaluated
// programs and executed modules.
// This shallow copy captures only the values of enumerable own
// properties, erasing accessors.
// The snapshot is frozen to ensure that the properties are immutable
// when transferred-by-property-descriptor onto local scope objects.
globalLexicals: freeze({ ...globalLexicals }),
});
}
Expand Down

0 comments on commit ee0098e

Please sign in to comment.