* Renders an object-literal method, using method shorthand when supported * and falling back to a `prop: function/arrow` property otherwise. * @param {string} prop property name (or computed key like `[x]`) * @param {string} args arguments * @param {string | string[]} body body * @returns
(prop, args, body)
| 414 | * @returns {string} method code |
| 415 | */ |
| 416 | method(prop, args, body) { |
| 417 | return this.supportsMethodShorthand() |
| 418 | ? `${prop}(${args}) {\n${Template.indent(body)}\n}` |
| 419 | : `${prop}: ${this.basicFunction(args, body)}`; |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Returns an own-property check, using `Object.hasOwn` when supported and |
no test coverage detected