endScope method

void endScope(
  1. int key
)

End the current scope (DartBlockEnvironment) and return to the previous ('higher-up' or parent) scope. This is done by retrieving and removing the last element in the _blockHistory list.

Should _blockHistory be empty, the root DartBlockEnvironment is set to the current environment. However, this case should normally never occur.

Implementation

void endScope(int key) {
  _currentStatementBlockKey = _blockHistory.isNotEmpty
      ? _blockHistory.removeLast()
      : environment.key;
}