@@ -1678,31 +1678,11 @@ bool js::temporal::GetMethodForCall(JSContext* cx, Handle<JSObject*> object,
1678
1678
1679
1679
1680
1680
1681
- PlainObject* js::temporal::CopyOptions (JSContext* cx,
1682
- JS::Handle <JSObject*> options) {
1683
-
1684
- Rooted<PlainObject*> optionsCopy (cx, NewPlainObjectWithProto (cx, nullptr ));
1685
- if (!optionsCopy) {
1686
- return nullptr ;
1687
- }
1688
-
1689
-
1690
- if (!CopyDataProperties (cx, optionsCopy, options)) {
1691
- return nullptr ;
1692
- }
1693
-
1694
-
1695
- return optionsCopy;
1696
- }
1697
-
1698
-
1699
-
1700
-
1701
1681
1702
1682
1703
1683
bool js::temporal::CopyDataProperties (JSContext* cx,
1704
- JS:: Handle <PlainObject*> target,
1705
- JS:: Handle <JSObject*> source) {
1684
+ Handle <PlainObject*> target,
1685
+ Handle <JSObject*> source) {
1706
1686
1707
1687
if (source->is <NativeObject>()) {
1708
1688
bool optimized = false ;
@@ -1765,9 +1745,9 @@ bool js::temporal::CopyDataProperties(JSContext* cx,
1765
1745
1766
1746
1767
1747
1768
- bool js::temporal:: CopyDataPropertiesIgnoreUndefined (
1769
- JSContext* cx, JS:: Handle <PlainObject*> target,
1770
- JS:: Handle <JSObject*> source) {
1748
+ static bool CopyDataPropertiesIgnoreUndefined (JSContext* cx,
1749
+ Handle <PlainObject*> target,
1750
+ Handle <JSObject*> source) {
1771
1751
1772
1752
1773
1753
@@ -1818,6 +1798,49 @@ bool js::temporal::CopyDataPropertiesIgnoreUndefined(
1818
1798
1819
1799
1820
1800
1801
+ PlainObject* js::temporal::SnapshotOwnProperties (JSContext* cx,
1802
+ Handle <JSObject*> source) {
1803
+
1804
+ Rooted<PlainObject*> copy (cx, NewPlainObjectWithProto (cx, nullptr ));
1805
+ if (!copy) {
1806
+ return nullptr ;
1807
+ }
1808
+
1809
+
1810
+ if (!CopyDataProperties (cx, copy, source)) {
1811
+ return nullptr ;
1812
+ }
1813
+
1814
+
1815
+ return copy;
1816
+ }
1817
+
1818
+
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+ PlainObject* js::temporal::SnapshotOwnPropertiesIgnoreUndefined (
1825
+ JSContext* cx, Handle <JSObject*> source) {
1826
+
1827
+ Rooted<PlainObject*> copy (cx, NewPlainObjectWithProto (cx, nullptr ));
1828
+ if (!copy) {
1829
+ return nullptr ;
1830
+ }
1831
+
1832
+
1833
+ if (!CopyDataPropertiesIgnoreUndefined (cx, copy, source)) {
1834
+ return nullptr ;
1835
+ }
1836
+
1837
+
1838
+ return copy;
1839
+ }
1840
+
1841
+
1842
+
1843
+
1821
1844
1822
1845
bool js::temporal::GetDifferenceSettings (
1823
1846
JSContext* cx, TemporalDifference operation, Handle <JSObject*> options,
0 commit comments