DataDescriptor.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 bool WritableIsSet
  24. {
  25. get { return Writable.HasValue && Writable.Value; }
  26. }
  27. public override bool IsAccessorDescriptor()
  28. {
  29. return false;
  30. }
  31. public override bool IsDataDescriptor()
  32. {
  33. return true;
  34. }
  35. }
  36. }