DataDescriptor.cs 907 B

123456789101112131415161718192021222324252627282930313233343536
  1. namespace Jint.Runtime.Descriptors
  2. {
  3. public class DataDescriptor : PropertyDescriptor
  4. {
  5. public DataDescriptor(object value)
  6. {
  7. Value = value;
  8. Writable = true;
  9. }
  10. public DataDescriptor(DataDescriptor d)
  11. {
  12. Value = d.Value;
  13. Writable = d.Writable;
  14. Configurable = d.Configurable;
  15. Enumerable = d.Enumerable;
  16. }
  17. public object Value { get; set; }
  18. /// <summary>
  19. /// If false, attempts by ECMAScript code to change the
  20. /// property‘s [[Value]] attribute using [[Put]] will not succeed.
  21. /// </summary>
  22. public bool Writable { get; set; }
  23. public override bool IsAccessorDescriptor()
  24. {
  25. return false;
  26. }
  27. public override bool IsDataDescriptor()
  28. {
  29. return true;
  30. }
  31. }
  32. }