Completion type (Definition)

An internal type used by the interpreter.

Availability:

ECMAScript edition - 2

This is an internal type used by the interpreter for processing expression evaluation results. It cannot be stored as an object property.

A completion happens when a statement is evaluated and completes normally. A completion can involve a value and may still be a normal completion.

Abrupt completions are triggered by break, continue, and return statements, which are all classified as program steps that may redirect the flow of control. This may cause sections of code to be skipped or repeated. In the case of a return, it may prematurely exit a function.

In the set of ECMA-defined reserved words, there is evidence that new flow control changes may be introduced and therefore other completion type values may be added later.

The set of completion type values are summarized in this table:

Type:Reason:
Normal completion-
Normal completion after evaluation-
Abrupt completionbreak
Abrupt completion after evaluationbreak
Abrupt completioncontinue
Abrupt completion after evaluationcontinue
Abrupt completionreturn
Abrupt completion after evaluationreturn

See also:break, continue, Identifier resolution, return, Scope chain, Type

Cross-references:

ECMA 262 edition 2 - section - 8.9

ECMA 262 edition 3 - section - 8.9