mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Update to latest version of straps.js
This commit is contained in:
parent
a33beb0285
commit
8aec04702c
1 changed files with 9 additions and 14 deletions
|
@ -20,12 +20,11 @@
|
|||
|
||||
var Base = new function() {
|
||||
var hidden = /^(statics|generics|preserve|enumerable|prototype|toString|valueOf)$/,
|
||||
proto = Object.prototype,
|
||||
toString = proto.toString,
|
||||
proto = Array.prototype,
|
||||
toString = Object.prototype.toString,
|
||||
isArray = Array.isArray = Array.isArray || function(obj) {
|
||||
return toString.call(obj) === '[object Array]';
|
||||
},
|
||||
proto = Array.prototype,
|
||||
slice = proto.slice,
|
||||
forEach = proto.forEach || function(iter, bind) {
|
||||
for (var i = 0, l = this.length; i < l; i++)
|
||||
|
@ -299,8 +298,8 @@ var Base = new function() {
|
|||
define: define,
|
||||
describe: describe,
|
||||
|
||||
// Base.create does something different from Object.create, it only
|
||||
// works on constructors and uses their prototype.
|
||||
// Base.create does something different from Object.create:
|
||||
// It works on constructors and uses their prototype.
|
||||
create: function(ctor) {
|
||||
return create(ctor.prototype);
|
||||
},
|
||||
|
@ -321,9 +320,8 @@ var Base = new function() {
|
|||
},
|
||||
|
||||
/**
|
||||
* Returns the first argument that is defined.
|
||||
* Null is counted as defined too, since !== undefined is used for
|
||||
* comparisons. In this it differs from Mootools!
|
||||
* Returns the first argument that is defined. null is counted as
|
||||
* defined too, as !== undefined is used for comparisons.
|
||||
*/
|
||||
pick: function() {
|
||||
for (var i = 0, l = arguments.length; i < l; i++)
|
||||
|
@ -333,13 +331,10 @@ var Base = new function() {
|
|||
},
|
||||
|
||||
/**
|
||||
* A special constant, to be thrown by closures passed to each()
|
||||
* Base.stop can be thrown by iterators passed to each()
|
||||
*
|
||||
* $continue / Base.next is not implemented, as the same
|
||||
* functionality can achieved by using return in the closure.
|
||||
* In prototype, the implementation of $continue also leads to a
|
||||
* huge speed decrease, as the closure is wrapped in another closure
|
||||
* that does nothing else than handling $continue.
|
||||
* continue (Base.next) is not implemented, as the same can achieved
|
||||
* by using return in the iterator.
|
||||
*/
|
||||
stop: {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue