Remove unneeded utilGetPrototypeOf and just use Object.getPrototypeOf

This commit is contained in:
Bryan Housel
2019-03-25 22:16:58 -04:00
parent eb0d0a35d1
commit 9e4cf126c3
4 changed files with 3 additions and 17 deletions
+3 -4
View File
@@ -2,7 +2,6 @@ import _difference from 'lodash-es/difference';
import _includes from 'lodash-es/includes';
import { debug } from '../index';
import { utilGetPrototypeOf } from '../util';
export function coreGraph(other, mutable) {
@@ -125,9 +124,9 @@ coreGraph.prototype = {
base: function() {
return {
'entities': utilGetPrototypeOf(this.entities),
'parentWays': utilGetPrototypeOf(this._parentWays),
'parentRels': utilGetPrototypeOf(this._parentRels)
'entities': Object.getPrototypeOf(this.entities),
'parentWays': Object.getPrototypeOf(this._parentWays),
'parentRels': Object.getPrototypeOf(this._parentRels)
};
},
-1
View File
@@ -13,7 +13,6 @@ export { utilEntityOrDeepMemberSelector } from './util';
export { utilFastMouse } from './util';
export { utilFunctor } from './util';
export { utilGetAllNodes } from './util';
export { utilGetPrototypeOf } from './util';
export { utilGetSetValue } from './get_set_value';
export { utilHashcode } from './util';
export { utilHighlightEntities } from './util';
-5
View File
@@ -283,11 +283,6 @@ export function utilFastMouse(container) {
}
/* eslint-disable no-proto */
export var utilGetPrototypeOf = Object.getPrototypeOf || function(obj) { return obj.__proto__; };
/* eslint-enable no-proto */
export function utilAsyncMap(inputs, func, callback) {
var remaining = inputs.length;
var results = [];
-7
View File
@@ -71,13 +71,6 @@ describe('iD.util', function() {
expect(iD.utilQsString({})).to.eql('');
});
it('utilGetPrototypeOf', function() {
var a = function() {};
a.prototype = { foo: 'foo' };
expect(iD.utilGetPrototypeOf({})).to.eql({});
expect(iD.utilGetPrototypeOf(new a())).to.eql({ foo: 'foo' });
});
describe('utilEditDistance', function() {
it('returns zero for same strings', function() {
expect(iD.utilEditDistance('foo', 'foo')).to.eql(0);