* Setup constants
()
| 398 | * Setup constants |
| 399 | */ |
| 400 | setupConstants() { |
| 401 | this.kernelConstants = []; |
| 402 | let needsConstantTypes = this.constantTypes === null; |
| 403 | if (needsConstantTypes) { |
| 404 | this.constantTypes = {}; |
| 405 | } |
| 406 | this.constantBitRatios = {}; |
| 407 | if (this.constants) { |
| 408 | for (let name in this.constants) { |
| 409 | if (needsConstantTypes) { |
| 410 | const type = utils.getVariableType(this.constants[name], this.strictIntegers); |
| 411 | this.constantTypes[name] = type; |
| 412 | this.kernelConstants.push({ |
| 413 | name, |
| 414 | type |
| 415 | }); |
| 416 | } else { |
| 417 | this.kernelConstants.push({ |
| 418 | name, |
| 419 | type: this.constantTypes[name] |
| 420 | }); |
| 421 | } |
| 422 | this.constantBitRatios[name] = this.getBitRatio(this.constants[name]); |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | /** |
| 428 | * |
no test coverage detected