Push more core class creation into the core library itself.

This commit is contained in:
Bob Nystrom
2015-04-03 08:00:55 -07:00
parent 278f1c063b
commit 563a090865
4 changed files with 26 additions and 27 deletions
+3 -3
View File
@@ -1134,8 +1134,8 @@ static bool runInterpreter(WrenVM* vm)
int numFields = READ_BYTE();
ObjClass* classObj = wrenNewClass(vm, superclass, numFields,
AS_STRING(name));
Value classObj = OBJ_VAL(wrenNewClass(vm, superclass, numFields,
AS_STRING(name)));
// Don't pop the superclass and name off the stack until the subclass is
// done being created, to make sure it doesn't get collected.
@@ -1151,7 +1151,7 @@ static bool runInterpreter(WrenVM* vm)
"ones.", name));
}
PUSH(OBJ_VAL(classObj));
PUSH(classObj);
DISPATCH();
}