aboutsummaryrefslogtreecommitdiff
path: root/node_modules/es6-iterator/for-of.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/es6-iterator/for-of.js
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/es6-iterator/for-of.js')
-rw-r--r--node_modules/es6-iterator/for-of.js39
1 files changed, 20 insertions, 19 deletions
diff --git a/node_modules/es6-iterator/for-of.js b/node_modules/es6-iterator/for-of.js
index c7a28411d..5d15c349f 100644
--- a/node_modules/es6-iterator/for-of.js
+++ b/node_modules/es6-iterator/for-of.js
@@ -1,35 +1,36 @@
-'use strict';
+"use strict";
-var isArguments = require('es5-ext/function/is-arguments')
- , callable = require('es5-ext/object/valid-callable')
- , isString = require('es5-ext/string/is-string')
- , get = require('./get')
+var isArguments = require("es5-ext/function/is-arguments")
+ , callable = require("es5-ext/object/valid-callable")
+ , isString = require("es5-ext/string/is-string")
+ , get = require("./get");
- , isArray = Array.isArray, call = Function.prototype.call
- , some = Array.prototype.some;
+var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some;
-module.exports = function (iterable, cb/*, thisArg*/) {
- var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;
- if (isArray(iterable) || isArguments(iterable)) mode = 'array';
- else if (isString(iterable)) mode = 'string';
+module.exports = function (iterable, cb /*, thisArg*/) {
+ var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code;
+ if (isArray(iterable) || isArguments(iterable)) mode = "array";
+ else if (isString(iterable)) mode = "string";
else iterable = get(iterable);
callable(cb);
- doBreak = function () { broken = true; };
- if (mode === 'array') {
+ doBreak = function () {
+ broken = true;
+ };
+ if (mode === "array") {
some.call(iterable, function (value) {
call.call(cb, thisArg, value, doBreak);
- if (broken) return true;
+ return broken;
});
return;
}
- if (mode === 'string') {
- l = iterable.length;
- for (i = 0; i < l; ++i) {
+ if (mode === "string") {
+ length = iterable.length;
+ for (i = 0; i < length; ++i) {
char = iterable[i];
- if ((i + 1) < l) {
+ if (i + 1 < length) {
code = char.charCodeAt(0);
- if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];
+ if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i];
}
call.call(cb, thisArg, char, doBreak);
if (broken) break;