underscore-source 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -21,14 +21,17 @@
|
|
21
21
|
// underscore functions. Wrapped objects may be chained.
|
22
22
|
var wrapper = function(obj) { this._wrapped = obj; };
|
23
23
|
|
24
|
+
// Establish the object that gets thrown to break out of a loop iteration.
|
25
|
+
var breaker = typeof StopIteration !== 'undefined' ? StopIteration : '__break__';
|
26
|
+
|
24
27
|
// Create a safe reference to the Underscore object for reference below.
|
25
28
|
var _ = root._ = function(obj) { return new wrapper(obj); };
|
26
29
|
|
27
30
|
// Export the Underscore object for CommonJS.
|
28
|
-
if (typeof exports !== 'undefined') _ =
|
31
|
+
if (typeof exports !== 'undefined') exports._ = _;
|
29
32
|
|
30
33
|
// Current version.
|
31
|
-
_.VERSION = '0.4.
|
34
|
+
_.VERSION = '0.4.3';
|
32
35
|
|
33
36
|
/*------------------------ Collection Functions: ---------------------------*/
|
34
37
|
|
@@ -47,7 +50,7 @@
|
|
47
50
|
}
|
48
51
|
}
|
49
52
|
} catch(e) {
|
50
|
-
if (e !=
|
53
|
+
if (e != breaker) throw e;
|
51
54
|
}
|
52
55
|
return obj;
|
53
56
|
};
|
@@ -448,7 +451,7 @@
|
|
448
451
|
|
449
452
|
// Break out of the middle of an iteration.
|
450
453
|
_.breakLoop = function() {
|
451
|
-
throw
|
454
|
+
throw breaker;
|
452
455
|
};
|
453
456
|
|
454
457
|
// Generate a unique integer id (unique within the entire client session).
|