Gets a context for a `return` statement.

@param {CodePathState} state - A state to get.
@returns {TryContext|CodePathState} A context for a `return` statement.
496561
function getReturnContext(state) {
    let context = state.tryContext;

    while (context) {
        if (context.hasFinalizer && context.position !== "finally") {
            return context;
        }
        context = context.upper;
    }

    return state;
}
1035111
function getBreakContext(state, label) {
    let context = state.breakContext;

    while (context) {
        if (label ? context.label === label : context.breakable) {
            return context;
        }
        context = context.upper;
    }

    /* istanbul ignore next: foolproof (syntax error) */
    return null;
}
916705
function getContinueContext(state, label) {
    if (!label) {
        return state.loopContext;
    }

    let context = state.loopContext;

    while (context) {
        if (context.label === label) {
            return context;
        }
        context = context.upper;
    }

    /* istanbul ignore next: foolproof (syntax error) */
    return null;
}
1125980
function GetState(state) {
  var SVG = MathJax.OutputJax.SVG,
      TEX = MathJax.InputJax.TeX,
      MML = MathJax.ElementJax.mml,
      AMS = MathJax.Extension["TeX/AMSmath"],
      HUB = MathJax.Hub, HTML = MathJax.HTML,
      GLYPH = (SVG.BBOX||{}).GLYPH;

  if (state && state.AMS) {
    AMS.startNumber = state.AMS.startNumber;
    AMS.labels = state.AMS.labels;
    AMS.IDs = state.AMS.IDs;
    MML.SUPER.ID = state.mmlID;
    GLYPH.glyphs = state.glyphs;
    GLYPH.defs = state.defs;
    GLYPH.n = state.n;
    ID = state.ID;
  } else {
    if (state) {state.AMS = {}}
    if (SVG.resetGlyphs) SVG.resetGlyphs(true);
    if (data.useGlobalCache) {
      state.glyphs = {};
      state.defs = HTML.Element("defs");
      state.n = 0;
    }
    if (TEX.resetEquationNumbers) TEX.resetEquationNumbers();
    MML.SUPER.ID = ID = 0;
    MathJax.OutputJax.CommonHTML.ID = 0;
  }
}
1126301
void get_context(final State s, Context ctx)
    {
        ctx.S0 = (s.stack.size() > 0 ? s.stack.get(s.stack.size() - 1) : -1);
        ctx.S1 = (s.stack.size() > 1 ? s.stack.get(s.stack.size() - 2) : -1);
        ctx.S2 = (s.stack.size() > 2 ? s.stack.get(s.stack.size() - 3) : -1);
        ctx.N0 = (s.buffer < s.ref.size() ? s.buffer : -1);
        ctx.N1 = (s.buffer + 1 < s.ref.size() ? s.buffer + 1 : -1);
        ctx.N2 = (s.buffer + 2 < s.ref.size() ? s.buffer + 2 : -1);

        ctx.S0L = (ctx.S0 >= 0 ? s.left_most_child.get(ctx.S0) : -1);
        ctx.S0R = (ctx.S0 >= 0 ? s.right_most_child.get(ctx.S0) : -1);
        ctx.S0L2 = (ctx.S0 >= 0 ? s.left_2nd_most_child.get(ctx.S0) : -1);
        ctx.S0R2 = (ctx.S0 >= 0 ? s.right_2nd_most_child.get(ctx.S0) : -1);
        ctx.S0LL = (ctx.S0L >= 0 ? s.left_most_child.get(ctx.S0L) : -1);
        ctx.S0RR = (ctx.S0R >= 0 ? s.right_most_child.get(ctx.S0R) : -1);

        ctx.S1L = (ctx.S1 >= 0 ? s.left_most_child.get(ctx.S1) : -1);
        ctx.S1R = (ctx.S1 >= 0 ? s.right_most_child.get(ctx.S1) : -1);
        ctx.S1L2 = (ctx.S1 >= 0 ? s.left_2nd_most_child.get(ctx.S1) : -1);
        ctx.S1R2 = (ctx.S1 >= 0 ? s.right_2nd_most_child.get(ctx.S1) : -1);
        ctx.S1LL = (ctx.S1L >= 0 ? s.left_most_child.get(ctx.S1L) : -1);
        ctx.S1RR = (ctx.S1R >= 0 ? s.right_most_child.get(ctx.S1R) : -1);
    }
1082714
public final String getState() {

        String thisMethodName = "getState";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
            SibTr.exit(tc, thisMethodName, states[_state]);
        }

        return states[_state];
    }
288536
function(state) {
      if(state == inputEx.stateRequired) {
         return this.options.messages.required;
      }
      else if(state == inputEx.stateInvalid) {
         return this.options.messages.invalid;
      }
      else {
         return '';
      }
	}
1316386
function(state, transitionContext)
  {
    // this check is necessary to make sure we don't re-enter a transient state
    // like Renewing when we're already in it
    if (currentState !== state)
    {
      // if we have a current state, exit it; the null check is necessary
      // because the currentState is undefined at bootstrap time when we
      // transition to the first state
      if (currentState)
      {
        currentState.exit();
      }

      // update the current state
      currentState = state;

      // enter the new state
      currentState.enter(transitionContext);
    }
  }
142629
public boolean getState()
    {
        if (this.getData() == null)
            return m_bTrueIfNull;
        int fieldValue = (int)this.getValue();
        boolean returnValue = false;
        if ((fieldValue & (1 << m_iBitNumber)) != 0)
            returnValue = true;
        if (m_bTrueIfMatch)
            return returnValue;
        else
            return !returnValue;
    }
479067
private static Context getContextForArrowFunctionBody(Context context) {
    return context.inForInInitClause()
        ? Context.START_OF_ARROW_FN_IN_FOR_INIT
        : Context.START_OF_ARROW_FN_BODY;
  }
557516
public Object getStateOrCreate(long txid, StateInitializer init) {
        if(_curr.containsKey(txid)) {
            return _curr.get(txid);
        } else {
            getState(txid, init);
            return null;
        }
    }
23364
function ctx() {
    return function context(req, res, next) {
        var data = {};

        req.set = function set(key, value) {
            assert.string(key, 'key must be string');

            if (key === '') {
                assert.fail('key must not be empty string');
            }
            data[key] = value;
        };

        req.get = function get(key) {
            assert.string(key, 'key must be string');

            if (key === '') {
                assert.fail('key must not be empty string');
            }
            return data[key];
        };

        // private method which returns the entire context object
        req._getAllContext = function _getAllContext() {
            return data;
        };

        return next();
    };
}
654563
function popContext(state) {
        if (state.context) {
            var oldContext = state.context;
            state.context = oldContext.prev;
            return oldContext;
        }
        
        // we shouldn't be here - it means we didn't have a context to pop
        return null;
    }
1042798
function(initState) {

    if(!this.isInitialized) {
      this.isInitialized = true;

      var driver = this.driver;

      if(!this.defStates) {

        throw new Error('You must define states before attempting to call init');
      } else if(!this.defTransitions) {

        throw new Error('You must define transitions before attempting to call init');
      } else if(!this.parser) {

        throw new Error('You must define parsers before attempting to call init');
      } else if(!this.defTargets) {

        throw new Error('You must define targets before attempting to call init');
      } else {

        parseStates(driver, this.defStates);
        parseTransitions(driver, this.defStates, this.defTransitions);

        this.parser.init(this.defStates, this.defTargets, this.defTransitions);

        driver.init(initState);
      }

      if(global.__f1__) {
        global.__f1__.init(this);
      } 
    }

    return this;
  }
1154937
function( state ) {
			var key,
				clonedState = {};

			for( key in state ) {
				if( key !== LOCAL ) {
					clonedState[ key ] = state[ key ];
				}
			}

			return clonedState;
		}
1247854
@CheckReturnValue
  Context transitionToState(HtmlContext state) {
    Context.Builder builder = toBuilder().withState(state).withUriPart(UriPart.NONE);
    if (uriPart != UriPart.NONE) {
      // Only reset the URI type if we're leaving a URI; intentionally, URI type needs to
      // remain prior to the URI, for example, to maintain state between "src", the "=", and
      // the opening quotes (if any).
      builder.withUriType(UriType.NONE);
    }
    return builder.build();
  }
1136169
def _handle_return(state: GlobalState) -> None:
        
        stack = state.mstate.stack
        try:
            offset, length = get_concrete_int(stack[-1]), get_concrete_int(stack[-2])
        except TypeError:
            return
        for element in state.mstate.memory[offset : offset + length]:
            if not isinstance(element, Expression):
                continue
            for annotation in element.annotations:
                if isinstance(annotation, OverUnderflowAnnotation):
                    state.annotate(
                        OverUnderflowStateAnnotation(
                            annotation.overflowing_state,
                            annotation.operator,
                            annotation.constraint,
                        )
                    )