Skip to content

Commit

Permalink
Fix highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
AshimeeAlt committed Sep 20, 2024
1 parent 4c22bd6 commit 99de685
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Blockly.Highlight.highlight = function highlight(value, type) {
if (type === 'object' && typeof value === 'string') {
try {
value = JSON.parse(value);
} catch {
} catch(err) {
// @todo Maybe dont do this?
value = 'undefined';
}
Expand Down
6 changes: 5 additions & 1 deletion core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ goog.require('Blockly.WorkspaceDragSurfaceSvg');
goog.require('Blockly.Xml');
goog.require('Blockly.ZoomControls');
goog.require('Blockly.IntersectionObserver');
goog.require('Blockly.Highlight');

goog.require('goog.array');
goog.require('goog.dom');
Expand Down Expand Up @@ -124,6 +125,9 @@ Blockly.WorkspaceSvg = function(options, opt_blockDragSurface, opt_wsDragSurface
};
goog.inherits(Blockly.WorkspaceSvg, Blockly.Workspace);

// To keep closure from deleting the file
Blockly.WorkspaceSvg.Highlight = Blockly.Highlight;

/**
* A wrapper function called when a resize event occurs.
* You can pass the result to `unbindEvent_`.
Expand Down Expand Up @@ -1113,7 +1117,7 @@ Blockly.WorkspaceSvg.prototype.reportValue = function(id, value) {
*/
Blockly.WorkspaceSvg.prototype.reportValueWithCallback = function(id, value, callback) {
const potentialValue = this.reportValue(id, value);
if (callback) callback(this.DropDownDiv.DIV_);
if (callback) callback(Blockly.DropDownDiv.DIV_);
return potentialValue;
};

Expand Down

0 comments on commit 99de685

Please sign in to comment.