popScope method

void popScope()

Removes the most recently added scope from the variable stack.

If the global scope is the only remaining scope, an exception is thrown.

Implementation

void popScope() {
  if (_variableStack.length > 1) {
    _variableStack.removeLast();
  } else {
    throw Exception('Cannot pop the global scope.');
  }
}