2006-07-25から1日間の記事一覧

Enumerableクラス(1)

prototype.js解読の山場のひとつです。 【抜粋 一部省略】 var Enumerable = { each: function(iterator) { var index = 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != $continue) throw e; } }); } catch…

$breakeオブジェクト、$continueオブジェクト

【抜粋】 var $break = new Object(); var $continue = new Object();次のEnumerableクラスでエラーオブジェクトとして使用します。