| Index: src/collection.js
|
| diff --git a/src/collection.js b/src/collection.js
|
| index b92a144c0cded375e072375f55e2ebea3902103e..70a88fb873cb18956514122aba63a1e115af01f0 100644
|
| --- a/src/collection.js
|
| +++ b/src/collection.js
|
| @@ -8,10 +8,19 @@
|
|
|
| %CheckIsBootstrapping();
|
|
|
| +// -------------------------------------------------------------------
|
| +// Imports
|
| +
|
| var GlobalMap = global.Map;
|
| var GlobalObject = global.Object;
|
| var GlobalSet = global.Set;
|
|
|
| +var NumberIsNaN;
|
| +
|
| +utils.Import(function(from) {
|
| + NumberIsNaN = from.NumberIsNaN;
|
| +});
|
| +
|
| // -------------------------------------------------------------------
|
|
|
| function HashToEntry(table, hash, numBuckets) {
|
| @@ -22,7 +31,7 @@ function HashToEntry(table, hash, numBuckets) {
|
|
|
|
|
| function SetFindEntry(table, numBuckets, key, hash) {
|
| - var keyIsNaN = $numberIsNaN(key);
|
| + var keyIsNaN = NumberIsNaN(key);
|
| for (var entry = HashToEntry(table, hash, numBuckets);
|
| entry !== NOT_FOUND;
|
| entry = ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets)) {
|
| @@ -30,7 +39,7 @@ function SetFindEntry(table, numBuckets, key, hash) {
|
| if (key === candidate) {
|
| return entry;
|
| }
|
| - if (keyIsNaN && $numberIsNaN(candidate)) {
|
| + if (keyIsNaN && NumberIsNaN(candidate)) {
|
| return entry;
|
| }
|
| }
|
| @@ -40,7 +49,7 @@ function SetFindEntry(table, numBuckets, key, hash) {
|
|
|
|
|
| function MapFindEntry(table, numBuckets, key, hash) {
|
| - var keyIsNaN = $numberIsNaN(key);
|
| + var keyIsNaN = NumberIsNaN(key);
|
| for (var entry = HashToEntry(table, hash, numBuckets);
|
| entry !== NOT_FOUND;
|
| entry = ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets)) {
|
| @@ -48,7 +57,7 @@ function MapFindEntry(table, numBuckets, key, hash) {
|
| if (key === candidate) {
|
| return entry;
|
| }
|
| - if (keyIsNaN && $numberIsNaN(candidate)) {
|
| + if (keyIsNaN && NumberIsNaN(candidate)) {
|
| return entry;
|
| }
|
| }
|
| @@ -239,8 +248,8 @@ function SetForEach(f, receiver) {
|
| %FunctionSetLength(SetForEach, 1);
|
|
|
| // Set up the non-enumerable functions on the Set prototype object.
|
| -$installGetter(GlobalSet.prototype, "size", SetGetSize);
|
| -$installFunctions(GlobalSet.prototype, DONT_ENUM, [
|
| +utils.InstallGetter(GlobalSet.prototype, "size", SetGetSize);
|
| +utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [
|
| "add", SetAdd,
|
| "has", SetHas,
|
| "delete", SetDelete,
|
| @@ -427,8 +436,8 @@ function MapForEach(f, receiver) {
|
| %FunctionSetLength(MapForEach, 1);
|
|
|
| // Set up the non-enumerable functions on the Map prototype object.
|
| -$installGetter(GlobalMap.prototype, "size", MapGetSize);
|
| -$installFunctions(GlobalMap.prototype, DONT_ENUM, [
|
| +utils.InstallGetter(GlobalMap.prototype, "size", MapGetSize);
|
| +utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [
|
| "get", MapGet,
|
| "set", MapSet,
|
| "has", MapHas,
|
|
|