public static EcmaValue Add([This] EcmaValue thisValue, EcmaValue item) { EcmaWeakSet map = thisValue.GetUnderlyingObject <EcmaWeakSet>(); Guard.ArgumentIsObject(item, "Invalid value used in weak set"); map.Add(item.ToObject()); return(thisValue); }
public static EcmaValue Has([This] EcmaValue thisValue, EcmaValue item) { EcmaWeakSet map = thisValue.GetUnderlyingObject <EcmaWeakSet>(); if (item.Type != EcmaValueType.Object) { return(false); } return(map.Has(item.ToObject())); }