DebugScopeType.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. namespace Jint.Runtime.Debugger
  2. {
  3. /// <summary>
  4. /// Variable scope type.
  5. /// These mirror <see href="https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#type-Scope">Chrome DevTools Protocol</see>.
  6. /// </summary>
  7. public enum DebugScopeType
  8. {
  9. /// <summary>
  10. /// Global scope bindings.
  11. /// </summary>
  12. /// <remarks>
  13. /// In Jint, this scope also includes bindings that would normally be part of <see cref="Script"/>.
  14. /// A scope chain will only include one scope of this type.
  15. /// </remarks>
  16. Global,
  17. /// <summary>
  18. /// Block scope bindings (let/const) defined at top level.
  19. /// </summary>
  20. /// <remarks>Not currently implemented by Jint. These bindings are instead included in <see cref="Global" />.</remarks>
  21. Script,
  22. /// <summary>
  23. /// Function local bindings.
  24. /// </summary>
  25. /// <remarks>
  26. /// Function scoped variables.
  27. /// Note that variables in outer functions are in <see cref="Closure"/> scopes.
  28. /// A scope chain will only include one scope of this type.
  29. /// </remarks>
  30. Local,
  31. /// <summary>
  32. /// Block scoped bindings.
  33. /// </summary>
  34. /// <remarks>
  35. /// This scope is not used for block scoped variables (let/const) declared at the top level of the <see cref="Global">global</see> scope.
  36. /// Unlike Chromium V8, it *is* used as a separate scope for block scoped variables declared at the top level of a function.
  37. /// A scope chain may include more than one scope of this type.
  38. /// </remarks>
  39. Block,
  40. /// <summary>
  41. /// Catch scope bindings.
  42. /// </summary>
  43. /// <remarks>
  44. /// This scope only includes the argument of a <c>catch</c> clause in a <c>try/catch</c> statement.
  45. /// A scope chain may include more than one scope of this type.
  46. /// </remarks>
  47. Catch,
  48. /// <summary>
  49. /// Function scope bindings in outer functions.
  50. /// </summary>
  51. /// <remarks>
  52. /// Unlike Chromium V8, which will optimize variables out that aren't referenced from the inner scope,
  53. /// Jint includes local variables from the outer function in this scope.
  54. /// A scope chain may include more than one scope of this type.
  55. /// </remarks>
  56. Closure,
  57. /// <summary>
  58. /// With scope bindings.
  59. /// </summary>
  60. /// <remarks>
  61. /// Includes the bindings created from properties of object used as argument to a <c>with</c> statement.
  62. /// A scope chain may include more than one scope of this type.
  63. /// </remarks>
  64. With,
  65. /// <summary>
  66. /// Eval scope bindings.
  67. /// </summary>
  68. /// <remarks>Variables declared in an evaluated string. Not implemented.</remarks>
  69. Eval,
  70. /// <summary>
  71. /// Module scope bindings.
  72. /// </summary>
  73. /// <remarks>Not currently implemented by Jint.</remarks>
  74. Module,
  75. /// <summary>
  76. /// WebAssembly expression stack bindings.
  77. /// </summary>
  78. /// <remarks>Not currently implemented by Jint.</remarks>
  79. WasmExpressionStack
  80. }
  81. }