Fix component methods in typeblocking
Fixes
@@ -549,11 +549,10 @@ Blockly.Blocks.component_method = {
typeblock : function(){
var componentDb = Blockly.mainWorkspace.getComponentDatabase();
var tb = [];
- var typeName;
var typeNameDict = {};
componentDb.forEachInstance(function(instance) {
typeNameDict[instance.typeName] = true;
- componentDb.forMethodInType(typeName, function(_, methodName) {
+ componentDb.forMethodInType(instance.typeName, function(_, methodName) {
tb.push({
translatedName: Blockly.Msg.LANG_COMPONENT_BLOCK_METHOD_TITLE_CALL + instance.name +
'.' + componentDb.getInternationalizedMethodName(methodName),
@@ -573,7 +572,7 @@ Blockly.Blocks.component_method = {
componentDb.getInternationalizedComponentType(componentType) + '.' +
componentDb.getInternationalizedMethodName(methodName),
mutatorAttributes: {
- component_type: typeName,
+ component_type: componentType,
method_name: methodName,
is_generic: 'true'
}
