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)); }
public static XMLLib ExtractFromScopeOrNull(IScriptable scope) { ScriptableObject so = ScriptRuntime.getLibraryScopeOrNull(scope); if (so == null) { return(null); } return((XMLLib)so.GetAssociatedValue(XML_LIB_KEY)); }