* 仕様書

[REFS[
- [9] '''[CITE[ECMAScript® 2017 Language Specification]] ([TIME[2016-03-26 04:47:30 +09:00]] 版) <https://tc39.github.io/ecma262/#sec-execution-contexts>'''
- [1] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-12-22 10:28:15 +09:00]] 版) <https://html.spec.whatwg.org/#realm-execution-context>
]REFS]

* 状態

[5] [[実行文脈]]は次の[[状態]]を持ちます。

[FIG(list members)[
: [F[[CODE[[[Realm]]]]]] :
: [F[[CODE[[[ScriptOrModule]]]] :
: [F[入口計数器]] :
: [F[現職決定時に飛ばす計数器]] :

[HISTORY[
: [F[[[大域オブジェクト]]]] : [F[[CODE[[[Realm]]]]]] の [CODE[[F(ss)[GlobalObject]]]]。
: [F[[[設定群オブジェクト]]]] :
]HISTORY]
]FIG]

* [F[realm 実行文脈]] (環境設定群オブジェクト)

[2] [[環境設定群オブジェクト]]の [DFN[[F[[RUBYB[[[realm実行文脈]]]@en[realm execution context]]]]]]は、
当該[[環境設定群オブジェクト]]を使うすべての[[スクリプト]] (= ある [[realm]]
中のすべての[[スクリプト]]) で共有する[[JavaScript実行文脈]]です。 [SRC[>>1]]

[3] [[古典スクリプトの実行]]や[[モジュールスクリプトの実行]]の時に、
本[[実行文脈]]が [[JavaScript実行文脈スタック]]の上に積まれます。
[[スクリプト]]ごとの特有の[[実行文脈]]は更にその上に積まれます。
(なので [CODE[ParseScript]] や [CODE[ModuleEvaluation]] がどの [CODE[[[Realm]]]]
を使うべきか決められます。) [SRC[>>1]]

* [F[走っている JavaScript 実行文脈]]

[10] [[JavaScriptエンジン]]の[DFN[[RUBYB[走っている実行文脈]@en[running execution context]]]]

[6] [[走っている実行文脈に対応するスクリプト]]

[12] [[新しいJavaScript realm実行文脈の作成]]

* 歴史

[4] [CITE@en[Rewrite script execution on top of ES · whatwg/html@4891d18]] ([TIME[2015-12-22 21:04:34 +09:00]] 版) <https://github.com/whatwg/html/commit/4891d18aaf2df1d40aa61f467a5a10cfc19dd85d>

[7] [CITE@en[Add <script type="module"> and module resolution/fetching/evaluation · whatwg/html@cd1a9fb]] ([TIME[2016-01-21 23:18:53 +09:00]] 版) <https://github.com/whatwg/html/commit/cd1a9fb1e83f7d0bc30be8b34ecdaf444a0b19a4>

[8] [CITE@en[Clarify settings object, realm, and global relationships · whatwg/html@0866f1b]]
([TIME[2016-03-28 00:03:35 +09:00]] 版)
<https://github.com/whatwg/html/commit/0866f1b3f4b4ea5a99a30909e9bbe557dea0b460>

[11] [CITE@en[Fix navigation to create a new realm and environment settings object · whatwg/html@862afa4]]
([TIME[2016-03-28 21:27:48 +09:00]] 版)
<https://github.com/whatwg/html/commit/862afa4d768cb01e9a020e0562bc465e7f8bacfe>