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

Fix case when we have an anonymous block

mingodad 9 лет назад
Родитель
Сommit
4894b953d9
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      SquiLu/squirrel/sqcompiler.cpp

+ 2 - 1
SquiLu/squirrel/sqcompiler.cpp

@@ -826,7 +826,8 @@ public:
 			case TK_NEWSLOT:
 			case TK_NEWSLOT:
 				if(ds == OBJECT || ds == BASE) {
 				if(ds == OBJECT || ds == BASE) {
 					EmitDerefOp(_OP_NEWSLOT);
 					EmitDerefOp(_OP_NEWSLOT);
-                    if((_es.epos == -1) && (es.etype == EXPR_STATEMENT)) AddGlobalName(id);
+                    if((_es.epos == -1) && (es.etype == EXPR_STATEMENT)
+                       && (type(id) == OT_STRING) ) AddGlobalName(id);
 				}
 				}
 				else //if _derefstate != DEREF_NO_DEREF && DEREF_FIELD so is the index of a local
 				else //if _derefstate != DEREF_NO_DEREF && DEREF_FIELD so is the index of a local
 					Error(_SC("can't 'create' a local slot"));
 					Error(_SC("can't 'create' a local slot"));