Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 27669:5c4ab8d4472c v8.2.4360
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Commit: https://github.com/vim/vim/commit/a749a42ed25534c88c636e5ab6603f1f97b857a4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 12 19:52:25 2022 +0000
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
Problem: Vim9: allowing use of "s:" leads to inconsistencies.
Solution: Disallow using "s:" in Vim9 script at the script level.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 12 Feb 2022 21:00:03 +0100 |
parents | 68eac9355e49 |
children | fdc841530372 |
comparison
equal
deleted
inserted
replaced
27668:407a08328369 | 27669:5c4ab8d4472c |
---|---|
1999 insert(test_null_blob(), 123) | 1999 insert(test_null_blob(), 123) |
2000 END | 2000 END |
2001 v9.CheckDefExecAndScriptFailure(lines, 'E1131:', 1) | 2001 v9.CheckDefExecAndScriptFailure(lines, 'E1131:', 1) |
2002 | 2002 |
2003 assert_equal([1, 2, 3], insert([2, 3], 1)) | 2003 assert_equal([1, 2, 3], insert([2, 3], 1)) |
2004 assert_equal([1, 2, 3], insert([2, 3], s:number_one)) | 2004 assert_equal([1, 2, 3], insert([2, 3], number_one)) |
2005 assert_equal([1, 2, 3], insert([1, 2], 3, 2)) | 2005 assert_equal([1, 2, 3], insert([1, 2], 3, 2)) |
2006 assert_equal([1, 2, 3], insert([1, 2], 3, s:number_two)) | 2006 assert_equal([1, 2, 3], insert([1, 2], 3, number_two)) |
2007 assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a')) | 2007 assert_equal(['a', 'b', 'c'], insert(['b', 'c'], 'a')) |
2008 assert_equal(0z1234, insert(0z34, 0x12)) | 2008 assert_equal(0z1234, insert(0z34, 0x12)) |
2009 | 2009 |
2010 v9.CheckDefAndScriptFailure(['insert("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) | 2010 v9.CheckDefAndScriptFailure(['insert("a", 1)'], ['E1013: Argument 1: type mismatch, expected list<any> but got string', 'E1226: List or Blob required for argument 1']) |
2011 v9.CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string') | 2011 v9.CheckDefFailure(['insert([2, 3], "a")'], 'E1013: Argument 2: type mismatch, expected number but got string') |