Skip to content

Commit a320166

Browse files
committed
Stable Version 4.3.2.
Fixes #191
1 parent ac58584 commit a320166

File tree

5 files changed

+74
-90
lines changed

5 files changed

+74
-90
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##### 4.3.2 10 July 2015
2+
3+
- #191 - yabh issue with ie8
4+
15
##### 4.3.1 07 July 2015
26

37
- #190 - 4.3 breaks phantomJS tests

dist/angular-cache.js

+64-84
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* angular-cache
3-
* @version 4.3.1 - Homepage <http://jmdobry.github.io/angular-cache/>
3+
* @version 4.3.2 - Homepage <http://jmdobry.github.io/angular-cache/>
44
* @author Jason Dobry <[email protected]>
55
* @copyright (c) 2013-2015 Jason Dobry
66
* @license MIT <https://github.com/jmdobry/angular-cache/blob/master/LICENSE>
@@ -108,7 +108,7 @@ return /******/ (function(modules) { // webpackBootstrap
108108

109109
/*!
110110
* cachefactory
111-
* @version 1.0.2 - Homepage <http://jmdobry.github.io/cachefactory/>
111+
* @version 1.1.0 - Homepage <http://jmdobry.github.io/cachefactory/>
112112
* @author Jason Dobry <[email protected]>
113113
* @copyright (c) 2013-2015 Jason Dobry
114114
* @license MIT <https://github.com/jmdobry/cachefactory/blob/master/LICENSE>
@@ -1085,7 +1085,7 @@ return /******/ (function(modules) { // webpackBootstrap
10851085

10861086
/*!
10871087
* yabh
1088-
* @version 1.0.1 - Homepage <http://jmdobry.github.io/yabh/>
1088+
* @version 1.1.0 - Homepage <http://jmdobry.github.io/yabh/>
10891089
* @author Jason Dobry <[email protected]>
10901090
* @copyright (c) 2015 Jason Dobry
10911091
* @license MIT <https://github.com/jmdobry/yabh/blob/master/LICENSE>
@@ -1148,13 +1148,6 @@ return /******/ (function(modules) { // webpackBootstrap
11481148
/* 0 */
11491149
/***/ function(module, exports, __webpack_require__) {
11501150

1151-
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
1152-
1153-
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
1154-
1155-
Object.defineProperty(exports, '__esModule', {
1156-
value: true
1157-
});
11581151
/**
11591152
* @method bubbleUp
11601153
* @param {array} heap The heap.
@@ -1223,88 +1216,75 @@ return /******/ (function(modules) { // webpackBootstrap
12231216
}
12241217
};
12251218

1226-
var BinaryHeap = (function () {
1227-
function BinaryHeap(weightFunc, compareFunc) {
1228-
_classCallCheck(this, BinaryHeap);
1219+
function BinaryHeap(weightFunc, compareFunc) {
1220+
if (!weightFunc) {
1221+
weightFunc = function (x) {
1222+
return x;
1223+
};
1224+
}
1225+
if (!compareFunc) {
1226+
compareFunc = function (x, y) {
1227+
return x === y;
1228+
};
1229+
}
1230+
if (typeof weightFunc !== 'function') {
1231+
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');
1232+
}
1233+
if (typeof compareFunc !== 'function') {
1234+
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');
1235+
}
1236+
this.weightFunc = weightFunc;
1237+
this.compareFunc = compareFunc;
1238+
this.heap = [];
1239+
}
1240+
1241+
var BHProto = BinaryHeap.prototype;
12291242

1230-
if (!weightFunc) {
1231-
weightFunc = function (x) {
1232-
return x;
1233-
};
1234-
}
1235-
if (!compareFunc) {
1236-
compareFunc = function (x, y) {
1237-
return x === y;
1238-
};
1239-
}
1240-
if (typeof weightFunc !== 'function') {
1241-
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');
1242-
}
1243-
if (typeof compareFunc !== 'function') {
1244-
throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');
1245-
}
1246-
this.weightFunc = weightFunc;
1247-
this.compareFunc = compareFunc;
1248-
this.heap = [];
1243+
BHProto.push = function (node) {
1244+
this.heap.push(node);
1245+
bubbleUp(this.heap, this.weightFunc, this.heap.length - 1);
1246+
};
1247+
1248+
BHProto.peek = function () {
1249+
return this.heap[0];
1250+
};
1251+
1252+
BHProto.pop = function () {
1253+
var front = this.heap[0];
1254+
var end = this.heap.pop();
1255+
if (this.heap.length > 0) {
1256+
this.heap[0] = end;
1257+
bubbleDown(this.heap, this.weightFunc, 0);
12491258
}
1259+
return front;
1260+
};
12501261

1251-
_createClass(BinaryHeap, [{
1252-
key: 'push',
1253-
value: function push(node) {
1254-
this.heap.push(node);
1255-
bubbleUp(this.heap, this.weightFunc, this.heap.length - 1);
1256-
}
1257-
}, {
1258-
key: 'peek',
1259-
value: function peek() {
1260-
return this.heap[0];
1261-
}
1262-
}, {
1263-
key: 'pop',
1264-
value: function pop() {
1265-
var front = this.heap[0];
1262+
BHProto.remove = function (node) {
1263+
var length = this.heap.length;
1264+
for (var i = 0; i < length; i++) {
1265+
if (this.compareFunc(this.heap[i], node)) {
1266+
var removed = this.heap[i];
12661267
var end = this.heap.pop();
1267-
if (this.heap.length > 0) {
1268-
this.heap[0] = end;
1269-
bubbleDown(this.heap, this.weightFunc, 0);
1270-
}
1271-
return front;
1272-
}
1273-
}, {
1274-
key: 'remove',
1275-
value: function remove(node) {
1276-
var length = this.heap.length;
1277-
for (var i = 0; i < length; i++) {
1278-
if (this.compareFunc(this.heap[i], node)) {
1279-
var removed = this.heap[i];
1280-
var end = this.heap.pop();
1281-
if (i !== length - 1) {
1282-
this.heap[i] = end;
1283-
bubbleUp(this.heap, this.weightFunc, i);
1284-
bubbleDown(this.heap, this.weightFunc, i);
1285-
}
1286-
return removed;
1287-
}
1268+
if (i !== length - 1) {
1269+
this.heap[i] = end;
1270+
bubbleUp(this.heap, this.weightFunc, i);
1271+
bubbleDown(this.heap, this.weightFunc, i);
12881272
}
1289-
return null;
1273+
return removed;
12901274
}
1291-
}, {
1292-
key: 'removeAll',
1293-
value: function removeAll() {
1294-
this.heap = [];
1295-
}
1296-
}, {
1297-
key: 'size',
1298-
value: function size() {
1299-
return this.heap.length;
1300-
}
1301-
}]);
1275+
}
1276+
return null;
1277+
};
13021278

1303-
return BinaryHeap;
1304-
})();
1279+
BHProto.removeAll = function () {
1280+
this.heap = [];
1281+
};
1282+
1283+
BHProto.size = function () {
1284+
return this.heap.length;
1285+
};
13051286

1306-
exports['default'] = BinaryHeap;
1307-
module.exports = exports['default'];
1287+
module.exports = BinaryHeap;
13081288

13091289
/***/ }
13101290
/******/ ])

0 commit comments

Comments
 (0)