MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / copy

Method copy

projects/JavaScript/proto/test.js:1597–1852  ·  view source on GitHub ↗

* Copy struct (shallow copy) * @this {!StructSimple} * @param {!StructSimple} other Other struct * @returns {!StructSimple} This struct

(other)

Source from the content-addressed store, hash-verified

1595 * @returns {!StructSimple} This struct
1596 */
1597 copy (other) {
1598 if (other.id != null) {
1599 this.id = other.id
1600 } else {
1601 this.id = undefined
1602 }
1603 if (other.f1 != null) {
1604 this.f1 = other.f1
1605 } else {
1606 this.f1 = undefined
1607 }
1608 if (other.f2 != null) {
1609 this.f2 = other.f2
1610 } else {
1611 this.f2 = undefined
1612 }
1613 if (other.f3 != null) {
1614 this.f3 = other.f3
1615 } else {
1616 this.f3 = undefined
1617 }
1618 if (other.f4 != null) {
1619 this.f4 = other.f4
1620 } else {
1621 this.f4 = undefined
1622 }
1623 if (other.f5 != null) {
1624 if ((typeof other.f5 === 'string') || (other.f5 instanceof String)) {
1625 this.f5 = other.f5
1626 } else {
1627 this.f5 = String.fromCharCode(other.f5)
1628 }
1629 } else {
1630 this.f5 = undefined
1631 }
1632 if (other.f6 != null) {
1633 if ((typeof other.f6 === 'string') || (other.f6 instanceof String)) {
1634 this.f6 = other.f6
1635 } else {
1636 this.f6 = String.fromCharCode(other.f6)
1637 }
1638 } else {
1639 this.f6 = undefined
1640 }
1641 if (other.f7 != null) {
1642 if ((typeof other.f7 === 'string') || (other.f7 instanceof String)) {
1643 this.f7 = other.f7
1644 } else {
1645 this.f7 = String.fromCharCode(other.f7)
1646 }
1647 } else {
1648 this.f7 = undefined
1649 }
1650 if (other.f8 != null) {
1651 if ((typeof other.f8 === 'string') || (other.f8 instanceof String)) {
1652 this.f8 = other.f8
1653 } else {
1654 this.f8 = String.fromCharCode(other.f8)

Callers

nothing calls this directly

Calls 2

fromNumberMethod · 0.45
fromObjectMethod · 0.45

Tested by

no test coverage detected