-
-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support CLR object inheritance chain with prototypes (#1518)
Co-authored-by: Marko Lahma <[email protected]>
- Loading branch information
Showing
3 changed files
with
61 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,14 @@ | ||
//using Jint.Native; | ||
//using Jint.Native.Object; | ||
using Jint.Native.Object; | ||
|
||
//namespace Jint.Runtime.Interop | ||
//{ | ||
// public sealed class TypeReferencePrototype : ObjectInstance | ||
// { | ||
// private TypeReferencePrototype(Engine engine) | ||
// : base(engine) | ||
// { | ||
// } | ||
namespace Jint.Runtime.Interop; | ||
|
||
// public static TypeReferencePrototype CreatePrototypeObject(Engine engine, TypeReference typeReferenceConstructor) | ||
// { | ||
// var obj = new TypeReferencePrototype(engine); | ||
// obj.Prototype = engine.Object.PrototypeObject; | ||
// obj.Extensible = false; | ||
internal sealed class TypeReferencePrototype : ObjectInstance | ||
{ | ||
public TypeReferencePrototype(Engine engine, TypeReference typeReference) : base(engine) | ||
{ | ||
TypeReference = typeReference; | ||
_prototype = engine.Realm.Intrinsics.Object.PrototypeObject; | ||
} | ||
|
||
// obj.FastAddProperty("constructor", typeReferenceConstructor, true, false, true); | ||
|
||
// return obj; | ||
// } | ||
|
||
// public void Configure() | ||
// { | ||
// FastAddProperty("toString", new ClrFunctionInstance(Engine, ToTypeReferenceString), true, false, true); | ||
// } | ||
|
||
// private JsValue ToTypeReferenceString(JsValue thisObj, JsValue[] arguments) | ||
// { | ||
// var typeReference = thisObj.As<TypeReference>(); | ||
// if (typeReference == null) | ||
// { | ||
// ExceptionHelper.ThrowTypeError(Engine); | ||
// } | ||
|
||
// return typeReference.Type.FullName; | ||
// } | ||
// } | ||
//} | ||
public TypeReference TypeReference { get; } | ||
} |