aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-09-15 21:00:26 -0700
committeralon@honor <none@none>2010-09-15 21:00:26 -0700
commit9b369c6e57ad1f7a5f47c0198573c89aa9255d22 (patch)
tree3151804fecc13fd1e6c9edc9e61353af027b7284 /src/utility.js
parent92fac9b713e3b13e5a77af2e1c89bd75040af550 (diff)
rewrite enzymatic, compilation is x2.5 faster
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index 0a5a22fb..28d3fa93 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -53,6 +53,7 @@ function assertEq(a, b) {
function assertTrue(a) {
assertEq(!!a, true);
}
+assert = assertTrue;
function dedup(items, ident) {
var seen = {};
@@ -106,6 +107,12 @@ function values(x) {
return ret;
}
+function bind(self, func) {
+ return function() {
+ func.apply(self, arguments);
+ }
+}
+
function sum(x) {
return x.reduce(function(a,b) { return a+b }, 0);
}
@@ -157,3 +164,10 @@ function concatenator(x, y) {
return x.concat(y);
}
+function mergeInto(obj, other) {
+ for (i in other) {
+ obj[i] = other[i];
+ }
+ return obj;
+}
+