Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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()));
        }