TypeReferencePrototype.cs 711 B

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