Просмотр исходного кода

Added conditional preprocessor NO_EXCEPTION_KEY_NOT_FOUND to sqvm.cpp to enable/disable throwing exceptions when a key is not found on tables.

mingodad 13 лет назад
Родитель
Сommit
2d343adbb6
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      squirrel/sqvm.cpp

+ 5 - 0
squirrel/sqvm.cpp

@@ -801,7 +801,12 @@ exception_restore:
 				}
 				continue;
 			case _OP_GETK:
+#ifndef NO_EXCEPTION_KEY_NOT_FOUND
 				if (!Get(STK(arg2), ci->_literals[arg1], temp_reg, false,arg2)) { SQ_THROW();}
+#else
+				//DAD instead of throw an exception return null
+				if(!Get(STK(arg2), ci->_literals[arg1], temp_reg, false,arg2)) temp_reg.Null();
+#endif
 				_Swap(TARGET,temp_reg);//TARGET = temp_reg;
 				continue;
 			case _OP_MOVE: TARGET = STK(arg1); continue;