Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename methods

  • Loading branch information...
commit bf83b37225d80174c6a931e51b6b315af79d9ae4 1 parent b8d7206
@fntzr authored
View
3  src/prototype/dom/dom.js
@@ -685,7 +685,8 @@
for (var i = 0, node; node = nodes[i]; i++)
element.appendChild(node);
} else {
- element.innerHTML = content.stripScripts();
+ element.innerHTML = '';
+ element.appendChild(document.createTextNode(content.stripScripts()));
}
} else {
element.innerHTML = content.stripScripts();
View
18 src/prototype/lang/hash.js
@@ -105,7 +105,7 @@ var Hash = Class.create(Enumerable, (function() {
}
/**
- * Hash#each_key(iterator[, context]) -> Hash
+ * Hash#eachKey(iterator[, context]) -> Hash
*
* Iterates over the keys in the hash.
*
@@ -113,19 +113,19 @@ var Hash = Class.create(Enumerable, (function() {
*
* var hash = $H({England: 'London', Poland: 'Warsaw'});
*
- * h.each_key(function(country) {
+ * h.eachKey(function(country) {
* alert(country);
* });
* // Alerts: England
* // Alerts: Poland
*
**/
- function each_key(iterator, context) {
+ function eachKey(iterator, context) {
this.keys().each(iterator, context);
}
/**
- * Hash#each_value(iterator[, context]) -> Hash
+ * Hash#eachValue(iterator[, context]) -> Hash
*
* Iterates over the values in the hash.
*
@@ -133,18 +133,18 @@ var Hash = Class.create(Enumerable, (function() {
*
* var hash = $H({England: 'London', Poland: 'Warsaw'});
*
- * h.each_value(function(capital) {
+ * h.eachValue(function(capital) {
* alert(capital);
* });
* // Alerts: London
* // Alerts: Warsaw
**/
- function each_value(iterator, context) {
+ function eachValue(iterator, context) {
this.values().each(iterator, context);
}
/**
- * Hash#each_pair(iterator[, context]) -> Hash
+ * Hash#eachPair(iterator[, context]) -> Hash
*
* Iterates over the key/value pairs in the hash.
*
@@ -152,14 +152,14 @@ var Hash = Class.create(Enumerable, (function() {
*
* var hash = $H({England: 'London', Poland: 'Warsaw'});
*
- * h.each_pair(function(country, capital) {
+ * h.eachPair(function(country, capital) {
* alert(capital + "is the capital of " + country);
* });
* //Alerts: London is the capital of England
* //Alerts: Warsaw is the capital of Poland
*
**/
- function each_pair(iterator, context) {
+ function eachPair(iterator, context) {
this.each(function(pair) {
iterator.call(context, pair.key, pair.value)
});
View
6 test/unit/hash_test.js
@@ -196,7 +196,7 @@ new Test.Unit.Runner({
testIterationWithEachKey: function() {
var hash = $H({a:1, b:2, c:3});
var keys = [];
- hash.each_key(function(key) {
+ hash.eachKey(function(key) {
keys.push(key);
});
this.assertEnumEqual(['a', 'b', 'c'], keys);
@@ -205,7 +205,7 @@ new Test.Unit.Runner({
testIterationWithEachValue: function() {
var hash = $H({a:1, b:2, c:3});
var values = [];
- hash.each_value(function(value) {
+ hash.eachValue(function(value) {
values.push(value);
});
this.assertEnumEqual([1, 2, 3], values);
@@ -215,7 +215,7 @@ new Test.Unit.Runner({
var hash = $H({a:1, b:2, c:3});
var keys = [];
var values = [];
- hash.each_pair(function(key, value) {
+ hash.eachPair(function(key, value) {
keys.push(key);
values.push(value);
});
Please sign in to comment.
Something went wrong with that request. Please try again.