Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 25230:658dfd6be868 v8.2.3151
patch 8.2.3151: Vim9: profiling fails if nested function is also profiled
Commit: https://github.com/vim/vim/commit/ffcfddc759e583471a1ed55e0938d042bf68c507
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 11 20:22:30 2021 +0200
patch 8.2.3151: Vim9: profiling fails if nested function is also profiled
Problem: Vim9: profiling fails if nested function is also profiled.
Solution: Use the compile type from the outer function. (closes https://github.com/vim/vim/issues/8543)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Jul 2021 20:30:04 +0200 |
parents | fbb530e081ca |
children | a60895011da9 |
comparison
equal
deleted
inserted
replaced
25229:86d819a48d9f | 25230:658dfd6be868 |
---|---|
4188 return x | 4188 return x |
4189 enddef | 4189 enddef |
4190 Nested() | 4190 Nested() |
4191 enddef | 4191 enddef |
4192 | 4192 |
4193 def ProfiledNestedProfiled() | |
4194 var x = 0 | |
4195 def Nested(): any | |
4196 return x | |
4197 enddef | |
4198 Nested() | |
4199 enddef | |
4200 | |
4193 " Execute this near the end, profiling doesn't stop until Vim exists. | 4201 " Execute this near the end, profiling doesn't stop until Vim exists. |
4194 " This only tests that it works, not the profiling output. | 4202 " This only tests that it works, not the profiling output. |
4195 def Test_xx_profile_with_lambda() | 4203 def Test_xx_profile_with_lambda() |
4196 CheckFeature profile | 4204 CheckFeature profile |
4197 | 4205 |
4198 profile start Xprofile.log | 4206 profile start Xprofile.log |
4199 profile func ProfiledWithLambda | 4207 profile func ProfiledWithLambda |
4200 ProfiledWithLambda() | 4208 ProfiledWithLambda() |
4209 | |
4201 profile func ProfiledNested | 4210 profile func ProfiledNested |
4202 ProfiledNested() | 4211 ProfiledNested() |
4212 | |
4213 # Also profile the nested function. Use a different function, although the | |
4214 # contents is the same, to make sure it was not already compiled. | |
4215 profile func * | |
4216 ProfiledNestedProfiled() | |
4217 | |
4218 profdel func * | |
4219 profile pause | |
4203 enddef | 4220 enddef |
4204 | 4221 |
4205 " Keep this last, it messes up highlighting. | 4222 " Keep this last, it messes up highlighting. |
4206 def Test_substitute_cmd() | 4223 def Test_substitute_cmd() |
4207 new | 4224 new |