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.
@@ -1,5 +1,5 @@
1
1
  module Underscore
2
2
  module Source
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
5
5
  end
@@ -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') _ = exports;
31
+ if (typeof exports !== 'undefined') exports._ = _;
29
32
 
30
33
  // Current version.
31
- _.VERSION = '0.4.2';
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 != '__break__') throw 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 "__break__";
454
+ throw breaker;
452
455
  };
453
456
 
454
457
  // Generate a unique integer id (unique within the entire client session).
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: underscore-source
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
5
+ version: 0.4.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel X. Moore