Skip to content

Commit

Permalink
Rename SetInstance to JsSet (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Jul 30, 2023
1 parent 4bff490 commit c52ff7f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Jint/Native/Set/SetInstance.cs → Jint/Native/Set/JsSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

namespace Jint.Native.Set;

internal sealed class SetInstance : ObjectInstance
internal sealed class JsSet : ObjectInstance
{
internal readonly OrderedSet<JsValue> _set;

public SetInstance(Engine engine) : base(engine)
public JsSet(Engine engine) : base(engine)
{
_set = new OrderedSet<JsValue>(SameValueZeroComparer.Instance);
}
Expand Down
2 changes: 1 addition & 1 deletion Jint/Native/Set/SetConstructor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
var set = OrdinaryCreateFromConstructor(
newTarget,
static intrinsics => intrinsics.Set.PrototypeObject,
static (Engine engine, Realm _, object? _) => new SetInstance(engine));
static (Engine engine, Realm _, object? _) => new JsSet(engine));

if (arguments.Length > 0 && !arguments[0].IsNullOrUndefined())
{
Expand Down
8 changes: 4 additions & 4 deletions Jint/Native/Set/SetIteratorPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ protected override void Initialize()
SetSymbols(symbols);
}

internal IteratorInstance ConstructEntryIterator(SetInstance set)
internal IteratorInstance ConstructEntryIterator(JsSet set)
{
var instance = new SetEntryIterator(Engine, set);
return instance;
}

internal IteratorInstance ConstructValueIterator(SetInstance set)
internal IteratorInstance ConstructValueIterator(JsSet set)
{
var instance = new SetValueIterator(Engine, set._set._list);
return instance;
}

private sealed class SetEntryIterator : IteratorInstance
{
private readonly SetInstance _set;
private readonly JsSet _set;
private int _position;

public SetEntryIterator(Engine engine, SetInstance set) : base(engine)
public SetEntryIterator(Engine engine, JsSet set) : base(engine)
{
_prototype = engine.Realm.Intrinsics.SetIteratorPrototype;
_set = set;
Expand Down
4 changes: 2 additions & 2 deletions Jint/Native/Set/SetPrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ private ObjectInstance Values(JsValue thisObject, JsValue[] arguments)
return set.Values();
}

private SetInstance AssertSetInstance(JsValue thisObject)
private JsSet AssertSetInstance(JsValue thisObject)
{
if (thisObject is SetInstance set)
if (thisObject is JsSet set)
{
return set;
}
Expand Down

0 comments on commit c52ff7f

Please sign in to comment.