What is Realm and Why do we Need it(ecma262)?

Viewed 180

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.

0 Answers
Related