mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Remove unneeded utilGetPrototypeOf and just use Object.getPrototypeOf
This commit is contained in:
@@ -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)
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user