Sha256: ddb4d95a37571e1e71810ac9fb3c85839cbd4e40e7cc6d46905425574c7c8e57
Contents?: true
Size: 1.05 KB
Versions: 3
Compression:
Stored size: 1.05 KB
Contents
/** @module ember */ import { deprecate } from '@ember/debug'; import { get } from './property_get'; import { set } from './property_set'; /** Used internally to allow changing properties in a backwards compatible way, and print a helpful deprecation warning. @method deprecateProperty @param {Object} object The object to add the deprecated property to. @param {String} deprecatedKey The property to add (and print deprecation warnings upon accessing). @param {String} newKey The property that will be aliased. @private @since 1.7.0 */ export function deprecateProperty(object, deprecatedKey, newKey, options) { function _deprecate() { deprecate(`Usage of \`${deprecatedKey}\` is deprecated, use \`${newKey}\` instead.`, false, options); } Object.defineProperty(object, deprecatedKey, { configurable: true, enumerable: false, set(value) { _deprecate(); set(this, newKey, value); }, get() { _deprecate(); return get(this, newKey); }, }); }
Version data entries
3 entries across 3 versions & 1 rubygems