public static void CheckScriptOwnership(this IScriptPrivateResource containingResource, DynValue value) { if (value.IsValid) { var otherResource = value.GetAsPrivateResource(); if (otherResource != null) { CheckScriptOwnership(containingResource, otherResource); } } }