Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

prototype: Remove support for "throw $continue" in Enumerable. Use "r…

…eturn" instead.
  • Loading branch information...
commit c89875ce8cc2a98bbf79a1d22dcd278ade81fdee 1 parent ce639c2
@sstephenson authored
View
2  CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Remove support for "throw $continue" in Enumerable. Use "return" instead. [sam]
+
* Update HEADER to reflect new URL. [sam]
*1.5.0* (January 18, 2007)
View
2  Rakefile
@@ -5,7 +5,7 @@ PROTOTYPE_ROOT = File.expand_path(File.dirname(__FILE__))
PROTOTYPE_SRC_DIR = File.join(PROTOTYPE_ROOT, 'src')
PROTOTYPE_DIST_DIR = File.join(PROTOTYPE_ROOT, 'dist')
PROTOTYPE_PKG_DIR = File.join(PROTOTYPE_ROOT, 'pkg')
-PROTOTYPE_VERSION = '1.5.0'
+PROTOTYPE_VERSION = '1.5.1_pre0'
task :default => [:dist, :package, :clean_package_source]
View
6 src/enumerable.js
@@ -6,11 +6,7 @@ var Enumerable = {
var index = 0;
try {
this._each(function(value) {
- try {
- iterator(value, index++);
- } catch (e) {
- if (e != $continue) throw e;
- }
+ iterator(value, index++);
});
} catch (e) {
if (e != $break) throw e;
View
4 test/unit/enumerable.html
@@ -64,10 +64,10 @@
assertEqual(2, result);
}},
- testEachContinue: function() {with(this) {
+ testEachReturnActsAsContinue: function() {with(this) {
var results = [];
[1, 2, 3].each(function(value) {
- if (value == 2) throw $continue;
+ if (value == 2) return;
results.push(value);
});
Please sign in to comment.
Something went wrong with that request. Please try again.