3

What is Realm according to ecma262 and why do we need it ?

All i found about the why question is.

Before it is evaluated, all ECMAScript code must be associated with a realm

Well... it doesn't help much :(

Why all ECMAScript code must be associated with realm ?

I've seen that Realm has something weird called [[Intrinsics]] [[TemplateMap]] [[HostDefined]] and it has something more familiar [[GlobalObject]] and [[GlobalEnv]]

I've also seen that every Execution Context has Realm.

so can anyone explain to me what is a Realm and why do we need it ?

Thanks.

AngryJohn
  • 576
  • 4
  • 10
  • 1
    Does this answer your question: [How to understand JS realms](https://stackoverflow.com/q/49832187/1048572)? – Bergi Oct 03 '21 at 12:04
  • i've been looking at that question. but still i don't really understand it – AngryJohn Oct 03 '21 at 12:09
  • As for what intrinsics are, see [here](https://stackoverflow.com/q/38199520/1048572) – Bergi Oct 03 '21 at 12:09
  • Hey @Bergi can you take a look at my latest question "How the evaluate operation works in ecmascript?" it's different than my older question about the evaluation operation – AngryJohn Dec 05 '21 at 11:31
  • Does this answer your question? [How to understand JS realms](https://stackoverflow.com/questions/49832187/how-to-understand-js-realms) – Cole Tobin May 12 '23 at 13:39

0 Answers0