diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-01-23 00:06:03 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-01-23 00:06:03 -0500 |
commit | c0a15a51021509c7d7fda777635324f8080f56dc (patch) | |
tree | 228186b179bc56108bb5d4e33b18d528d558cc59 /src/library_gl.js | |
parent | 94d20863e25aac5c1f4a9619d9ca700347640739 (diff) |
Add debugging assertions
Diffstat (limited to 'src/library_gl.js')
-rw-r--r-- | src/library_gl.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 1321c560..a3842510 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -16,9 +16,15 @@ var LibraryGL = { return id; }, get: function(id) { +#if ASSERTIONS + assert(id < this.counter, "Invalid id " + id + " for the hashtable " + name); +#endif return this.table[id]; }, remove: function(id) { +#if ASSERTIONS + assert(id < this.counter, "Invalid id " + id + " for the hashtable " + name); +#endif delete this.table[id]; } }; |