We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0651e62 commit f27a4b0Copy full SHA for f27a4b0
src/compiler/jsgen.js
@@ -177,7 +177,7 @@ class ConstantInput {
177
}
178
179
asString () {
180
- return `"${sanitize('' + this.constantValue)}"`; // Should this be updated to use "Cast.toString"?
+ return `"${sanitize(Cast.toString(this.constantValue))}"`;
181
182
183
asBoolean () {
@@ -205,6 +205,8 @@ class ConstantInput {
205
206
207
asUnknown () {
208
+ if (Array.isArray(this.constantValue)) return this.asArray();
209
+ if (typeof this.constantValue === 'object') return this.asObject();
210
// Attempt to convert strings to numbers if it is unlikely to break things
211
if (typeof this.constantValue === 'number') {
212
// todo: handle NaN?
0 commit comments