diff options
| -rw-r--r-- | lua.c | 8 | ||||
| -rw-r--r-- | manual/manual.of | 24 |
2 files changed, 21 insertions, 11 deletions
| @@ -714,7 +714,13 @@ static void doREPL (lua_State *L) { | |||
| 714 | /* }================================================================== */ | 714 | /* }================================================================== */ |
| 715 | 715 | ||
| 716 | #if !defined(luai_openlibs) | 716 | #if !defined(luai_openlibs) |
| 717 | #define luai_openlibs(L) luaL_openselectedlibs(L, ~0, 0) | 717 | #if defined(LUA_NODEBUGLIB) |
| 718 | /* With this option, code must require the debug library before using it */ | ||
| 719 | #define luai_openlibs(L) luaL_openselectedlibs(L, ~LUA_DBLIBK, LUA_DBLIBK) | ||
| 720 | #else | ||
| 721 | /* The default is to open all standard libraries */ | ||
| 722 | #define luai_openlibs(L) luaL_openselectedlibs(L, ~0, 0) | ||
| 723 | #endif | ||
| 718 | #endif | 724 | #endif |
| 719 | 725 | ||
| 720 | 726 | ||
diff --git a/manual/manual.of b/manual/manual.of index 5eb2fb1f..5e113336 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -3962,8 +3962,8 @@ this confuses the next call to @Lid{lua_next}. | |||
| 3962 | 3962 | ||
| 3963 | This function may raise an error if the given key | 3963 | This function may raise an error if the given key |
| 3964 | is neither @nil nor present in the table. | 3964 | is neither @nil nor present in the table. |
| 3965 | See function @Lid{next} for the caveats of modifying | 3965 | |
| 3966 | the table during its traversal. | 3966 | See function @Lid{next} for more details about the traversal. |
| 3967 | 3967 | ||
| 3968 | } | 3968 | } |
| 3969 | 3969 | ||
| @@ -4448,7 +4448,7 @@ Starts and resumes a coroutine in the given thread @id{L}. | |||
| 4448 | To start a coroutine, | 4448 | To start a coroutine, |
| 4449 | you push the main function plus any arguments | 4449 | you push the main function plus any arguments |
| 4450 | onto the empty stack of the thread. | 4450 | onto the empty stack of the thread. |
| 4451 | then you call @Lid{lua_resume}, | 4451 | Then you call @Lid{lua_resume}, |
| 4452 | with @id{nargs} being the number of arguments. | 4452 | with @id{nargs} being the number of arguments. |
| 4453 | The function returns when the coroutine suspends, | 4453 | The function returns when the coroutine suspends, |
| 4454 | finishes its execution, or raises an unprotected error. | 4454 | finishes its execution, or raises an unprotected error. |
| @@ -4628,7 +4628,7 @@ You can resume threads with status @Lid{LUA_OK} | |||
| 4628 | } | 4628 | } |
| 4629 | 4629 | ||
| 4630 | @APIEntry{size_t lua_stringtonumber (lua_State *L, const char *s);| | 4630 | @APIEntry{size_t lua_stringtonumber (lua_State *L, const char *s);| |
| 4631 | @apii{0,1,-} | 4631 | @apii{0,0|1,-} |
| 4632 | 4632 | ||
| 4633 | Converts the zero-terminated string @id{s} to a number, | 4633 | Converts the zero-terminated string @id{s} to a number, |
| 4634 | pushes that number into the stack, | 4634 | pushes that number into the stack, |
| @@ -4958,7 +4958,7 @@ Lua calls the given @x{continuation function} @id{k} to continue | |||
| 4958 | the execution of the @N{C function} that yielded @see{continuations}. | 4958 | the execution of the @N{C function} that yielded @see{continuations}. |
| 4959 | This continuation function receives the same stack | 4959 | This continuation function receives the same stack |
| 4960 | from the previous function, | 4960 | from the previous function, |
| 4961 | with the @id{n} results removed and | 4961 | with all the results (@id{nresults}) removed and |
| 4962 | replaced by the arguments passed to @Lid{lua_resume}. | 4962 | replaced by the arguments passed to @Lid{lua_resume}. |
| 4963 | Moreover, | 4963 | Moreover, |
| 4964 | the continuation function receives the value @id{ctx} | 4964 | the continuation function receives the value @id{ctx} |
| @@ -5048,7 +5048,7 @@ the function was defined in a string where | |||
| 5048 | } | 5048 | } |
| 5049 | 5049 | ||
| 5050 | @item{@id{srclen}| | 5050 | @item{@id{srclen}| |
| 5051 | The length of the string @id{source}. | 5051 | the length of the string @id{source}. |
| 5052 | } | 5052 | } |
| 5053 | 5053 | ||
| 5054 | @item{@id{short_src}| | 5054 | @item{@id{short_src}| |
| @@ -5212,7 +5212,7 @@ running at the given level; | |||
| 5212 | } | 5212 | } |
| 5213 | 5213 | ||
| 5214 | @item{@Char{S}| | 5214 | @item{@Char{S}| |
| 5215 | fills in the fields @id{source}, @id{short_src}, | 5215 | fills in the fields @id{source}, @id{srclen}, @id{short_src}, |
| 5216 | @id{linedefined}, @id{lastlinedefined}, and @id{what}; | 5216 | @id{linedefined}, @id{lastlinedefined}, and @id{what}; |
| 5217 | } | 5217 | } |
| 5218 | 5218 | ||
| @@ -5388,7 +5388,9 @@ Returns @id{NULL} (and pops nothing) | |||
| 5388 | when the index is greater than | 5388 | when the index is greater than |
| 5389 | the number of active local variables. | 5389 | the number of active local variables. |
| 5390 | 5390 | ||
| 5391 | Parameters @id{ar} and @id{n} are as in the function @Lid{lua_getlocal}. | 5391 | Parameters @id{ar} and @id{n} are as in the function @Lid{lua_getlocal}, |
| 5392 | except that @id{ar} cannot be @id{NULL}, | ||
| 5393 | as @id{lua_setlocal} only operates on activation records. | ||
| 5392 | 5394 | ||
| 5393 | } | 5395 | } |
| 5394 | 5396 | ||
| @@ -6832,8 +6834,7 @@ for k,v in pairs(t) do @rep{body} end | |||
| 6832 | } | 6834 | } |
| 6833 | will iterate over all key@En{}value pairs of table @id{t}. | 6835 | will iterate over all key@En{}value pairs of table @id{t}. |
| 6834 | 6836 | ||
| 6835 | See function @Lid{next} for the caveats of modifying | 6837 | See function @Lid{next} for more details about the traversal. |
| 6836 | the table during its traversal. | ||
| 6837 | 6838 | ||
| 6838 | } | 6839 | } |
| 6839 | 6840 | ||
| @@ -9123,6 +9124,7 @@ which automatically removes the file when the program ends. | |||
| 9123 | 9124 | ||
| 9124 | This library provides | 9125 | This library provides |
| 9125 | the functionality of the @link{debugI|debug interface} to Lua programs. | 9126 | the functionality of the @link{debugI|debug interface} to Lua programs. |
| 9127 | |||
| 9126 | You should exert care when using this library. | 9128 | You should exert care when using this library. |
| 9127 | Several of its functions | 9129 | Several of its functions |
| 9128 | violate basic assumptions about Lua code | 9130 | violate basic assumptions about Lua code |
| @@ -9132,6 +9134,8 @@ that userdata metatables cannot be changed by Lua code; | |||
| 9132 | that Lua programs do not crash) | 9134 | that Lua programs do not crash) |
| 9133 | and therefore can compromise otherwise secure code. | 9135 | and therefore can compromise otherwise secure code. |
| 9134 | Moreover, some functions in this library may be slow. | 9136 | Moreover, some functions in this library may be slow. |
| 9137 | It is good practice to always require this library explicitly | ||
| 9138 | before using it. | ||
| 9135 | 9139 | ||
| 9136 | All functions in this library are provided | 9140 | All functions in this library are provided |
| 9137 | inside the @defid{debug} table. | 9141 | inside the @defid{debug} table. |
