Skip to content

Commit 00406e5

Browse files
committed
make linter happy
1 parent 2daefd7 commit 00406e5

2 files changed

Lines changed: 28 additions & 6 deletions

File tree

‎core/xml.js‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,11 @@ Blockly.Xml.appendDomToWorkspace = function(xml, workspace) {
565565
* workspace.
566566
* @param {!Element} xmlBlock XML block element.
567567
* @param {!Blockly.Workspace} workspace The workspace.
568+
* @param {string} uniqueCommentID (used for logging)
568569
* @return {!Blockly.Block} The root block created.
569570
*/
570-
Blockly.Xml.domToBlock = function(xmlBlock, workspace, uniqueCommentID="unapplicable") {
571+
Blockly.Xml.domToBlock = function(xmlBlock, workspace, uniqueCommentID) {
572+
if (typeof uniqueCommentID === 'undefined') uniqueCommentID = "unapplicable";
571573
if (xmlBlock instanceof Blockly.Workspace) {
572574
var swap = xmlBlock;
573575
xmlBlock = workspace;
@@ -654,10 +656,12 @@ Blockly.Xml.domToVariables = function(xmlVariables, workspace) {
654656
* workspace.
655657
* @param {!Element} xmlBlock XML block element.
656658
* @param {!Blockly.Workspace} workspace The workspace.
659+
* @param {string} uniqueCommentID (used for logging)
657660
* @return {!Blockly.Block} The root block created.
658661
* @private
659662
*/
660-
Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace,uniqueCommentID="unapplicable") {
663+
Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace, uniqueCommentID) {
664+
if (typeof uniqueCommentID === 'undefined') uniqueCommentID = "unapplicable";
661665
var block = null;
662666
var prototypeName = xmlBlock.getAttribute('type');
663667
goog.asserts.assert(
@@ -749,7 +753,15 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace,uniqueCommentID="
749753
if (!input) {
750754
console.warn('Ignoring non-existent input ' + name + ' in block ' +
751755
prototypeName);
752-
window.dispatchEvent(new CustomEvent('blockError', {detail: {uniqueCommentID:uniqueCommentID, block: block, source: "1", error: 'Ignoring non-existent input ' + name + ' in block ' + prototypeName}}));
756+
window.dispatchEvent(new CustomEvent('blockError', {
757+
detail: {
758+
uniqueCommentID: uniqueCommentID,
759+
block: block,
760+
source: "1",
761+
error: 'Ignoring non-existent input ' + name + ' in block ' + prototypeName
762+
}
763+
}
764+
));
753765
break;
754766
}
755767
if (childShadowElement) {
@@ -873,14 +885,24 @@ Blockly.Xml.domToFieldVariable_ = function(workspace, xml, text, field) {
873885
* @param {!Blockly.Block} block The block that is currently being deserialized.
874886
* @param {string} fieldName The name of the field on the block.
875887
* @param {!Element} xml The field tag to decode.
888+
* @param {string} uniqueCommentID (used for logging)
876889
* @private
877890
*/
878-
Blockly.Xml.domToField_ = function(block, fieldName, xml,uniqueCommentID="unapplicable") {
891+
Blockly.Xml.domToField_ = function(block, fieldName, xml, uniqueCommentID) {
892+
if (typeof uniqueCommentID === 'undefined') uniqueCommentID = "unapplicable";
879893
var field = block.getField(fieldName);
880894
if (!field) {
881895
console.warn('Ignoring non-existent field ' + fieldName + ' in block ' +
882896
block.type);
883-
window.dispatchEvent(new CustomEvent('blockError', {detail: {block: block,uniqueCommentID:uniqueCommentID, source: "2", error: 'Ignoring non-existent field ' + fieldName + ' in block ' + block.type}}));
897+
window.dispatchEvent(new CustomEvent('blockError', {
898+
detail: {
899+
block: block,
900+
uniqueCommentID: uniqueCommentID,
901+
source: "2",
902+
error: 'Ignoring non-existent field ' + fieldName + ' in block ' + block.type
903+
}
904+
}
905+
));
884906
return;
885907
}
886908

‎core/zoom_controls.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,4 @@ Blockly.ZoomControls.prototype.createAISvg_ = function() {
350350
e.stopPropagation(); // Don't start a workspace scroll.
351351
e.preventDefault(); // Stop double-clicking from selecting text.
352352
});
353-
}
353+
};

0 commit comments

Comments
 (0)