TypeReferencePrototype.cs 745 B

1234567891011121314151617181920212223242526
  1. using Jint.Native;
  2. using Jint.Native.Object;
  3. using Jint.Runtime.Descriptors;
  4. namespace Jint.Runtime.Interop;
  5. internal sealed class TypeReferencePrototype : ObjectInstance
  6. {
  7. public TypeReferencePrototype(Engine engine, TypeReference typeReference) : base(engine)
  8. {
  9. TypeReference = typeReference;
  10. _prototype = engine.Realm.Intrinsics.Object.PrototypeObject;
  11. }
  12. public TypeReference TypeReference { get; }
  13. public override PropertyDescriptor GetOwnProperty(JsValue property)
  14. {
  15. var descriptor = TypeReference.GetOwnProperty(property);
  16. if (descriptor != PropertyDescriptor.Undefined)
  17. {
  18. return descriptor;
  19. }
  20. return base.GetOwnProperty(property);
  21. }
  22. }