Skip to content

Commit

Permalink
rebuild collections.min.js for v5.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hthetiot committed Jul 11, 2018
1 parent 6381c7b commit 60c3c2e
Showing 1 changed file with 54 additions and 27 deletions.
81 changes: 54 additions & 27 deletions collections.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.collections = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.collections = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

var Shim = require("./shim");
Expand Down Expand Up @@ -4623,13 +4623,22 @@ MultiMap.prototype.bucket = function (key) {
// Object.prototype might not be frozen and
// Object.create(null) might not be reliable.

defProp(key, HIDDEN_NAME, {
value: hiddenRecord,
writable: false,
enumerable: false,
configurable: false
});
return hiddenRecord;
try {
defProp(key, HIDDEN_NAME, {
value: hiddenRecord,
writable: false,
enumerable: false,
configurable: false
});
return hiddenRecord;
} catch (error) {
// Under some circumstances, isExtensible seems to misreport whether
// the HIDDEN_NAME can be defined.
// The circumstances have not been isolated, but at least affect
// Node.js v0.10.26 on TravisCI / Linux, but not the same version of
// Node.js on OS X.
return void 0;
}
}

/**
Expand Down Expand Up @@ -6501,19 +6510,36 @@ function search(array, value, compare) {
return -(first + 1);
}

function determineIncomparableRange(index, array, value, compare, equals) {
// Return the inclusive start and end indices of the incomparable streak containing value.
var start = index;
var end = index;

while (start > 0 && compare(value, array[start - 1]) === 0) {
start--;
}

while (end < array.length - 1 && compare(value, array[end + 1]) === 0) {
end++;
}

return {start: start, end: end};
}

function searchFirst(array, value, compare, equals) {
var index = search(array, value, compare);
if (index < 0) {
return -1;
} else {
while (index > 0 && equals(value, array[index - 1])) {
index--;
}
if (!equals(value, array[index])) {
return -1;
} else {
return index;
var range = determineIncomparableRange(index, array, value, compare, equals);

for (var i = range.start; i <= range.end; i++) {
if (equals(value, array[i])) {
return i;
}
}

return -1;
}
}

Expand All @@ -6522,14 +6548,15 @@ function searchLast(array, value, compare, equals) {
if (index < 0) {
return -1;
} else {
while (index < array.length - 1 && equals(value, array[index + 1])) {
index++;
}
if (!equals(value, array[index])) {
return -1;
} else {
return index;
var range = determineIncomparableRange(index, array, value, compare, equals);

for (var i = range.end; i >= range.start; i--) {
if (equals(value, array[i])) {
return i;
}
}

return -1;
}
}

Expand Down Expand Up @@ -6559,8 +6586,8 @@ SortedArray.prototype.has = function (value, equals) {
if (equals) {
throw new Error("SortedSet#has does not support second argument: equals");
}
var index = search(this.array, value, this.contentCompare);
return index >= 0 && this.contentEquals(this.array[index], value);
var index = searchFirst(this.array, value, this.contentCompare, this.contentEquals);
return index !== -1;
};

SortedArray.prototype.get = function (value, equals) {
Expand Down Expand Up @@ -7479,13 +7506,13 @@ Node.prototype.reduce = function (callback, basis, index, thisp, tree, depth) {
Node.prototype.reduceRight = function (callback, basis, index, thisp, tree, depth) {
depth = depth || 0;
if (this.right) {
basis = this.right.reduce(callback, basis, index, thisp, tree, depth + 1);
basis = this.right.reduceRight(callback, basis, index, thisp, tree, depth + 1);
index -= this.right.length;
}
basis = callback.call(thisp, basis, this.value, this.value, tree, this, depth);
index -= 1;
if (this.left) {
basis = this.left.reduce(callback, basis, index, thisp, tree, depth + 1);
basis = this.left.reduceRight(callback, basis, index, thisp, tree, depth + 1);
}
return basis;
};
Expand Down Expand Up @@ -7735,4 +7762,4 @@ global.Iterator = require("./iterator");


},{"./dict":6,"./fast-map":7,"./fast-set":8,"./iterator":13,"./list":14,"./lru-map":19,"./lru-set":20,"./map":21,"./multi-map":22,"./set":24,"./shim":29,"./sorted-array":32,"./sorted-array-map":30,"./sorted-array-set":31,"./sorted-map":33,"./sorted-set":34,"./weak-map":36}]},{},[])("/")
});
});

0 comments on commit 60c3c2e

Please sign in to comment.