diff options
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 10 |
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)); +} + |