新しいJavaScript realmを作成

新しいJavaScript realmを作成

仕様書

状態

[11]

GlobalObject
大域オブジェクトです。
HostDefined
Web では、設定群オブジェクトです。

Realm

[13] 大域オブジェクトの Realm (the global object's Realm) >>12 は、その大域オブジェクトに対応する Realm です。 両者には1:1の対応関係があります。当該 Realm の初期化時に大域オブジェクトが作成されていて、 以後変化しません。

[7] 環境設定群オブジェクトRealm は、 環境設定群オブジェクトrealm実行文脈Realm です >>6

作成

[23] 新しいJavaScript realmを作成 (create a new JavaScript realm) するには、 大域オブジェクト大域this束縛について、 次のようにします HTML Standard

  1. [24] 大域オブジェクト大域this束縛について、 InitializeHostDefinedRealm を実行します。
  2. [25] realm実行文脈を、 走っているJavaScript実行文脈に設定します。
  3. [26] realm実行文脈を、 JavaScript実行文脈スタックから削除します。
  4. [27] realm実行文脈を返します。

関連

[10] Web においては、 Realm大域オブジェクト環境設定群オブジェクトに 1:1:1 対応関係が常に成立します。

[98] 入口Realm現職Realm現在Realm関連Realmについては、 設定群オブジェクトを参照。

歴史

[1] Bug 26603 – Consider merging the concept of incumbent global with the current realm ( ( 版)) https://www.w3.org/Bugs/Public/show_bug.cgi?id=26603

[2] Bug 24652 – Deal with associated global / Realm ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=24652

[35] Bug 3138 – Realm initialisation for Web browsers ( ( 版)) https://bugs.ecmascript.org/show_bug.cgi?id=3138

[3] Fix refs to some terms from the ES spec · whatwg/html@40295ff ( 版) https://github.com/whatwg/html/commit/40295ff11d8f2629a8eeb4b31d64ae0679ad741f

[4] 26603 – Consider merging the concept of incumbent global with the current realm ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=26603

[5] Add <script type="module"> and module resolution/fetching/evaluation · whatwg/html@cd1a9fb ( 版) https://github.com/whatwg/html/commit/cd1a9fb1e83f7d0bc30be8b34ecdaf444a0b19a4

[8] 24318 – Define the Realm of objects ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=24318

[9] Clarify settings object, realm, and global relationships · whatwg/html@0866f1b ( 版) https://github.com/whatwg/html/commit/0866f1b3f4b4ea5a99a30909e9bbe557dea0b460

[15] Merge pull request #113 from domenic/modernize-invoke ( (bzbarsky著, )) https://github.com/heycam/webidl/commit/09c011d8de1077fe5991ceded97838650e376f6c

[16] Formalize [[Realm]] internal slot of ordinary objects · Issue #573 · tc39/ecma262 ( ()) https://github.com/tc39/ecma262/issues/573

[17] Add a new section detailing the various potential realms (domenic著, ) https://github.com/whatwg/html/commit/6399af334edd6000bd394685923df5f0519194ab

[18] Use the relevant realm of the event target when firing an event (domenic著, ) https://github.com/whatwg/dom/commit/5f39374c6f1d7893ece8101b083b8f6ccf8d1d72

[19] Event handlers are not compiled against the right global, per spec · Issue #1956 · whatwg/html () https://github.com/whatwg/html/issues/1956

[20] Specify the realm for the SSE MessageEvent (domenic著, ) https://github.com/whatwg/html/commit/91d19d647433203f1f319e2afe76e63ceae646ca

[21] Creating a %TypedArray% instance in a different realm · Issue #418 · tc39/ecma262 () https://github.com/tc39/ecma262/issues/418

[22] Fix calls to InitializeHostDefinedRealm (TimothyGu著, ) https://github.com/whatwg/html/commit/39c948ba5ec55677e209bc4fc631636f1e8e2baf

[28] Pop execution context off the stack after InitializeHostDefinedRealm · Issue #3784 · whatwg/html () https://github.com/whatwg/html/issues/3784

[29] Fix calls to InitializeHostDefinedRealm by TimothyGu · Pull Request #3838 · whatwg/html () https://github.com/whatwg/html/pull/3838

[30] document.open() simplifications, part 1 (TimothyGu著, ) https://github.com/whatwg/html/commit/6f769b8089a843066aa19f5991405bf4c84458b3

[31] Calling InitializeHostDefinedRealm in document.open is probably unnecessary · Issue #1698 · whatwg/html () https://github.com/whatwg/html/issues/1698

[32] document.open() simplifications: realm creation, unloading, tasks removal by TimothyGu · Pull Request #3918 · whatwg/html () https://github.com/whatwg/html/pull/3918

[33] Formally define a [[Realm]] slot on platform objects (Ms2ger著, ) https://github.com/heycam/webidl/commit/c705ce6ce80f0313e323ee024cb13984a538b55b

[34] Formally define a [[Realm]] slot on platform objects by Ms2ger · Pull Request #658 · heycam/webidl () https://github.com/heycam/webidl/pull/658

[36] Remove references to ECMAScript global environments (Ms2ger著, ) https://github.com/heycam/webidl/commit/b4f9467f5f22871d882d833c3526c46007048982

[37] Remove references to ECMAScript global environments by Ms2ger · Pull Request #681 · heycam/webidl () https://github.com/heycam/webidl/pull/681