You can change your line 6 into the following snippet and it will behave far more intuitively for developer usage. (In that it will feed a message to the developer and explain why nothing is happening.) Stuff like this doesn’t exactly make sense that it’s not in the base engine… But there you have it.
if (Application.isEditor)
Debug.Log("Attempted to quit from the Editor.")
else if (Application.isWebPlayer)
Debug.Log("Attempted to quit from the Web Player.")
else
Application.Quit();