Skip to content

Commit

Permalink
JSS.Lib: Implement a basic Object.prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestonLTaylor committed Jan 11, 2024
1 parent 063f502 commit 7eb28e0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions JSS.Lib/Runtime/Object.prototype.cs
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();
}

0 comments on commit 7eb28e0

Please sign in to comment.