Esempio n. 1
0
        protected override Completion ExecuteInternal()
        {
            var jsValue = _discriminant.GetValue();
            var r       = _switchBlock.Execute(jsValue);

            if (r.Type == CompletionType.Break && r.Identifier == _statement.LabelSet?.Name)
            {
                return(new Completion(CompletionType.Normal, r.Value, null, Location));
            }

            return(r);
        }
Esempio n. 2
0
        protected override Completion ExecuteInternal(EvaluationContext context)
        {
            var value = _discriminant.GetValue(context).Value;
            var r     = _switchBlock.Execute(context, value);

            if (r.Type == CompletionType.Break && r.Target == _statement.LabelSet?.Name)
            {
                return(NormalCompletion(r.Value));
            }

            return(r);
        }