EvaluationContext.cs 782 B

12345678910111213141516171819202122232425
  1. using Esprima.Ast;
  2. namespace Jint.Runtime.Interpreter
  3. {
  4. /// <summary>
  5. /// Per Engine.Evalute() call context.
  6. /// </summary>
  7. internal sealed class EvaluationContext
  8. {
  9. public EvaluationContext(Engine engine, in Completion? resumedCompletion = null)
  10. {
  11. Engine = engine;
  12. DebugMode = engine._isDebugMode;
  13. ResumedCompletion = resumedCompletion ?? default; // TODO later
  14. OperatorOverloadingAllowed = engine.Options.Interop.OperatorOverloadingAllowed;
  15. }
  16. public Engine Engine { get; }
  17. public Completion ResumedCompletion { get; }
  18. public bool DebugMode { get; }
  19. public Node LastSyntaxNode { get; set; }
  20. public bool OperatorOverloadingAllowed { get; }
  21. }
  22. }