updated for version 7.3.603
Problem: It is possible to add replace builtin functions by calling
extend() on g:.
Solution: Add a flag to a dict to indicate it is a scope. Check for
existing functions. (ZyX)
diff --git a/src/testdir/test34.in b/src/testdir/test34.in
index 28fd00c..5abc140 100644
--- a/src/testdir/test34.in
+++ b/src/testdir/test34.in
@@ -1,5 +1,6 @@
Test for user functions.
Also test an <expr> mapping calling a function.
+Also test that a builtin function cannot be replaced.
STARTTEST
:so small.vim
@@ -58,7 +59,10 @@
---*---
(one
(two
-[(one again:$-5,$w! test.out
+[(one again:call append(line('$'), max([1, 2, 3]))
+:call extend(g:, {'max': function('min')})
+:call append(line('$'), max([1, 2, 3]))
+:$-7,$w! test.out
:delfunc Table
:delfunc Compute
:delfunc Expr1
diff --git a/src/testdir/test34.ok b/src/testdir/test34.ok
index d71183d..6053812 100644
--- a/src/testdir/test34.ok
+++ b/src/testdir/test34.ok
@@ -4,3 +4,5 @@
1. one
2. two
1. one again
+3
+3