Binding.cs 790 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Diagnostics;
  2. using Jint.Native;
  3. namespace Jint.Runtime.Environments;
  4. [DebuggerDisplay("Mutable: {Mutable}, Strict: {Strict}, CanBeDeleted: {CanBeDeleted}, Value: {Value}")]
  5. internal readonly struct Binding
  6. {
  7. public Binding(
  8. JsValue value,
  9. bool canBeDeleted,
  10. bool mutable,
  11. bool strict)
  12. {
  13. Value = value;
  14. CanBeDeleted = canBeDeleted;
  15. Mutable = mutable;
  16. Strict = strict;
  17. }
  18. public readonly JsValue Value;
  19. public readonly bool CanBeDeleted;
  20. public readonly bool Mutable;
  21. public readonly bool Strict;
  22. public Binding ChangeValue(JsValue argument)
  23. {
  24. return new Binding(argument, CanBeDeleted, Mutable, Strict);
  25. }
  26. public bool IsInitialized() => Value is not null;
  27. }