Fixed a stupid bug in MSVC

This commit is contained in:
2023-02-14 10:23:58 +00:00
parent 57af5a6d59
commit 453afbab41
6 changed files with 10 additions and 11 deletions

View File

@@ -37,8 +37,7 @@ bool Toy_injectNativeFn(Toy_Interpreter* interpreter, const char* name, Toy_Nati
return false;
}
int identifierLength = strlen(name);
Toy_Literal identifier = TOY_TO_IDENTIFIER_LITERAL(Toy_createRefStringLength(name, identifierLength));
Toy_Literal identifier = TOY_TO_IDENTIFIER_LITERAL(Toy_createRefString(name));
//make sure the name isn't taken
if (Toy_existsLiteralDictionary(&interpreter->scope->variables, identifier)) {