Remove Base.iterator() functionality, since we don't need it in Paper.js

This commit is contained in:
Jürg Lehni 2012-12-26 14:12:42 +01:00
parent 3b88bffff1
commit 10385267f9

19
lib/bootstrap.js vendored
View file

@ -196,27 +196,11 @@ var Base = new function() { // Bootstrap scope
return dest;
}
/**
* Converts the argument to an iterator function. If none is specified, the
* identity function is returned.
* This supports normal functions, which are returned unmodified, and values
* to compare to. Wherever this function is used in the Enumerable
* functions, a value, a Function or null may be passed.
*/
function iterator(iter) {
return !iter
? function(val) { return val }
: typeof iter !== 'function'
? function(val) { return val == iter }
: iter;
}
function each(obj, iter, bind, asArray) {
try {
if (obj)
(asArray || asArray === undefined && isArray(obj)
? forEach : forIn).call(obj, iterator(iter),
bind = bind || obj);
? forEach : forIn).call(obj, iter, bind = bind || obj);
} catch (e) {
if (e !== Base.stop) throw e;
}
@ -324,7 +308,6 @@ var Base = new function() { // Bootstrap scope
clone: clone,
define: define,
describe: describe,
iterator: iterator,
// Base.create does something different from Object.create, it only
// works on constructors and uses their prototype.