diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-13 21:09:12 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-13 21:09:12 -0800 |
commit | ae80958f6e91af709b354a5f6c1e31951f591436 (patch) | |
tree | 2d0ef541ff4945d9c70cf7c74770653df6fc32e8 /src/utility.js | |
parent | 49c2b8037c0b6bb04214b8ce1bd340aedc69d2dd (diff) |
warnOnce
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js index df9407c0..9661f865 100644 --- a/src/utility.js +++ b/src/utility.js @@ -69,6 +69,13 @@ function warn(a, msg) { } } +function warnOnce(msg) { + if (!warnOnce.msgs) warnOnce.msgs = {}; + if (msg in warnOnce.msgs) return; + warnOnce.msgs[msg] = true; + dprint('Warning: ' + msg); +} + function dedup(items, ident) { var seen = {}; if (ident) { |