-
-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude static fields and properties from ObjectWrapper by default (#…
- Loading branch information
Showing
9 changed files
with
110 additions
and
65 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
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
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,26 +1,23 @@ | ||
using Jint.Native; | ||
using Jint.Native.Object; | ||
using Jint.Collections; | ||
using Jint.Native; | ||
using Jint.Native.Symbol; | ||
using Jint.Runtime.Descriptors; | ||
|
||
namespace Jint.Runtime.Interop; | ||
|
||
internal sealed class TypeReferencePrototype : ObjectInstance | ||
internal sealed class TypeReferencePrototype : Prototype | ||
{ | ||
public TypeReferencePrototype(Engine engine, TypeReference typeReference) : base(engine) | ||
public TypeReferencePrototype(Engine engine, TypeReference typeReference) : base(engine, engine.Realm) | ||
{ | ||
TypeReference = typeReference; | ||
_prototype = engine.Realm.Intrinsics.Object.PrototypeObject; | ||
} | ||
|
||
public TypeReference TypeReference { get; } | ||
|
||
public override PropertyDescriptor GetOwnProperty(JsValue property) | ||
{ | ||
var descriptor = TypeReference.GetOwnProperty(property); | ||
if (descriptor != PropertyDescriptor.Undefined) | ||
var symbols = new SymbolDictionary(1) | ||
{ | ||
return descriptor; | ||
} | ||
return base.GetOwnProperty(property); | ||
[GlobalSymbolRegistry.ToStringTag] = new PropertyDescriptor(typeReference.ReferenceType.Name, writable: false, enumerable: false, configurable: true), | ||
}; | ||
SetSymbols(symbols); | ||
} | ||
|
||
public TypeReference TypeReference { get; } | ||
} |
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