diff options
-rw-r--r-- | lbuiltin.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.11 1997/11/27 15:59:44 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.12 1997/11/27 18:25:14 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -217,17 +217,10 @@ static void luaI_assert (void) | |||
217 | } | 217 | } |
218 | 218 | ||
219 | 219 | ||
220 | static void check_globalname (char *n) | ||
221 | { | ||
222 | if (n[0] == '.') | ||
223 | luaL_verror("cannot change variable `%.50s' (starts with `.')", n); | ||
224 | } | ||
225 | |||
226 | static void setglobal (void) | 220 | static void setglobal (void) |
227 | { | 221 | { |
228 | char *n = luaL_check_string(1); | 222 | char *n = luaL_check_string(1); |
229 | lua_Object value = luaL_nonnullarg(2); | 223 | lua_Object value = luaL_nonnullarg(2); |
230 | check_globalname(n); | ||
231 | lua_pushobject(value); | 224 | lua_pushobject(value); |
232 | lua_setglobal(n); | 225 | lua_setglobal(n); |
233 | lua_pushobject(value); /* return given value */ | 226 | lua_pushobject(value); /* return given value */ |
@@ -237,7 +230,6 @@ static void rawsetglobal (void) | |||
237 | { | 230 | { |
238 | char *n = luaL_check_string(1); | 231 | char *n = luaL_check_string(1); |
239 | lua_Object value = luaL_nonnullarg(2); | 232 | lua_Object value = luaL_nonnullarg(2); |
240 | check_globalname(n); | ||
241 | lua_pushobject(value); | 233 | lua_pushobject(value); |
242 | lua_rawsetglobal(n); | 234 | lua_rawsetglobal(n); |
243 | lua_pushobject(value); /* return given value */ | 235 | lua_pushobject(value); /* return given value */ |