patch 8.2.1504: Vim9: white space checks are only done for a :def function

Problem:    Vim9: white space checks are only done for a :def function.
Solution:   Also do checks at the script level.  Adjust the name of a few
            error messages.
diff --git a/src/testdir/vim9.vim b/src/testdir/vim9.vim
index 823a6ca..2f92cf9 100644
--- a/src/testdir/vim9.vim
+++ b/src/testdir/vim9.vim
@@ -40,3 +40,10 @@
   so Xdef
   delete('Xdef')
 enddef
+
+" Check that a command fails both when used in a :def function and when used
+" in Vim9 script.
+def CheckScriptAndDefFailure(lines: list<string>, error: string, lnum = -3)
+  CheckDefFailure(lines, error, lnum)
+  CheckScriptFailure(['vim9script'] + lines, error, lnum + 1)
+enddef