Only compress code in new Function if all arguments are strings.

This commit is contained in:
Mihai Bazon
2013-05-14 18:36:31 +03:00
parent d13aa3954d
commit caa8896a8a
2 changed files with 8 additions and 1 deletions

View File

@@ -245,6 +245,13 @@ function makePredicate(words) {
return new Function("str", f);
};
function all(array, predicate) {
for (var i = array.length; --i >= 0;)
if (!predicate(array[i]))
return false;
return true;
};
function Dictionary() {
this._values = Object.create(null);
this._size = 0;