Skip to content

Commit 502e40a

Browse files
committedJun 12, 2015
dofile error reporting for syntax errors
According to doc, dofile() raises an error when parsing failed due to syntax errors. Fixes #2775
1 parent 0b187ed commit 502e40a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎src/script/cpp_api/s_security.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ int ScriptApiSecurity::sl_g_dofile(lua_State *L)
407407
{
408408
int nret = sl_g_loadfile(L);
409409
if (nret != 1) {
410-
return nret;
410+
lua_error(L);
411+
// code after this function isn't executed
411412
}
412413
int top_precall = lua_gettop(L);
413414
lua_call(L, 0, LUA_MULTRET);

0 commit comments

Comments
 (0)
Please sign in to comment.