aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-04-18 17:43:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-04-18 17:43:43 -0700
commit46e3b2a78717b112254be5f6e8cbd1fad6ab1703 (patch)
tree6c2d8966086d72e632eb37ed313d1f3c0a939e7d /src/utility.js
parentf89d9e2be63cbc3d4984dc748dac433dc3491fed (diff)
refactor assertions and parsing code
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js
index f0d8e37e..64d9011a 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -62,6 +62,12 @@ function assertTrue(a, msg) {
}
assert = assertTrue;
+function warn(a, msg) {
+ if (!a) {
+ dprint('Warning: ' + msg);
+ }
+}
+
function dedup(items, ident) {
var seen = {};
if (ident) {
@@ -226,3 +232,7 @@ function setIntersect(x, y) {
return ret;
}
+function copy(x) {
+ return JSON.parse(JSON.stringify(x));
+}
+