DebugScopeType.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. namespace Jint.Runtime.Debugger;
  2. /// <summary>
  3. /// Variable scope type.
  4. /// These mirror <see href="https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#type-Scope">Chrome DevTools Protocol</see>.
  5. /// </summary>
  6. public enum DebugScopeType
  7. {
  8. /// <summary>
  9. /// Global scope bindings.
  10. /// </summary>
  11. /// <remarks>
  12. /// A scope chain will only include one scope of this type.
  13. /// </remarks>
  14. Global,
  15. /// <summary>
  16. /// Block scope bindings (let/const) defined at top level.
  17. /// </summary>
  18. /// <remarks>
  19. /// A scope chain will only include one scope of this type.
  20. /// </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. Module,
  74. /// <summary>
  75. /// WebAssembly expression stack bindings.
  76. /// </summary>
  77. /// <remarks>Not currently implemented by Jint.</remarks>
  78. WasmExpressionStack
  79. }