]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / node_modules / es6-iterator / string.js
1 // Thanks @mathiasbynens
2 // http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols
3
4 'use strict';
5
6 var setPrototypeOf = require('es5-ext/object/set-prototype-of')
7   , d              = require('d')
8   , Iterator       = require('./')
9
10   , defineProperty = Object.defineProperty
11   , StringIterator;
12
13 StringIterator = module.exports = function (str) {
14         if (!(this instanceof StringIterator)) return new StringIterator(str);
15         str = String(str);
16         Iterator.call(this, str);
17         defineProperty(this, '__length__', d('', str.length));
18
19 };
20 if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator);
21
22 StringIterator.prototype = Object.create(Iterator.prototype, {
23         constructor: d(StringIterator),
24         _next: d(function () {
25                 if (!this.__list__) return;
26                 if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
27                 this._unBind();
28         }),
29         _resolve: d(function (i) {
30                 var char = this.__list__[i], code;
31                 if (this.__nextIndex__ === this.__length__) return char;
32                 code = char.charCodeAt(0);
33                 if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++];
34                 return char;
35         }),
36         toString: d(function () { return '[object String Iterator]'; })
37 });