TypeReferencePrototype.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //using Jint.Native;
  2. //using Jint.Native.Object;
  3. //namespace Jint.Runtime.Interop
  4. //{
  5. // public sealed class TypeReferencePrototype : ObjectInstance
  6. // {
  7. // private TypeReferencePrototype(Engine engine)
  8. // : base(engine)
  9. // {
  10. // }
  11. // public static TypeReferencePrototype CreatePrototypeObject(Engine engine, TypeReference typeReferenceConstructor)
  12. // {
  13. // var obj = new TypeReferencePrototype(engine);
  14. // obj.Prototype = engine.Object.PrototypeObject;
  15. // obj.Extensible = false;
  16. // obj.FastAddProperty("constructor", typeReferenceConstructor, true, false, true);
  17. // return obj;
  18. // }
  19. // public void Configure()
  20. // {
  21. // FastAddProperty("toString", new ClrFunctionInstance(Engine, ToTypeReferenceString), true, false, true);
  22. // }
  23. // private JsValue ToTypeReferenceString(JsValue thisObj, JsValue[] arguments)
  24. // {
  25. // var typeReference = thisObj.As<TypeReference>();
  26. // if (typeReference == null)
  27. // {
  28. // throw new JavaScriptException(Engine.TypeError);
  29. // }
  30. // return typeReference.Type.FullName;
  31. // }
  32. // }
  33. //}