mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Removed unneeded safties from the libs
I missed removing these before, and I haven't needed these in a long time.
This commit is contained in:
@@ -1502,12 +1502,6 @@ static int nativeSort(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
|
||||
Toy_freeLiteral(fnLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral) || TOY_IS_IDENTIFIER(fnLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
Toy_freeLiteral(fnLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//check type
|
||||
if (!TOY_IS_ARRAY(selfLiteral) || !( TOY_IS_FUNCTION(fnLiteral) || TOY_IS_FUNCTION_NATIVE(fnLiteral) )) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to sort\n");
|
||||
@@ -1570,11 +1564,6 @@ static int nativeToLower(Toy_Interpreter* interpreter, Toy_LiteralArray* argumen
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!TOY_IS_STRING(selfLiteral)) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to toLower\n");
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
@@ -1636,17 +1625,6 @@ static int nativeToString(Toy_Interpreter* interpreter, Toy_LiteralArray* argume
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//BUGFIX: probably an undefined variable
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//print it to a custom function
|
||||
Toy_printLiteralCustom(selfLiteral, toStringUtil);
|
||||
|
||||
@@ -1680,11 +1658,6 @@ static int nativeToUpper(Toy_Interpreter* interpreter, Toy_LiteralArray* argumen
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!TOY_IS_STRING(selfLiteral)) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to toUpper\n");
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
@@ -1745,12 +1718,6 @@ static int nativeTrim(Toy_Interpreter* interpreter, Toy_LiteralArray* arguments)
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral) || TOY_IS_IDENTIFIER(trimCharsLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!TOY_IS_STRING(selfLiteral) || !TOY_IS_STRING(trimCharsLiteral)) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to trim\n");
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
@@ -1862,12 +1829,6 @@ static int nativeTrimBegin(Toy_Interpreter* interpreter, Toy_LiteralArray* argum
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral) || TOY_IS_IDENTIFIER(trimCharsLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!TOY_IS_STRING(selfLiteral) || !TOY_IS_STRING(trimCharsLiteral)) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to trimBegin\n");
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
@@ -1956,12 +1917,6 @@ static int nativeTrimEnd(Toy_Interpreter* interpreter, Toy_LiteralArray* argumen
|
||||
Toy_freeLiteral(selfLiteralIdn);
|
||||
}
|
||||
|
||||
if (TOY_IS_IDENTIFIER(selfLiteral) || TOY_IS_IDENTIFIER(trimCharsLiteral)) {
|
||||
Toy_freeLiteral(selfLiteral);
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!TOY_IS_STRING(selfLiteral) || !TOY_IS_STRING(trimCharsLiteral)) {
|
||||
interpreter->errorOutput("Incorrect argument type passed to trimEnd\n");
|
||||
Toy_freeLiteral(trimCharsLiteral);
|
||||
|
||||
Reference in New Issue
Block a user