Skip to content

Commit

Permalink
Make JsSet public
Browse files Browse the repository at this point in the history
  • Loading branch information
kenlyon committed Oct 24, 2024
1 parent 6cb6d5d commit 9fc2663
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions Jint/Native/JsSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Jint.Native;

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

Expand Down Expand Up @@ -47,17 +47,17 @@ protected override bool TryGetProperty(JsValue property, [NotNullWhen(true)] out
return base.TryGetProperty(property, out descriptor);
}

internal void Add(JsValue value) => _set.Add(value);
public void Add(JsValue value) => _set.Add(value);

internal void Remove(JsValue value) => _set.Remove(value);
public void Remove(JsValue value) => _set.Remove(value);

internal void Clear() => _set.Clear();
public void Clear() => _set.Clear();

internal bool Has(JsValue key) => _set.Contains(key);
public bool Has(JsValue key) => _set.Contains(key);

internal bool SetDelete(JsValue key) => _set.Remove(key);
public bool SetDelete(JsValue key) => _set.Remove(key);

internal void ForEach(ICallable callable, JsValue thisArg)
public void ForEach(ICallable callable, JsValue thisArg)
{
var args = _engine._jsValueArrayPool.RentArray(3);
args[2] = this;
Expand All @@ -73,7 +73,7 @@ internal void ForEach(ICallable callable, JsValue thisArg)
_engine._jsValueArrayPool.ReturnArray(args);
}

internal ObjectInstance Entries() => _engine.Realm.Intrinsics.SetIteratorPrototype.ConstructEntryIterator(this);
public ObjectInstance Entries() => _engine.Realm.Intrinsics.SetIteratorPrototype.ConstructEntryIterator(this);

internal ObjectInstance Values() => _engine.Realm.Intrinsics.SetIteratorPrototype.ConstructValueIterator(this);
public ObjectInstance Values() => _engine.Realm.Intrinsics.SetIteratorPrototype.ConstructValueIterator(this);
}
2 changes: 1 addition & 1 deletion Jint/Runtime/OrderedSet.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Jint.Runtime;

internal sealed class OrderedSet<T>
public sealed class OrderedSet<T>
{
internal List<T> _list;
internal HashSet<T> _set;
Expand Down

0 comments on commit 9fc2663

Please sign in to comment.