@@ -48,7 +48,7 @@ export type FunctionArg = {
48
48
49
49
type CallPythonFunctionBlock = Blockly . Block & CallPythonFunctionMixin ;
50
50
interface CallPythonFunctionMixin extends CallPythonFunctionMixinType {
51
- mrcFunctionKind : string , // module, static, constructor, or instance
51
+ mrcFunctionKind : string , // module, static, constructor, instance, or instance_within.
52
52
mrcReturnType : string ,
53
53
mrcArgs : FunctionArg [ ] ,
54
54
mrcTooltip : string ,
@@ -61,7 +61,7 @@ type CallPythonFunctionMixinType = typeof CALL_PYTHON_FUNCTION;
61
61
/** Extra state for serialising call_python_* blocks. */
62
62
type CallPythonFunctionExtraState = {
63
63
/**
64
- * The kind of function: module, static, constructor, or instance .
64
+ * The kind of function: module, static, constructor, instance, or instance_within .
65
65
*/
66
66
functionKind : string ,
67
67
/**
@@ -134,7 +134,7 @@ const CALL_PYTHON_FUNCTION = {
134
134
break ;
135
135
}
136
136
default :
137
- throw new Error ( 'mrcVarKind must be "module", "static", "constructor", or "instance ".' )
137
+ throw new Error ( 'mrcVarKind must be "module", "static", "constructor", "instance", or "instance_within ".' )
138
138
}
139
139
const funcTooltip = this . mrcTooltip ;
140
140
if ( funcTooltip ) {
@@ -250,7 +250,7 @@ const CALL_PYTHON_FUNCTION = {
250
250
. appendField ( createFieldNonEditableText ( '' ) , pythonUtils . FIELD_FUNCTION_NAME ) ;
251
251
break ;
252
252
default :
253
- throw new Error ( 'mrcVarKind must be "module", "static", "constructor", or "instance ".' )
253
+ throw new Error ( 'mrcVarKind must be "module", "static", "constructor", "instance", or "instance_within ".' )
254
254
}
255
255
// Add input sockets for the arguments.
256
256
for ( let i = 0 ; i < this . mrcArgs . length ; i ++ ) {
@@ -320,6 +320,8 @@ export const pythonFromBlock = function(
320
320
code = 'self.' + functionName ;
321
321
break ;
322
322
}
323
+ default :
324
+ throw new Error ( 'mrcVarKind must be "module", "static", "constructor", "instance", or "instance_within".' )
323
325
}
324
326
code += '(' + generateCodeForArguments ( callPythonFunctionBlock , generator , argStartIndex ) + ')' ;
325
327
if ( block . outputConnection ) {
0 commit comments