Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 25222:fbb530e081ca v8.2.3147
patch 8.2.3147: Vim9: profiling does not work with a nested function
Commit: https://github.com/vim/vim/commit/648594eaf703fe9a862cb12a35702a10aff6e5a9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 11 17:55:01 2021 +0200
patch 8.2.3147: Vim9: profiling does not work with a nested function
Problem: Vim9: profiling does not work with a nested function.
Solution: Also compile a nested function without profiling. (closes https://github.com/vim/vim/issues/8543)
Handle that compiling may cause the table of compiled functions to
change.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Jul 2021 18:00:04 +0200 |
parents | 89b39ce243e2 |
children | 658dfd6be868 |
comparison
equal
deleted
inserted
replaced
25221:7bff292bff66 | 25222:fbb530e081ca |
---|---|
4175 .. ' continued' | 4175 .. ' continued' |
4176 END | 4176 END |
4177 CheckDefExecAndScriptFailure(lines, 'some error continued', 1) | 4177 CheckDefExecAndScriptFailure(lines, 'some error continued', 1) |
4178 enddef | 4178 enddef |
4179 | 4179 |
4180 def ProfiledFunc() | 4180 def ProfiledWithLambda() |
4181 var n = 3 | 4181 var n = 3 |
4182 echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n) | 4182 echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n) |
4183 enddef | |
4184 | |
4185 def ProfiledNested() | |
4186 var x = 0 | |
4187 def Nested(): any | |
4188 return x | |
4189 enddef | |
4190 Nested() | |
4183 enddef | 4191 enddef |
4184 | 4192 |
4185 " Execute this near the end, profiling doesn't stop until Vim exists. | 4193 " Execute this near the end, profiling doesn't stop until Vim exists. |
4186 " This only tests that it works, not the profiling output. | 4194 " This only tests that it works, not the profiling output. |
4187 def Test_xx_profile_with_lambda() | 4195 def Test_xx_profile_with_lambda() |
4188 CheckFeature profile | 4196 CheckFeature profile |
4189 | 4197 |
4190 profile start Xprofile.log | 4198 profile start Xprofile.log |
4191 profile func ProfiledFunc | 4199 profile func ProfiledWithLambda |
4192 ProfiledFunc() | 4200 ProfiledWithLambda() |
4201 profile func ProfiledNested | |
4202 ProfiledNested() | |
4193 enddef | 4203 enddef |
4194 | 4204 |
4195 " Keep this last, it messes up highlighting. | 4205 " Keep this last, it messes up highlighting. |
4196 def Test_substitute_cmd() | 4206 def Test_substitute_cmd() |
4197 new | 4207 new |