From 26e66a3d3a86902df2ee62654ae2b04bf942e2c8 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Wed, 19 Dec 2018 17:31:07 +0100 Subject: [PATCH] mixins/array: Remove deprecated `copy()` method --- .../-internals/runtime/lib/mixins/array.js | 14 -------------- .../native_array/copyable_suite_test.js | 19 ------------------- 2 files changed, 33 deletions(-) delete mode 100644 packages/@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js diff --git a/packages/@ember/-internals/runtime/lib/mixins/array.js b/packages/@ember/-internals/runtime/lib/mixins/array.js index 8aebbbff79e..ceb17776819 100644 --- a/packages/@ember/-internals/runtime/lib/mixins/array.js +++ b/packages/@ember/-internals/runtime/lib/mixins/array.js @@ -26,7 +26,6 @@ import Enumerable from './enumerable'; import compare from '../compare'; import { ENV } from '@ember/-internals/environment'; import Observable from '../mixins/observable'; -import copy from '../copy'; import MutableEnumerable from './mutable_enumerable'; import { typeOf } from '../type-of'; @@ -1583,19 +1582,6 @@ let NativeArray = Mixin.create(MutableArray, Observable, { return this; }, - - copy(deep) { - deprecate(`Using \`NativeArray#copy\` is deprecated`, false, { - id: 'ember-runtime.using-array-copy', - until: '3.5.0', - }); - - if (deep) { - return this.map(item => copy(item, true)); - } - - return this.slice(); - }, }); // Remove any methods implemented natively so we don't override them diff --git a/packages/@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js b/packages/@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js deleted file mode 100644 index bb0c1daecd7..00000000000 --- a/packages/@ember/-internals/runtime/tests/system/native_array/copyable_suite_test.js +++ /dev/null @@ -1,19 +0,0 @@ -import { A as emberA } from '../../../lib/mixins/array'; -import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; - -moduleFor( - 'NativeArray Copyable', - class extends AbstractTestCase { - ['@test deep copy is respected'](assert) { - let array = emberA([{ id: 1 }, { id: 2 }, { id: 3 }]); - let copiedArray; - - expectDeprecation(() => { - copiedArray = array.copy(true); - }, `Using \`NativeArray#copy\` is deprecated`); - - assert.deepEqual(copiedArray, array, 'copied array is equivalent'); - assert.ok(copiedArray[0] !== array[0], 'objects inside should be unique'); - } - } -);