def alert(string): print string def failing_function(): alert("hi") alert = window.alert