ClrAccessDescriptor.cs 661 B

12345678910111213141516171819202122
  1. using System;
  2. using Jint.Native;
  3. using Jint.Runtime.Interop;
  4. namespace Jint.Runtime.Descriptors.Specialized
  5. {
  6. public sealed class ClrAccessDescriptor : PropertyDescriptor
  7. {
  8. public ClrAccessDescriptor(Engine engine, Func<JsValue, JsValue> get)
  9. : this(engine, get, null)
  10. {
  11. }
  12. public ClrAccessDescriptor(Engine engine, Func<JsValue, JsValue> get, Action<JsValue, JsValue> set)
  13. : base(
  14. get: new GetterFunctionInstance(engine, get),
  15. set: set == null ? Native.Undefined.Instance : new SetterFunctionInstance(engine, set)
  16. )
  17. {
  18. }
  19. }
  20. }