Fixed bug with -1 type check

This commit is contained in:
Kristofer
2018-04-19 08:49:10 +02:00
parent c248a6e498
commit 098e6780aa
4 changed files with 11 additions and 3 deletions

View File

@@ -336,7 +336,10 @@ var LiteGraph = global.LiteGraph = {
!type_b || //generic input
type_a == type_b || //same type (is valid for triggers)
type_a == LiteGraph.EVENT && type_b == LiteGraph.ACTION )
return true;
return true;
type_a = String(type_a) //* Enforce string type to handle toLowerCase call (-1 number not ok)
type_b = String(type_b)
type_a = type_a.toLowerCase();
type_b = type_b.toLowerCase();

View File

@@ -346,6 +346,8 @@ $jscomp.polyfill("Array.prototype.values", function(u) {
if (!a || !b || a == b || a == e.EVENT && b == e.ACTION) {
return !0;
}
a = String(a);
b = String(b);
a = a.toLowerCase();
b = b.toLowerCase();
if (-1 == a.indexOf(",") && -1 == b.indexOf(",")) {

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "litegraph.js",
"version": "0.4.0",
"version": "0.5.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -336,7 +336,10 @@ var LiteGraph = global.LiteGraph = {
!type_b || //generic input
type_a == type_b || //same type (is valid for triggers)
type_a == LiteGraph.EVENT && type_b == LiteGraph.ACTION )
return true;
return true;
type_a = String(type_a) //* Enforce string type to handle toLowerCase call (-1 number not ok)
type_b = String(type_b)
type_a = type_a.toLowerCase();
type_b = type_b.toLowerCase();