mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed C-API function name, resolved #87, thanks @hiperiondev
This commit is contained in:
@@ -27,7 +27,7 @@ int Toy_hookAbout(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lite
|
||||
//store as an aliased dictionary
|
||||
if (!TOY_IS_NULL(alias)) {
|
||||
//make sure the name isn't taken
|
||||
if (Toy_isDelcaredScopeVariable(interpreter->scope, alias)) {
|
||||
if (Toy_isDeclaredScopeVariable(interpreter->scope, alias)) {
|
||||
interpreter->errorOutput("Can't override an existing variable\n");
|
||||
Toy_freeLiteral(alias);
|
||||
|
||||
@@ -83,11 +83,11 @@ int Toy_hookAbout(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lite
|
||||
//store globally
|
||||
else {
|
||||
//make sure the names aren't taken
|
||||
if (Toy_isDelcaredScopeVariable(interpreter->scope, majorKeyLiteral) ||
|
||||
Toy_isDelcaredScopeVariable(interpreter->scope, minorKeyLiteral) ||
|
||||
Toy_isDelcaredScopeVariable(interpreter->scope, patchKeyLiteral) ||
|
||||
Toy_isDelcaredScopeVariable(interpreter->scope, buildKeyLiteral) ||
|
||||
Toy_isDelcaredScopeVariable(interpreter->scope, authorKeyLiteral)) {
|
||||
if (Toy_isDeclaredScopeVariable(interpreter->scope, majorKeyLiteral) ||
|
||||
Toy_isDeclaredScopeVariable(interpreter->scope, minorKeyLiteral) ||
|
||||
Toy_isDeclaredScopeVariable(interpreter->scope, patchKeyLiteral) ||
|
||||
Toy_isDeclaredScopeVariable(interpreter->scope, buildKeyLiteral) ||
|
||||
Toy_isDeclaredScopeVariable(interpreter->scope, authorKeyLiteral)) {
|
||||
interpreter->errorOutput("Can't override an existing variable\n");
|
||||
Toy_freeLiteral(alias);
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ int Toy_hookRandom(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lit
|
||||
//store the library in an aliased dictionary
|
||||
if (!TOY_IS_NULL(alias)) {
|
||||
//make sure the name isn't taken
|
||||
if (Toy_isDelcaredScopeVariable(interpreter->scope, alias)) {
|
||||
if (Toy_isDeclaredScopeVariable(interpreter->scope, alias)) {
|
||||
interpreter->errorOutput("Can't override an existing variable\n");
|
||||
Toy_freeLiteral(alias);
|
||||
return -1;
|
||||
|
||||
@@ -462,7 +462,7 @@ int Toy_hookRunner(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lit
|
||||
//store the library in an aliased dictionary
|
||||
if (!TOY_IS_NULL(alias)) {
|
||||
//make sure the name isn't taken
|
||||
if (Toy_isDelcaredScopeVariable(interpreter->scope, alias)) {
|
||||
if (Toy_isDeclaredScopeVariable(interpreter->scope, alias)) {
|
||||
interpreter->errorOutput("Can't override an existing variable\n");
|
||||
Toy_freeLiteral(alias);
|
||||
return -1;
|
||||
|
||||
@@ -2024,7 +2024,7 @@ int Toy_hookStandard(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_L
|
||||
//store the library in an aliased dictionary
|
||||
if (!TOY_IS_NULL(alias)) {
|
||||
//make sure the name isn't taken
|
||||
if (Toy_isDelcaredScopeVariable(interpreter->scope, alias)) {
|
||||
if (Toy_isDeclaredScopeVariable(interpreter->scope, alias)) {
|
||||
interpreter->errorOutput("Can't override an existing variable\n");
|
||||
Toy_freeLiteral(alias);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user