Changeset 403 for trunk/src/lua/lua_state.cc
- Timestamp:
- 06/14/15 14:31:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r399 r403 15 15 16 16 // stack_guard 17 18 #define NV_LUA_ABORT( func, ... ) \ 19 NV_LOG_CRITICAL( "lua::" func " : ", __VA_ARGS__ ) \ 20 NV_ABORT( "lua::" func " : critical error!" ) 21 17 22 18 23 lua::stack_guard::stack_guard( lua::state* aL ) … … 424 429 if ( lua_isnil( m_state, -1 ) ) 425 430 { 426 NV_ THROW( runtime_error, lua_name.to_string() +" type not registered!" );431 NV_LUA_ABORT( "state::register_object", lua_name, " type not registered!" ); 427 432 } 428 433 deep_pointer_copy( -1, o ); … … 436 441 if ( lua_isnil( m_state, -1 ) ) 437 442 { 438 NV_ THROW( runtime_error, storage.to_string() +" storage not registered!" );443 NV_LUA_ABORT( "state::register_proto", "\"", storage, "\" storage not registered!" ); 439 444 } 440 445 lua_getfield( m_state, -1, id.data() ); 441 446 if ( lua_isnil( m_state, -1 ) ) 442 447 { 443 NV_ THROW( runtime_error, id.to_string() + " not found in " + storage.to_string() + " storage!" );448 NV_LUA_ABORT( "state::register_proto", "\"", id, "\" not found in \"", storage, "\"!" ); 444 449 } 445 450 return lua::ref( luaL_ref( m_state, LUA_REGISTRYINDEX ) ); … … 452 457 if ( lua_isnil( m_state, -1 ) ) 453 458 { 454 NV_ THROW( runtime_error, lua_name.to_string() +" type not registered!" );459 NV_LUA_ABORT( "state::register_native_object_method", "\"", lua_name, "\" type not registered!" ); 455 460 } 456 461 lua_pushcfunction( m_state, f ); … … 502 507 if ( has_functions || has_metatable ) 503 508 { 504 lua_push string( m_state, "__ptr" );509 lua_pushliteral( m_state, "__ptr" ); 505 510 lua_pushlightuserdata( m_state, obj ); 506 511 lua_rawset( m_state, -3 ); … … 569 574 if ( lua_isnil( m_state, -1 ) ) 570 575 { 571 NV_ THROW( runtime_error, name.to_string() +" type not registered!" );576 NV_LUA_ABORT( "state::register_singleton", "\"", name, "\" type not registered!" ); 572 577 } 573 578 deep_pointer_copy( -1, o );
Note: See TracChangeset
for help on using the changeset viewer.