this does not lead to error, but if you're so worried about error why I not see any checking variables of editor, editor.getSession(), editor.getSession().getUndoManager() on null and undefined? anybody could pass wrong editor, but not everyone can call suppressIt with not boolean value