nginx version: openresty/1.9.15.1LuaJIT 2.1.0-beta2 -- Copyright (C) 2005-2016 Mike Pall. http://luajit.org/lua代码: 1 function explode ( _str,seperator ) 2 local pos, arr = 0, {} 3 for st, sp in function() return string.find( _str, seperator, pos, true ) end do 4 table.insert( arr, string.sub( _str, pos, st-1 ) ) 5 pos = sp + 1 6 end 7 table.insert( arr, string.sub( _str, pos ) ) 8 return arr 9 end函数调用时,seperator为普通字符,看http://wiki.luajit.org/NYI#libraries_string-library :string.find2.1 partialOnly fixed string searches (no patterns)./tmp/jit.log:[TRACE --- imgresize.lua:1 -- NYI: bytecode 51 at imgresize.lua:3][TRACE --- imgresize.lua:3 -- leaving loop in root trace][TRACE --- imgresize.lua:1 -- NYI: bytecode 51 at imgresize.lua:9][TRACE --- imgresize.lua:1 -- NYI: bytecode 51 at imgresize.lua:3][TRACE --- imgresize.lua:1 -- NYI: bytecode 51 at imgresize.lua:9][TRACE --- imgresize.lua:3 -- leaving loop in root trace]./luajit/bin/luajit nginx/lua/ljbc.lua 51opcode 51:FNEW --