public ILLabel GetBreakTarget(string labelName = null)
{
if (labelName == null)
{
foreach (var info in this.breakOrContinueStack)
{
if (info.LabelledOnly == false)
return info.BreakTarget;
}
throw new JavaScriptException(this.Engine, ErrorType.SyntaxError, "Illegal break statement", this.SourceSpan.StartLine, this.Source.Path, this.FunctionName);
}
else
{
foreach (var info in this.breakOrContinueStack)
{
if (info.LabelNames != null && info.LabelNames.Contains(labelName) == true)
return info.BreakTarget;
}
throw new JavaScriptException(this.Engine, ErrorType.SyntaxError, string.Format("Undefined label '{0}'", labelName), this.SourceSpan.StartLine, this.Source.Path, this.FunctionName);
}
}