Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate core/utils/deprecation.js to goog.module syntax #5048

Merged
merged 3 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions core/utils/deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @name Blockly.utils.deprecation
* @namespace
*/
goog.provide('Blockly.utils.deprecation');
goog.module('Blockly.utils.deprecation');
goog.module.declareLegacyNamespace();


/**
Expand All @@ -29,12 +30,13 @@ goog.provide('Blockly.utils.deprecation');
* if any.
* @package
*/
Blockly.utils.deprecation.warn = function(
name, deprecationDate, deletionDate, opt_use) {
var msg = name + ' was deprecated on ' + deprecationDate +
' and will be deleted on ' + deletionDate + '.';
const warn = function(name, deprecationDate, deletionDate, opt_use) {
let msg = name + ' was deprecated on ' + deprecationDate +
' and will be deleted on ' + deletionDate + '.';
if (opt_use) {
msg += '\nUse ' + opt_use + ' instead.';
}
console.warn(msg);
};

exports = {warn};
2 changes: 1 addition & 1 deletion tests/deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.