?um/p1-90`
どのように control が
eval 関数の呼出しはいずれも値 1 を返す:
eval("1;;;;;")
eval("1;{}")
eval("1;var a;")
The
これは呼び出されると次の手順を実行する:
let および const 宣言は、let 宣言内の
静的意味論規則により、この形の
const 宣言内には決して現れな
いことが保証される。
var statement は、
The
The
The
It is defined piecewise over the following productions:
function または
class async function で始
まってはならない。なぜなら、それにより
let [ で始まってはならない。なぜなら、それにより最
初の let
if Statementelse] という
lookahead-restriction は、古典的な “dangling
else” 問題を通常の方法で解決する。すなわち、関連付け
られる if の選択が他の点では曖昧である場合、else
は候補となる if のうち最も近い(最も内側の)ものに
関連付けられる。
この規則は、
The
The
do-while Statement
この規則は、
The
while Statement
この規則は、
The
for Statement
この規則は、
The
The
The
for-in, for-of, および for-await-of Statement
この節は、Annex
この規則は、
The
この節は、Annex
The
The
The
この節は、Annex
The
The
The
next
method を持つ
throw および return
method は next method は、next method によって処理される前に
削除された property は無視される。列挙中に target
object に新しい property が追加された場合、新たに
追加された property が進行中の列挙で処理されることは
保証されない。任意の列挙において、property 名は
next method によって高々 1 回し
か返されない。
target object の property の列挙には、その
prototype の property、その prototype の
prototype の property、というように再帰的に含ま
れる; ただし、prototype の property は、それがす
でに next method によって処理済み
の property と同じ名前を持つ場合には処理されない。
prototype object の property がすでに処理済み
かどうかを判定する際には、[[Enumerable]] 属性値は考慮
されない。prototype object の enumerable
property 名は、その prototype object を引数とし
て渡して EnumerateObjectProperties を起動するこ
とにより取得されなければならない。
EnumerateObjectProperties は、target object
の own
さらに、obj も、その prototype chain 上
のいずれの object も、
ECMAScript 実装は、
以下は、これらの規則に適合する ECMAScript generator function の参考定義である:
function* EnumerateObjectProperties(obj) {
const visited = new Set();
for (const key of Reflect.ownKeys(obj)) {
if (typeof key === "symbol") continue;
const desc = Reflect.getOwnPropertyDescriptor(obj, key);
if (desc) {
visited.add(key);
if (desc.enumerable) yield key;
}
}
const proto = Reflect.getPrototypeOf(obj);
if (proto === null) return;
for (const protoKey of EnumerateObjectProperties(proto)) {
if (!visited.has(protoKey)) yield protoKey;
}
}
For-In Iterator
とは、ある特定の object に対する特定の iteration
を表す object である。For-In Iterator object
は ECMAScript code から直接アクセス可能ではなく、
The
%ForInIteratorPrototype% object は:
| Internal Slot | 型 | 説明 |
|---|---|---|
| [[Object]] | an Object | その property が反復されている Object 値。 |
| [[ObjectWasVisited]] | a Boolean |
|
| [[VisitedKeys]] |
a |
これまでにこの |
| [[RemainingKeys]] |
a |
prototype の property を反復する前
に(その prototype が |
continue Statementstatic
initialization block の境界はまたがず
に)入れ子になっていない場合、それは Syntax
Error である。
break Statementstatic
initialization block の境界はまたがず
に)入れ子になっていない場合、それは Syntax
Error である。
return Statement
return statement は function の実行を
停止させ、ほとんどの場合、呼出し元へ値を返す。
return statement は、周囲の文脈によっては実際
には呼出し元へ値を返さないことがある。たとえば try
block では、return statement の finally block の評価中に別の
with Statement
with statement の使用は、新し
い ECMAScript code では推奨されない。
with statement は、計算された object に
対する
2 番目の規則は、
embedded された
switch StatementThe
The
この操作は constructor の
どのように control が
break お
よび continue statement と組み合わせてのみ使
用される。ECMAScript には goto statement はな
い。
The
The
throw Statementtry Statement
try statement は、runtime error や
throw statement のような例外的条件が発生し得る
code block を囲む。catch clause は例外処理
code を提供する。catch clause が exception を捕
捉するとき、その
The
どのように control が
debugger Statement