* Returns result expression. * @param {(string | { expr: string })[]} args args (len >= 2) * @returns {string} result expression * @private
(args)
| 344 | * @private |
| 345 | */ |
| 346 | _es5Concatenation(args) { |
| 347 | const str = args |
| 348 | .map((arg) => (typeof arg === "string" ? JSON.stringify(arg) : arg.expr)) |
| 349 | .join(" + "); |
| 350 | |
| 351 | // when the first two args are expression, we need to prepend "" + to force string |
| 352 | // concatenation instead of number addition. |
| 353 | return typeof args[0] !== "string" && typeof args[1] !== "string" |
| 354 | ? `"" + ${str}` |
| 355 | : str; |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * Expression function. |