mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 15:16:34 +02:00
Allow script jobs to return object members directly if they are not functions
This commit is contained in:
@@ -778,7 +778,9 @@ Tomahawk.PluginManager = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.objects[objectId][methodName] !== 'function') {
|
if (typeof this.objects[objectId][methodName] !== 'function' && this.objects[objectId][methodName]) {
|
||||||
|
return this.objects[objectId][methodName];
|
||||||
|
} else if (typeof this.objects[objectId][methodName] !== 'function') {
|
||||||
throw new Error('\'' + methodName + '\' on ScriptObject ' + objectId + ' is not a function', typeof this.objects[objectId][methodName]);
|
throw new Error('\'' + methodName + '\' on ScriptObject ' + objectId + ' is not a function', typeof this.objects[objectId][methodName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user