writes the copy of data's props: an array's copy has only its enumerable props
( js: NodeCompiler, from: string, to: string )
| 1354 | |
| 1355 | /** writes the copy of data's props: an array's copy has only its enumerable props */ |
| 1356 | private jsCopyProps( |
| 1357 | js: NodeCompiler, |
| 1358 | from: string, |
| 1359 | to: string |
| 1360 | ): NodeCompiler { |
| 1361 | for (const prop of this.inOrder) { |
| 1362 | js.if( |
| 1363 | `Object.prototype.hasOwnProperty.call(${from}, ${js.serialize(prop.key)})`, |
| 1364 | () => |
| 1365 | js.line(jsSetOwnProp(js, to, prop.key, `${from}${js.prop(prop.key)}`)) |
| 1366 | ) |
| 1367 | } |
| 1368 | return js |
| 1369 | } |
| 1370 | |
| 1371 | /** writes the defaults of a sequence's missing elements */ |
| 1372 | private jsSequenceDefaults(js: NodeCompiler): void { |