MCPcopy Create free account
hub / github.com/mozilla/rhino / pushScope

Method pushScope

rhino/src/main/java/org/mozilla/javascript/Parser.java:551–561  ·  view source on GitHub ↗
(Scope scope)

Source from the content-addressed store, hash-verified

549 }
550
551 void pushScope(Scope scope) {
552 Scope parent = scope.getParentScope();
553 // During codegen, parent scope chain may already be initialized,
554 // in which case we just need to set currentScope variable.
555 if (parent != null) {
556 if (parent != currentScope) codeBug();
557 } else {
558 currentScope.addChildScope(scope);
559 }
560 currentScope = scope;
561 }
562
563 void popScope() {
564 currentScope = currentScope.getParentScope();

Callers 15

enterLoopMethod · 0.95
switchStatementMethod · 0.95
forLoopMethod · 0.95
tryStatementMethod · 0.95
blockMethod · 0.95
letMethod · 0.95
destructuringObjectMethod · 0.95
transformArrayCompMethod · 0.80

Calls 3

codeBugMethod · 0.95
addChildScopeMethod · 0.80
getParentScopeMethod · 0.65

Tested by

no test coverage detected