public bool TryGetValue(TKey key, out TValue value)
        {
            object retVal;

            if (dict.TryGetValue(key, out retVal))
            {
                // will throw InvalidCastException (TypeError) if this fails.
                value = (TValue)retVal;
                return(true);
            }
            value = default(TValue);
            return(false);
        }
Esempio n. 2
0
 internal bool TryLookupName(string name, out object?value)
 => Dict.TryGetValue(name, out value) || ModuleContext.Globals.TryGetValue(name, out value);