?um/p1-90`controlがどのように
eval functionへのcallsはすべて値1を返します:
eval("1;;;;;")
eval("1;{}")
eval("1;var a;")
The abstract operation BlockDeclarationInstantiation takes arguments code (a
これは呼び出されたとき、次のstepsを実行します:
let、const、using、および await using 宣言は、実行中の実行コンテキストの LexicalEnvironment にスコープされる変数を定義する。変数は、それを含む let 宣言内の
生成規則のインスタンスを処理する際
The
静的意味論の規則により、この形式の const、using、または await using 宣言では決して発生しないことが保証される。
var statementは、
The
The
The
envRecordに
It is defined piecewise over the following productions:
functionまたはclass async functionで開始できません。これはlet [で開始できません。これは、最初のlet
if Statementelse]は、古典的な“dangling else”問題を通常の方法で解決します。つまり、関連付けられるifの選択が他の点ではambiguousである場合、elseは候補となるifのうち最も近い(最も内側の)ものに関連付けられますこのruleを適用する必要があるのは、
The abstract operation LoopContinues takes arguments completion (a
The
do-while Statementこのruleを適用する必要があるのは、
The
while Statementこのruleを適用する必要があるのは、
The
for Statementこのruleを適用する必要があるのは、
The
The abstract operation ForBodyEvaluation takes arguments test (an
The abstract operation CreatePerIterationEnvironment takes argument perIterationBindings (a
for-in, for-of, and for-await-of StatementsこのsectionはAnnex
このruleを適用する必要があるのは、
The
このsectionはAnnex
The
The
The
このsectionはAnnex
The abstract operation ForIn/OfHeadEvaluation takes arguments uninitializedBoundNames (a
The abstract operation ForIn/OfBodyEvaluation takes arguments lhs (a
The abstract operation EnumerateObjectProperties takes argument obj (an Object) and returns an
next methodを持つthrowおよびreturn methodsはnext methodは、next methodによって処理される前に削除されたpropertyは無視されます。enumeration中にtarget objectへ新しいpropertiesが追加された場合、新しく追加されたpropertiesはactive enumerationで処理されることが保証されません。next methodによって最大1回だけ返されます。
target objectのpropertiesをenumeratingすることには、そのprototype、そのprototypeのprototype、以下同様にrecursiveにpropertiesをenumeratingすることが含まれます;ただし、prototypeのpropertyは、next methodによってすでに処理されたpropertyと同じ名前を持つ場合、処理されません。prototype objectのpropertyがすでに処理されたかどうかを判定するとき、[[Enumerable]] attributesの値は考慮されません。prototype objectsのenumerable
さらに、objも、そのprototype chain内のどのobjectも
ECMAScript implementationsは、
以下は、これらのrulesにconformするECMAScript generator functionのinformative definitionです:
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 objectsはECMAScript codeから直接accessできることは決してありません;それらは
The abstract operation CreateForInIterator takes argument obj (an Object) and returns a
%ForInIteratorPrototype% object:
| Internal Slot | Type | Description |
|---|---|---|
| [[Object]] | an Object | propertiesがiteratedされているObject値。 |
| [[ObjectWasVisited]] | a Boolean |
|
| [[VisitedKeys]] |
a |
この |
| [[RemainingKeys]] |
a |
そのprototypeが |
continue Statementstatic initialization blockのboundariesを越えずに)break Statementstatic initialization blockのboundariesを越えずに)return Statementreturn statementはfunctionのexecutionを停止させ、ほとんどの場合、callerへ値を返します。return statementは、surrounding contextによっては、実際にはcallerへ値を返さない場合があります。例えば、try blockでは、return statementのfinally blockのevaluation中に別の
with Statement新しいECMAScript codeではwith statementの使用はdiscouragedされます。
with statementは、computed objectに対する
second ruleを適用する必要があるのは、
controlがembedded
switch StatementThe
The abstract operation CaseClauseIsSelected takes arguments caseClauseNode (a
このoperationはcaseClauseNodeの
controlがどのように
breakおよびcontinue statementsと組み合わせてのみ使用されます。ECMAScriptにはgoto statementはありません。
The abstract operation IsLabelledFunction takes argument stmt (a
The
LabelledEvaluationに対してspecial semanticsを持つ
throw Statementtry Statementtry statementは、runtime errorやthrow statementなど、exceptional conditionが発生し得るcodeのblockを囲みます。catch clauseはexception-handling codeを提供します。catch clauseがexceptionをcatchすると、その
The
controlがどのように
debugger Statement