prototype: Remove support for "throw $continue" in Enumerable. Use "return" instead.
This commit is contained in:
parent
ce639c2c8b
commit
c89875ce8c
|
@ -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)
|
||||
|
|
2
Rakefile
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]
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue