-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSS.Lib: Implement a basic Object.prototype
- Loading branch information
1 parent
063f502
commit 7eb28e0
Showing
1 changed file
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using JSS.Lib.AST.Values; | ||
using Object = JSS.Lib.AST.Values.Object; | ||
|
||
namespace JSS.Lib.Runtime; | ||
|
||
// 20.1.3 Properties of the Object Prototype Object, https://tc39.es/ecma262/#sec-properties-of-the-object-prototype-object | ||
internal class ObjectPrototype : Object | ||
{ | ||
// The Object prototype object has a [[Prototype]] internal slot whose value is null. | ||
public ObjectPrototype() : base(null) | ||
{ | ||
DataProperties.Add("constructor", new Property(ObjectConstructor.The, new Attributes(true, false, true))); | ||
} | ||
|
||
static public ObjectPrototype The | ||
{ | ||
get | ||
{ | ||
return _prototype; | ||
} | ||
} | ||
static readonly private ObjectPrototype _prototype = new(); | ||
} |