From c52ff7f8de06bd708929febcdd7de849807bfc72 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 30 Jul 2023 21:42:41 +0300 Subject: [PATCH] Rename SetInstance to JsSet (#1600) --- Jint/Native/Set/{SetInstance.cs => JsSet.cs} | 4 ++-- Jint/Native/Set/SetConstructor.cs | 2 +- Jint/Native/Set/SetIteratorPrototype.cs | 8 ++++---- Jint/Native/Set/SetPrototype.cs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) rename Jint/Native/Set/{SetInstance.cs => JsSet.cs} (94%) diff --git a/Jint/Native/Set/SetInstance.cs b/Jint/Native/Set/JsSet.cs similarity index 94% rename from Jint/Native/Set/SetInstance.cs rename to Jint/Native/Set/JsSet.cs index 828aed30da..d13d5ef417 100644 --- a/Jint/Native/Set/SetInstance.cs +++ b/Jint/Native/Set/JsSet.cs @@ -5,11 +5,11 @@ namespace Jint.Native.Set; -internal sealed class SetInstance : ObjectInstance +internal sealed class JsSet : ObjectInstance { internal readonly OrderedSet _set; - public SetInstance(Engine engine) : base(engine) + public JsSet(Engine engine) : base(engine) { _set = new OrderedSet(SameValueZeroComparer.Instance); } diff --git a/Jint/Native/Set/SetConstructor.cs b/Jint/Native/Set/SetConstructor.cs index 25b5f55968..2335432519 100644 --- a/Jint/Native/Set/SetConstructor.cs +++ b/Jint/Native/Set/SetConstructor.cs @@ -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()) { diff --git a/Jint/Native/Set/SetIteratorPrototype.cs b/Jint/Native/Set/SetIteratorPrototype.cs index d0873eca63..7f3f0501fe 100644 --- a/Jint/Native/Set/SetIteratorPrototype.cs +++ b/Jint/Native/Set/SetIteratorPrototype.cs @@ -35,13 +35,13 @@ 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; @@ -49,10 +49,10 @@ internal IteratorInstance ConstructValueIterator(SetInstance set) 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; diff --git a/Jint/Native/Set/SetPrototype.cs b/Jint/Native/Set/SetPrototype.cs index fd670e00ab..5f97ca8c0b 100644 --- a/Jint/Native/Set/SetPrototype.cs +++ b/Jint/Native/Set/SetPrototype.cs @@ -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; }