Skip to content

Commit ece9045

Browse files
authored
Merge pull request #13729 from tricknotes/remove-ember-metal-replace
[BUGFIX beta] Remove unreferenced function from `ember-metal/replace`
2 parents c9b09a3 + 879a174 commit ece9045

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed
Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let { splice } = Array.prototype;
22

3-
export function _replace(array, idx, amt, objects) {
3+
export default function replace(array, idx, amt, objects) {
44
let args = [].concat(objects);
55
let ret = [];
66
// https://code.google.com/p/chromium/issues/detail?id=56588
@@ -23,38 +23,3 @@ export function _replace(array, idx, amt, objects) {
2323
}
2424
return ret;
2525
}
26-
27-
/**
28-
Replaces objects in an array with the passed objects.
29-
30-
```javascript
31-
let array = [1,2,3];
32-
Ember.EnumerableUtils.replace(array, 1, 2, [4, 5]); // [1, 4, 5]
33-
34-
let array = [1,2,3];
35-
Ember.EnumerableUtils.replace(array, 1, 1, [4, 5]); // [1, 4, 5, 3]
36-
37-
let array = [1,2,3];
38-
Ember.EnumerableUtils.replace(array, 10, 1, [4, 5]); // [1, 2, 3, 4, 5]
39-
```
40-
41-
@method replace
42-
@deprecated
43-
@param {Array} array The array the objects should be inserted into.
44-
@param {Number} idx Starting index in the array to replace. If *idx* >=
45-
length, then append to the end of the array.
46-
@param {Number} amt Number of elements that should be removed from the array,
47-
starting at *idx*
48-
@param {Array} objects An array of zero or more objects that should be
49-
inserted into the array at *idx*
50-
51-
@return {Array} The modified array.
52-
@public
53-
*/
54-
export default function replace(array, idx, amt, objects) {
55-
if (array.replace) {
56-
return array.replace(idx, amt, objects);
57-
} else {
58-
return _replace(array, idx, amt, objects);
59-
}
60-
}

packages/ember-runtime/lib/system/native_array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import Ember from 'ember-metal/core'; // Ember.A circular
66
import { ENV } from 'ember-environment';
7-
import { _replace as replace } from 'ember-metal/replace';
7+
import replace from 'ember-metal/replace';
88
import { get } from 'ember-metal/property_get';
99
import { Mixin } from 'ember-metal/mixin';
1010
import EmberArray, {

0 commit comments

Comments
 (0)