diff --git a/Jint.Tests/Runtime/WeakSetMapTests.cs b/Jint.Tests/Runtime/WeakSetMapTests.cs index 154c44c7e1..537bb9db64 100644 --- a/Jint.Tests/Runtime/WeakSetMapTests.cs +++ b/Jint.Tests/Runtime/WeakSetMapTests.cs @@ -52,7 +52,7 @@ public void WeakSetAddShouldThrowForPrimitiveKey(JsValue key) public void WeakMapSetShouldThrowForPrimitiveKey(JsValue key) { var engine = new Engine(); - var weakMap = new WeakMapInstance(engine); + var weakMap = new JsWeakMap(engine); var e = Assert.Throws(() => weakMap.WeakMapSet(key, new JsObject(engine))); Assert.StartsWith("WeakMap key must be an object, got ", e.Message); diff --git a/Jint/Native/WeakMap/WeakMapInstance.cs b/Jint/Native/WeakMap/JsWeakMap.cs similarity index 90% rename from Jint/Native/WeakMap/WeakMapInstance.cs rename to Jint/Native/WeakMap/JsWeakMap.cs index 3daf413ce8..daa3770f42 100644 --- a/Jint/Native/WeakMap/WeakMapInstance.cs +++ b/Jint/Native/WeakMap/JsWeakMap.cs @@ -5,11 +5,11 @@ namespace Jint.Native.WeakMap; -internal sealed class WeakMapInstance : ObjectInstance +internal sealed class JsWeakMap : ObjectInstance { private readonly ConditionalWeakTable _table; - public WeakMapInstance(Engine engine) : base(engine) + public JsWeakMap(Engine engine) : base(engine) { _table = new ConditionalWeakTable(); } diff --git a/Jint/Native/WeakMap/WeakMapConstructor.cs b/Jint/Native/WeakMap/WeakMapConstructor.cs index 948e238bd4..0b513bb4a8 100644 --- a/Jint/Native/WeakMap/WeakMapConstructor.cs +++ b/Jint/Native/WeakMap/WeakMapConstructor.cs @@ -35,7 +35,7 @@ public override ObjectInstance Construct(JsValue[] arguments, JsValue newTarget) var map = OrdinaryCreateFromConstructor( newTarget, static intrinsics => intrinsics.WeakMap.PrototypeObject, - static (Engine engine, Realm _, object? _) => new WeakMapInstance(engine)); + static (Engine engine, Realm _, object? _) => new JsWeakMap(engine)); if (arguments.Length > 0 && !arguments[0].IsNullOrUndefined()) { var adder = map.Get("set"); diff --git a/Jint/Native/WeakMap/WeakMapPrototype.cs b/Jint/Native/WeakMap/WeakMapPrototype.cs index a73f83c661..528328567f 100644 --- a/Jint/Native/WeakMap/WeakMapPrototype.cs +++ b/Jint/Native/WeakMap/WeakMapPrototype.cs @@ -70,9 +70,9 @@ private JsValue Has(JsValue thisObject, JsValue[] arguments) return map.WeakMapHas(arguments.At(0)) ? JsBoolean.True : JsBoolean.False; } - private WeakMapInstance AssertWeakMapInstance(JsValue thisObject) + private JsWeakMap AssertWeakMapInstance(JsValue thisObject) { - if (thisObject is WeakMapInstance map) + if (thisObject is JsWeakMap map) { return map; }