TypeReferencePrototype.cs 735 B

1234567891011121314151617181920212223
  1. using Jint.Collections;
  2. using Jint.Native;
  3. using Jint.Native.Symbol;
  4. using Jint.Runtime.Descriptors;
  5. namespace Jint.Runtime.Interop;
  6. internal sealed class TypeReferencePrototype : Prototype
  7. {
  8. public TypeReferencePrototype(Engine engine, TypeReference typeReference) : base(engine, engine.Realm)
  9. {
  10. TypeReference = typeReference;
  11. _prototype = engine.Realm.Intrinsics.Object.PrototypeObject;
  12. var symbols = new SymbolDictionary(1)
  13. {
  14. [GlobalSymbolRegistry.ToStringTag] = new PropertyDescriptor(typeReference.ReferenceType.Name, writable: false, enumerable: false, configurable: true),
  15. };
  16. SetSymbols(symbols);
  17. }
  18. public TypeReference TypeReference { get; }
  19. }