Unity 5 Not asking to save scene after new object added

This will be the second time ive tried to post this question now! I dont know what the problem is.

Add this code to a Editor Window script, add an object through script then try to create a new scene. Why does unity not ask to save the scene before opening a new one?

Event e = Event.current;
        switch (e.type)
        {
            case EventType.keyDown:
                {
                    if (e.keyCode == KeyCode.Escape)
                    {
                        GameObject b = new GameObject();
                        b.transform.position = new Vector3(0,0,0);
                    }
                    e.Use();    
                }
                break;
        }

How on earth are we supposed to find out updates like this?!