diff --git a/Jint.Tests/Runtime/WeakSetMapTests.cs b/Jint.Tests/Runtime/WeakSetMapTests.cs index 0d7fffe5c2..154c44c7e1 100644 --- a/Jint.Tests/Runtime/WeakSetMapTests.cs +++ b/Jint.Tests/Runtime/WeakSetMapTests.cs @@ -39,7 +39,7 @@ public void WeakSetShouldThrowWhenCalledWithoutNew() public void WeakSetAddShouldThrowForPrimitiveKey(JsValue key) { var engine = new Engine(); - var weakSet = new WeakSetInstance(engine); + var weakSet = new JsWeakSet(engine); var e = Assert.Throws(() => weakSet.WeakSetAdd(key)); Assert.StartsWith("WeakSet value must be an object or symbol, got ", e.Message); diff --git a/Jint/Native/WeakSet/WeakSetInstance.cs b/Jint/Native/WeakSet/JsWeakSet.cs similarity index 88% rename from Jint/Native/WeakSet/WeakSetInstance.cs rename to Jint/Native/WeakSet/JsWeakSet.cs index 8882c73a44..32883db12d 100644 --- a/Jint/Native/WeakSet/WeakSetInstance.cs +++ b/Jint/Native/WeakSet/JsWeakSet.cs @@ -5,11 +5,11 @@ namespace Jint.Native.WeakSet; -internal sealed class WeakSetInstance : ObjectInstance +internal sealed class JsWeakSet : ObjectInstance { private readonly ConditionalWeakTable _table; - public WeakSetInstance(Engine engine) : base(engine) + public JsWeakSet(Engine engine) : base(engine) { _table = new ConditionalWeakTable(); } diff --git a/Jint/Native/WeakSet/WeakSetConstructor.cs b/Jint/Native/WeakSet/WeakSetConstructor.cs index 1ead0877f9..987dd8beeb 100644 --- a/Jint/Native/WeakSet/WeakSetConstructor.cs +++ b/Jint/Native/WeakSet/WeakSetConstructor.cs @@ -34,7 +34,7 @@ public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget) var set = OrdinaryCreateFromConstructor( newTarget, static intrinsics => intrinsics.WeakSet.PrototypeObject, - static (Engine engine, Realm _, object? _) => new WeakSetInstance(engine)); + static (Engine engine, Realm _, object? _) => new JsWeakSet(engine)); var arg1 = arguments.At(0); if (!arg1.IsNullOrUndefined()) diff --git a/Jint/Native/WeakSet/WeakSetPrototype.cs b/Jint/Native/WeakSet/WeakSetPrototype.cs index 0bb8612e21..43e8ea2c02 100644 --- a/Jint/Native/WeakSet/WeakSetPrototype.cs +++ b/Jint/Native/WeakSet/WeakSetPrototype.cs @@ -66,9 +66,9 @@ private JsValue Has(JsValue thisObject, JsValue[] arguments) return set.WeakSetHas(arguments.At(0)) ? JsBoolean.True : JsBoolean.False; } - private WeakSetInstance AssertWeakSetInstance(JsValue thisObject) + private JsWeakSet AssertWeakSetInstance(JsValue thisObject) { - if (thisObject is WeakSetInstance set) + if (thisObject is JsWeakSet set) { return set; }