Skip to content

Commit

Permalink
deprecate(xml): Deprecate getXmlDocument and setXmlDocument
Browse files Browse the repository at this point in the history
Mark getXmlDocument and setXmlDocument as @deprecated, with
suitable calls to deprecation.warn().

There are no remaining callers to either function within core -
setXmlDocument was only used by the node.js wrapper, and and
apparently getXmlDocument was never used AFAICT - and we do not
anticipate that either were used by external developers.
  • Loading branch information
cpcallen committed Jan 12, 2023
1 parent 35735a2 commit 678643a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/utils/xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import * as goog from '../../closure/goog/goog.js';
goog.declareModuleId('Blockly.utils.xml');

import * as deprecation from './deprecation.js';


/**
* Injected dependencies. By default these are just (and have the
Expand Down Expand Up @@ -57,19 +59,23 @@ export const NAME_SPACE = 'https://developers.google.com/blockly/xml';
* Get the document object to use for XML serialization.
*
* @returns The document object.
* @deprecated No longer provided by Blockly.
* @alias Blockly.utils.xml.getDocument
*/
export function getDocument(): Document {
deprecation.warn('Blockly.utils.xml.getDocument', 'version 9', 'version 10');
return document;
}

/**
* Get the document object to use for XML serialization.
*
* @param xmlDocument The document object to use.
* @deprecated No longer provided by Blockly.
* @alias Blockly.utils.xml.setDocument
*/
export function setDocument(xmlDocument: Document) {
deprecation.warn('Blockly.utils.xml.setDocument', 'version 9', 'version 10');
document = xmlDocument;
}

Expand Down

0 comments on commit 678643a

Please sign in to comment.