Removed and disabled use of Ember.js function prototype extensions

no issue

- Function prototype extensions are being deprecated in Ember 3.11
This commit is contained in:
Kevin Ansfield 2019-07-01 15:53:58 +01:00
parent 7210266ffe
commit 6ac1480ffc
4 changed files with 7 additions and 9 deletions

View File

@ -4,10 +4,6 @@ import {run} from '@ember/runloop';
export default Component.extend({
tagName: '',
init() {
this._super(...arguments);
},
actions: {
initScrollWatch(element) {
this._onScroll = run.bind(this, this.onScroll, element);

View File

@ -2,6 +2,7 @@ import Mixin from '@ember/object/mixin';
import {A as emberA} from '@ember/array';
import {isEmpty} from '@ember/utils';
import {observer} from '@ember/object';
import {on} from '@ember/object/evented';
import {run} from '@ember/runloop';
export default Mixin.create({
@ -38,9 +39,9 @@ export default Mixin.create({
},
// eslint-disable-next-line ghost/ember/no-observers
hasErrorObserver: observer('errors.[]', 'property', 'hasValidated.[]', function () {
hasErrorObserver: on('init', observer('errors.[]', 'property', 'hasValidated.[]', function () {
run.once(this, 'setHasError');
// this.setHasError();
}).on('init')
}))
});

View File

@ -9,6 +9,7 @@ import {compare} from '@ember/utils';
import {computed, observer} from '@ember/object';
import {equal, filterBy} from '@ember/object/computed';
import {isBlank} from '@ember/utils';
import {on} from '@ember/object/evented';
import {inject as service} from '@ember/service';
// ember-cli-shims doesn't export these so we must get them manually
@ -228,10 +229,10 @@ export default Model.extend(Comparable, ValidationEngine, {
// TODO: is there a better way to handle this?
// eslint-disable-next-line ghost/ember/no-observers
_setPublishedAtBlogTZ: observer('publishedAtUTC', 'settings.activeTimezone', function () {
_setPublishedAtBlogTZ: on('init', observer('publishedAtUTC', 'settings.activeTimezone', function () {
let publishedAtUTC = this.publishedAtUTC;
this._setPublishedAtBlogStrings(publishedAtUTC);
}).on('init'),
})),
_setPublishedAtBlogStrings(momentDate) {
if (momentDate) {

View File

@ -17,7 +17,7 @@ module.exports = function (environment) {
Date: false,
Array: true,
String: true,
Function: true
Function: false
}
},