|
@@ -549,12 +549,15 @@ class CodeBox {
|
|
* The stack class
|
|
* The stack class
|
|
*/
|
|
*/
|
|
class Stack {
|
|
class Stack {
|
|
- constructor() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param {int[]} stackValues An array of values to initialize the stack with
|
|
|
|
+ */
|
|
|
|
+ constructor(stackValues = []) {
|
|
/**
|
|
/**
|
|
* The stack
|
|
* The stack
|
|
* @type {int[]}
|
|
* @type {int[]}
|
|
*/
|
|
*/
|
|
- this.stack = [];
|
|
|
|
|
|
+ this.stack = stackValues;
|
|
/**
|
|
/**
|
|
* A single value saved off the stack
|
|
* A single value saved off the stack
|
|
* @type {int}
|
|
* @type {int}
|