Пример #1
0
        internal XMLLib BindToScope(IScriptable scope)
        {
            ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope);

            if (so == null)
            {
                // standard library should be initialized at this point
                throw new Exception();
            }
            return((XMLLib)so.AssociateValue(XML_LIB_KEY, this));
        }
Пример #2
0
        public static XMLLib ExtractFromScopeOrNull(IScriptable scope)
        {
            ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope);

            if (so == null)
            {
                return(null);
            }

            return((XMLLib)so.GetAssociatedValue(XML_LIB_KEY));
        }