prototype: Hash#toTemplateReplacements is an alias for Hash#toObject so you can once again pass hashes to Template#evaluate and String#interpolate.
This commit is contained in:
parent
d114e76e97
commit
8327ffd8ae
|
@ -1,5 +1,7 @@
|
|||
*1.6.0_rc1* (October 16, 2007)
|
||||
|
||||
* Hash#toTemplateReplacements is an alias for Hash#toObject so you can once again pass hashes to Template#evaluate and String#interpolate. [sam]
|
||||
|
||||
* Fix Event#is(Left|Middle|Right)Click in IE. Closes #7520 (again). [Mislav Marohnić]
|
||||
|
||||
* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont]
|
||||
|
|
|
@ -116,4 +116,5 @@ var Hash = Class.create(Enumerable, (function() {
|
|||
}
|
||||
})());
|
||||
|
||||
Hash.from = $H;
|
||||
Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
|
||||
Hash.from = $H;
|
||||
|
|
|
@ -206,6 +206,13 @@
|
|||
assertEnumEqual($w('_each keys map pluck unset'), h.keys().sort());
|
||||
assertEqual('U', h.unset('unset'));
|
||||
assertHashEqual({ _each: 'E', map: 'M', keys: 'K', pluck: 'P' }, h);
|
||||
}},
|
||||
|
||||
testHashToTemplateReplacements: function() { with(this) {
|
||||
var template = new Template("#{a} #{b}"), hash = $H({ a: "hello", b: "world" });
|
||||
assertEqual("hello world", template.evaluate(hash.toObject()));
|
||||
assertEqual("hello world", template.evaluate(hash));
|
||||
assertEqual("hello", "#{a}".interpolate(hash));
|
||||
}}
|
||||
|
||||
}, 'testlog');
|
||||
|
|
Loading…
Reference in New Issue