たれぱんのびぼーろく

わたしの備忘録、生物学とプログラミングが多いかも

ECMAScript Language Specificationの読み方

内部関数、内部スロット

http://www.ecma-international.org/ecma-262/6.0/#sec-object-internal-methods-and-internal-slots

仕様書内ではAPI(ECMAScriptを書くときに使うobject, methodsなど)のほかに、仕様書内で使われる処理をinternal methodsとして表記している。
これによって仕様書に頻出する処理を関数処理として書いて全体の見通しをよくしている。

また、内部変数のようなものとしてinternal slotsがある。

internal methodsとinternal slotsは仕様書内でxxxxxのように表記される。

Internal methods and internal slots are identified within this specification using names enclosed in double square brackets .
http://www.ecma-international.org/ecma-262/6.0/#sec-object-internal-methods-and-internal-slots

ECMAScript Specification Types

http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-specification-types

仕様書内部の型.

  • Reference
  • List
  • Completion
  • Property Descriptor
  • Lexical Environment
  • Environment Record
  • Data Block

がある.

Completion型

{type: xxx, value: yyy, target: zzz}
のようになっているもの.
つまりtype, value, targetの3つのみをfieldとしてもっている.
fieldの値は指定のもののうちいずれか、typeならnormalなど.
type != normalであるcompletionをabrupt completionという.