prototype: Remove support for "throw $continue" in Enumerable. Use "return" instead.

This commit is contained in:
Sam Stephenson 2007-01-18 22:59:23 +00:00
parent ce639c2c8b
commit c89875ce8c
4 changed files with 6 additions and 8 deletions

View File

@ -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 File

@ -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 File

@ -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 File

@ -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);
});