|
| 1 | +/* eslint-disable */ |
| 2 | +/* jscs:disable */ |
1 | 3 | (function (exports) {'use strict';
|
2 | 4 | //shared pointer
|
3 | 5 | var i;
|
4 | 6 | //shortcuts
|
5 |
| - var defineProperty = Object.defineProperty, is = function(a,b) { return isNaN(a)? isNaN(b): a === b; }; |
6 |
| - |
| 7 | + var defineProperty = Object.defineProperty, is = function(a,b) { return (a === b) || (a !== a && b !== b) }; |
7 | 8 |
|
8 | 9 | //Polyfill global objects
|
9 | 10 | if (typeof WeakMap == 'undefined') {
|
|
79 | 80 | }, true);
|
80 | 81 | }
|
81 | 82 |
|
82 |
| - |
83 | 83 | /**
|
84 | 84 | * ES6 collection constructor
|
85 | 85 | * @return {Function} a collection class
|
|
110 | 110 | return Collection;
|
111 | 111 | }
|
112 | 112 |
|
113 |
| - |
114 | 113 | /** parse initial iterable argument passed */
|
115 | 114 | function init(a){
|
116 |
| - var i; |
117 | 115 | //init Set argument, like `[1,2,3,{}]`
|
118 | 116 | if (this.add)
|
119 | 117 | a.forEach(this.add, this);
|
|
122 | 120 | a.forEach(function(a){this.set(a[0],a[1])}, this);
|
123 | 121 | }
|
124 | 122 |
|
125 |
| - |
126 | 123 | /** delete */
|
127 | 124 | function sharedDelete(key) {
|
128 | 125 | if (this.has(key)) {
|
|
133 | 130 | }
|
134 | 131 | // Aurora here does it while Canary doesn't
|
135 | 132 | return -1 < i;
|
136 |
| - }; |
| 133 | + } |
137 | 134 |
|
138 | 135 | function sharedGet(key) {
|
139 | 136 | return this.has(key) ? this._values[i] : undefined;
|
|
143 | 140 | if (this.objectOnly && key !== Object(key))
|
144 | 141 | throw new TypeError("Invalid value used as weak collection key");
|
145 | 142 | //NaN or 0 passed
|
146 |
| - if (key != key || key === 0) for (i = list.length; i-- && !is(list[i], key);){} |
| 143 | + if (key !== key || key === 0) for (i = list.length; i-- && !is(list[i], key);){} |
147 | 144 | else i = list.indexOf(key);
|
148 | 145 | return -1 < i;
|
149 | 146 | }
|
|
0 commit comments