Skip to content

Commit 86003b6

Browse files
committed
very subtle bugfix by binding this!
1 parent 4ee29ae commit 86003b6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎v5-unity/js/pytutor.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4791,7 +4791,9 @@ ExecutionVisualizer.prototype.activateJavaFrontend = function() {
47914791
});
47924792

47934793
// java synthetics cause things which javascript doesn't like in an id
4794-
var old_generateID = ExecutionVisualizer.prototype.generateID;
4794+
4795+
// VERY important to bind(this) so that when it's called, 'this' is this current object
4796+
var old_generateID = ExecutionVisualizer.prototype.generateID.bind(this);
47954797
this.generateID = function(original_id) {
47964798
var sanitized = original_id.replace(
47974799
/[^0-9a-zA-Z_]/g,

0 commit comments

Comments
 (0)