Completion.cs 957 B

12345678910111213141516171819202122232425262728293031323334
  1. using Jint.Native;
  2. namespace Jint.Runtime
  3. {
  4. /// <summary>
  5. /// http://www.ecma-international.org/ecma-262/5.1/#sec-8.9
  6. /// </summary>
  7. public class Completion
  8. {
  9. public static string Normal = "normal";
  10. public static string Break = "break";
  11. public static string Continue = "continue";
  12. public static string Return = "return";
  13. public static string Throw = "throw";
  14. public Completion(string type, JsValue value, string identifier)
  15. {
  16. Type = type;
  17. Value = value;
  18. Identifier = identifier;
  19. }
  20. public string Type { get; private set; }
  21. public JsValue Value { get; private set; }
  22. public string Identifier { get; private set; }
  23. public JsValue GetValueOrDefault()
  24. {
  25. return Value != null ? Value : Undefined.Instance;
  26. }
  27. public Jint.Parser.Location Location { get; set; }
  28. }
  29. }