Skip to content

Commit

Permalink
[CLEANUP beta] Remove length from OrderedSet and Map.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jul 21, 2015
1 parent b4d02fd commit 836e706
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
3 changes: 0 additions & 3 deletions packages/ember-metal/lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import Ember from 'ember-metal/core';
import { guidFor } from 'ember-metal/utils';
import { deprecateProperty } from 'ember-metal/deprecate_property';

function missingFunction(fn) {
throw new TypeError(`${Object.prototype.toString.call(fn)} is not a function`);
Expand Down Expand Up @@ -420,8 +419,6 @@ Map.prototype = {
}
};

deprecateProperty(Map.prototype, 'length', 'size', { id: 'ember-metal.map-length', until: '3.0.0' });

/**
@class MapWithDefault
@namespace Ember
Expand Down
35 changes: 0 additions & 35 deletions packages/ember-metal/tests/map_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,41 +185,6 @@ function testMap(nameAndFunc) {
mapHasEntries([], map2);
});

QUnit.test('length', function() {
expectDeprecation('Usage of `length` is deprecated, use `size` instead.');

//Add a key twice
equal(map.length, 0);
map.set(string, 'a string');
equal(map.length, 1);
map.set(string, 'the same string');
equal(map.length, 1);

//Add another
map.set(number, 'a number');
equal(map.length, 2);

//Remove one that doesn't exist
map.delete('does not exist');
equal(map.length, 2);

//Check copy
var copy = map.copy();
equal(copy.length, 2);

//Remove a key twice
map.delete(number);
equal(map.length, 1);
map.delete(number);
equal(map.length, 1);

//Remove the last key
map.delete(string);
equal(map.length, 0);
map.delete(string);
equal(map.length, 0);
});

QUnit.test('size', function() {
//Add a key twice
equal(map.size, 0);
Expand Down

0 comments on commit 836e706

Please sign in to comment.