I just spent time debugging an odd problem that was randomly occurring and tracked it down to uses of calling the
superClass_ function and wanted to understand why in most cases the call to the
superClass_ function used a
.call(this, mechanism...
Specifically in field_variable.js and field_angle.js we have a
Blockly.FieldVariable.superClass_.setChangeHandler(wrappedHandler);
However, when I debugged into the lower level routine, it doesn't seem to have the right this value. By changing it to:
Blockly.FieldVariable.superClass_.setChangeHandler.call(this,wrappedHandler);
We have been able to make things work more reliably.
I have scanned through all of the code and the
setChangeHandler ones seemed to be the only occurrences of using a superClass_ function without
.call(this,.
Am I not understanding something about
setChangeHandler or is this just a simple bug?