axnsoftware/enumjs — Issue #9: Implement a Stack class + Testcases
Author: axnsoftware
Created: 2011-10-18 22:06:09+00:00
State: open

Standard Stack class that is basically a wrapper around Array.

Interface:

Stack
+constructor(stackSize=Number.POSITIVE_INFINITY)
+peek(offset=0) : Object
+poke(value, offset=0) : Stack
+pop() : Object
+push(value) : Stack
+length
+stackSize

Both properties, length and stackSize, must not be writable, with length being a getter for the underlying Array's length property.

Test cases must cover 100% of branches and lines of executable code.