增加晶全app静态页面
This commit is contained in:
38
node_modules/es6-map/lib/iterator.js
generated
vendored
Normal file
38
node_modules/es6-map/lib/iterator.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
var setPrototypeOf = require('es5-ext/object/set-prototype-of')
|
||||
, d = require('d')
|
||||
, Iterator = require('es6-iterator')
|
||||
, toStringTagSymbol = require('es6-symbol').toStringTag
|
||||
, kinds = require('./iterator-kinds')
|
||||
|
||||
, defineProperties = Object.defineProperties
|
||||
, unBind = Iterator.prototype._unBind
|
||||
, MapIterator;
|
||||
|
||||
MapIterator = module.exports = function (map, kind) {
|
||||
if (!(this instanceof MapIterator)) return new MapIterator(map, kind);
|
||||
Iterator.call(this, map.__mapKeysData__, map);
|
||||
if (!kind || !kinds[kind]) kind = 'key+value';
|
||||
defineProperties(this, {
|
||||
__kind__: d('', kind),
|
||||
__values__: d('w', map.__mapValuesData__)
|
||||
});
|
||||
};
|
||||
if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);
|
||||
|
||||
MapIterator.prototype = Object.create(Iterator.prototype, {
|
||||
constructor: d(MapIterator),
|
||||
_resolve: d(function (i) {
|
||||
if (this.__kind__ === 'value') return this.__values__[i];
|
||||
if (this.__kind__ === 'key') return this.__list__[i];
|
||||
return [this.__list__[i], this.__values__[i]];
|
||||
}),
|
||||
_unBind: d(function () {
|
||||
this.__values__ = null;
|
||||
unBind.call(this);
|
||||
}),
|
||||
toString: d(function () { return '[object Map Iterator]'; })
|
||||
});
|
||||
Object.defineProperty(MapIterator.prototype, toStringTagSymbol,
|
||||
d('c', 'Map Iterator'));
|
Reference in New Issue
Block a user