Shader builder / typecheck fix for parse fn

This commit is contained in:
Olivier Guyot
2019-09-26 16:20:15 +02:00
parent 858f0fc0cc
commit 09134a6091

View File

@@ -201,8 +201,10 @@ export function parse(value, attributes, attributePrefix) {
case 'stretch': return `(clamp(${p(v[1])}, ${p(v[2])}, ${p(v[3])}) * ((${p(v[5])} - ${p(v[4])}) / (${p(v[3])} - ${p(v[2])})) + ${p(v[4])})`;
default: throw new Error('Unrecognized literal style expression: ' + JSON.stringify(value));
}
} else {
} else if (typeof value === 'number') {
return formatNumber(value);
} else {
throw new Error('Invalid value type in expression: ' + JSON.stringify(value));
}
}