Skip to content

Commit

Permalink
[BUGFIX release] revert deprecation of htmlSafe and isHTMLSafe
Browse files Browse the repository at this point in the history
  • Loading branch information
locks committed Feb 11, 2021
1 parent c180944 commit b3d8861
Showing 1 changed file with 7 additions and 36 deletions.
43 changes: 7 additions & 36 deletions packages/ember/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,14 @@ Ember.String = {
classify,
underscore,
capitalize,
htmlSafe,
isHTMLSafe,
};
if (ENV.EXTEND_PROTOTYPES.String) {
String.prototype.htmlSafe = function () {
return htmlSafe(this);
};
}
Ember.Object = EmberObject;
Ember._RegistryProxyMixin = RegistryProxyMixin;
Ember._ContainerProxyMixin = ContainerProxyMixin;
Expand Down Expand Up @@ -652,42 +659,6 @@ if (EMBER_GLIMMER_INVOKE_HELPER) {
}
Ember._captureRenderTree = captureRenderTree;

if (ENV.EXTEND_PROTOTYPES.String) {
String.prototype.htmlSafe = function () {
return htmlSafe(this);
};
}
const deprecateImportFromString = function (
name,
message = `Importing ${name} from '@ember/string' is deprecated. Please import ${name} from '@ember/template' instead.`
) {
deprecate(message, false, {
id: 'ember-string.htmlsafe-ishtmlsafe',
for: 'ember-source',
since: {
enabled: '3.25',
},
until: '4.0.0',
url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-string-htmlsafe-ishtmlsafe',
});
};
Object.defineProperty(Ember.String, 'htmlSafe', {
enumerable: true,
configurable: true,
get() {
deprecateImportFromString('htmlSafe');
return htmlSafe;
},
});
Object.defineProperty(Ember.String, 'isHTMLSafe', {
enumerable: true,
configurable: true,
get() {
deprecateImportFromString('isHTMLSafe');
return isHTMLSafe;
},
});

/**
Global hash of shared templates. This will automatically be populated
by the build tools so that you can store your Handlebars templates in
Expand Down

0 comments on commit b3d8861

Please sign in to comment.