@@ -826,30 +826,30 @@ describe("Float16Array", () => {
826
826
} ) ;
827
827
} ) ;
828
828
829
- describe ( "#withAt ()" , ( ) => {
830
- it ( "property `name` is 'withAt '" , ( ) => {
831
- assert ( Float16Array . prototype . withAt . name === "withAt " ) ;
829
+ describe ( "#with ()" , ( ) => {
830
+ it ( "property `name` is 'with '" , ( ) => {
831
+ assert ( Float16Array . prototype . with . name === "with " ) ;
832
832
} ) ;
833
833
834
834
it ( "property `length` is 1" , ( ) => {
835
- assert ( Float16Array . prototype . withAt . length === 2 ) ;
835
+ assert ( Float16Array . prototype . with . length === 2 ) ;
836
836
} ) ;
837
837
838
- it ( "withAt " , ( ) => {
838
+ it ( "with " , ( ) => {
839
839
const float16_1 = new Float16Array ( [ 1 , 2 , 3 ] ) ;
840
- const float16_2 = float16_1 . withAt ( 1 , 4 ) ;
840
+ const float16_2 = float16_1 . with ( 1 , 4 ) ;
841
841
842
842
assert ( float16_1 . buffer !== float16_2 . buffer ) ;
843
843
assert . equalFloat16ArrayValues ( float16_1 , [ 1 , 2 , 3 ] ) ;
844
844
assert . equalFloat16ArrayValues ( float16_2 , [ 1 , 4 , 3 ] ) ;
845
845
846
- const float16_3 = float16_1 . withAt ( - 1 , 4 ) ;
846
+ const float16_3 = float16_1 . with ( - 1 , 4 ) ;
847
847
848
848
assert ( float16_1 . buffer !== float16_3 . buffer ) ;
849
849
assert . equalFloat16ArrayValues ( float16_1 , [ 1 , 2 , 3 ] ) ;
850
850
assert . equalFloat16ArrayValues ( float16_3 , [ 1 , 2 , 4 ] ) ;
851
851
852
- const float16_4 = float16_1 . withAt ( 0 , "aaa" ) ;
852
+ const float16_4 = float16_1 . with ( 0 , "aaa" ) ;
853
853
854
854
assert ( float16_1 . buffer !== float16_4 . buffer ) ;
855
855
assert . equalFloat16ArrayValues ( float16_1 , [ 1 , 2 , 3 ] ) ;
@@ -861,20 +861,20 @@ describe("Float16Array", () => {
861
861
862
862
// out of range
863
863
assert . throws ( ( ) => {
864
- float16 . withAt ( 5 , 0 ) ;
864
+ float16 . with ( 5 , 0 ) ;
865
865
} , RangeError ) ;
866
866
assert . throws ( ( ) => {
867
- float16 . withAt ( - 5 , 0 ) ;
867
+ float16 . with ( - 5 , 0 ) ;
868
868
} , RangeError ) ;
869
869
870
870
assert . throws ( ( ) => {
871
- float16 . withAt ( Symbol ( ) , 0 ) ;
871
+ float16 . with ( Symbol ( ) , 0 ) ;
872
872
} , TypeError ) ;
873
873
874
874
// Safari 13 doesn't have BigInt
875
875
if ( typeof BigInt !== "undefined" ) {
876
876
assert . throws ( ( ) => {
877
- float16 . withAt ( BigInt ( 0 ) , 0 ) ;
877
+ float16 . with ( BigInt ( 0 ) , 0 ) ;
878
878
} , TypeError ) ;
879
879
}
880
880
} ) ;
@@ -1490,18 +1490,18 @@ describe("Float16Array", () => {
1490
1490
} ) ;
1491
1491
} ) ;
1492
1492
1493
- describe ( "#withReversed ()" , ( ) => {
1493
+ describe ( "#toReversed ()" , ( ) => {
1494
1494
it ( "property `name` is 'reverse'" , ( ) => {
1495
- assert ( Float16Array . prototype . withReversed . name === "withReversed " ) ;
1495
+ assert ( Float16Array . prototype . toReversed . name === "toReversed " ) ;
1496
1496
} ) ;
1497
1497
1498
1498
it ( "property `length` is 0" , ( ) => {
1499
- assert ( Float16Array . prototype . withReversed . length === 0 ) ;
1499
+ assert ( Float16Array . prototype . toReversed . length === 0 ) ;
1500
1500
} ) ;
1501
1501
1502
- it ( "withReversed " , ( ) => {
1502
+ it ( "toReversed " , ( ) => {
1503
1503
const float16_1 = new Float16Array ( [ 1 , 2 , 3 ] ) ;
1504
- const float16_2 = float16_1 . withReversed ( ) ;
1504
+ const float16_2 = float16_1 . toReversed ( ) ;
1505
1505
1506
1506
assert ( float16_1 . buffer !== float16_2 . buffer ) ;
1507
1507
assert . equalFloat16ArrayValues ( float16_1 , [ 1 , 2 , 3 ] ) ;
@@ -1611,13 +1611,13 @@ describe("Float16Array", () => {
1611
1611
} ) ;
1612
1612
} ) ;
1613
1613
1614
- describe ( "#withSorted ()" , ( ) => {
1615
- it ( "property `name` is 'withSorted '" , ( ) => {
1616
- assert ( Float16Array . prototype . withSorted . name === "withSorted " ) ;
1614
+ describe ( "#toSorted ()" , ( ) => {
1615
+ it ( "property `name` is 'toSorted '" , ( ) => {
1616
+ assert ( Float16Array . prototype . toSorted . name === "toSorted " ) ;
1617
1617
} ) ;
1618
1618
1619
1619
it ( "property `length` is 0" , ( ) => {
1620
- assert ( Float16Array . prototype . withSorted . length === 0 ) ;
1620
+ assert ( Float16Array . prototype . toSorted . length === 0 ) ;
1621
1621
} ) ;
1622
1622
1623
1623
it ( "check default compare" , ( ) => {
@@ -1632,7 +1632,7 @@ describe("Float16Array", () => {
1632
1632
Infinity ,
1633
1633
- Infinity ,
1634
1634
] ) ;
1635
- const float16_2 = float16_1 . withSorted ( ) ;
1635
+ const float16_2 = float16_1 . toSorted ( ) ;
1636
1636
1637
1637
assert ( float16_1 . buffer !== float16_2 . buffer ) ;
1638
1638
assert . equalFloat16ArrayValues ( float16_1 , [
@@ -1661,7 +1661,7 @@ describe("Float16Array", () => {
1661
1661
1662
1662
it ( "check custom compare" , ( ) => {
1663
1663
const float16_1 = new Float16Array ( [ 1 , 2 , - 1 , - 2 , Infinity , - Infinity ] ) ;
1664
- const float16_2 = float16_1 . withSorted ( ( x , y ) => y - x ) ;
1664
+ const float16_2 = float16_1 . toSorted ( ( x , y ) => y - x ) ;
1665
1665
1666
1666
assert ( float16_1 . buffer !== float16_2 . buffer ) ;
1667
1667
assert . equalFloat16ArrayValues ( float16_1 , [
@@ -1809,43 +1809,43 @@ describe("Float16Array", () => {
1809
1809
} ) ;
1810
1810
} ) ;
1811
1811
1812
- describe ( "#withSpliced ()" , ( ) => {
1813
- it ( "property `name` is 'withSpliced '" , ( ) => {
1814
- assert ( Float16Array . prototype . withSpliced . name === "withSpliced " ) ;
1812
+ describe ( "#toSpliced ()" , ( ) => {
1813
+ it ( "property `name` is 'toSpliced '" , ( ) => {
1814
+ assert ( Float16Array . prototype . toSpliced . name === "toSpliced " ) ;
1815
1815
} ) ;
1816
1816
1817
1817
it ( "property `length` is 0" , ( ) => {
1818
- assert ( Float16Array . prototype . withSpliced . length === 0 ) ;
1818
+ assert ( Float16Array . prototype . toSpliced . length === 0 ) ;
1819
1819
} ) ;
1820
1820
1821
1821
it ( "get spliced Array" , ( ) => {
1822
1822
const float16_1 = new Float16Array ( [ 1 , 2 , 3 ] ) ;
1823
- const float16_2 = float16_1 . withSpliced ( ) ;
1823
+ const float16_2 = float16_1 . toSpliced ( ) ;
1824
1824
1825
1825
assert ( float16_1 . buffer !== float16_2 . buffer ) ;
1826
1826
assert . equalFloat16ArrayValues ( float16_1 , float16_2 ) ;
1827
1827
1828
- const float16_3 = float16_1 . withSpliced ( 1 ) ;
1828
+ const float16_3 = float16_1 . toSpliced ( 1 ) ;
1829
1829
1830
1830
assert ( float16_1 . buffer !== float16_3 . buffer ) ;
1831
1831
assert . equalFloat16ArrayValues ( float16_3 , [ 1 ] ) ;
1832
1832
1833
- const float16_4 = float16_1 . withSpliced ( 1 , - 1 ) ;
1833
+ const float16_4 = float16_1 . toSpliced ( 1 , - 1 ) ;
1834
1834
1835
1835
assert ( float16_1 . buffer !== float16_4 . buffer ) ;
1836
1836
assert . equalFloat16ArrayValues ( float16_4 , [ 1 , 2 , 3 ] ) ;
1837
1837
1838
- const float16_5 = float16_1 . withSpliced ( 1 , 10 ) ;
1838
+ const float16_5 = float16_1 . toSpliced ( 1 , 10 ) ;
1839
1839
1840
1840
assert ( float16_1 . buffer !== float16_5 . buffer ) ;
1841
1841
assert . equalFloat16ArrayValues ( float16_5 , [ 1 ] ) ;
1842
1842
1843
- const float16_6 = float16_1 . withSpliced ( 1 , 1 ) ;
1843
+ const float16_6 = float16_1 . toSpliced ( 1 , 1 ) ;
1844
1844
1845
1845
assert ( float16_1 . buffer !== float16_6 . buffer ) ;
1846
1846
assert . equalFloat16ArrayValues ( float16_6 , [ 1 , 3 ] ) ;
1847
1847
1848
- const float16_7 = float16_1 . withSpliced ( 1 , 1 , 5 , 6 ) ;
1848
+ const float16_7 = float16_1 . toSpliced ( 1 , 1 , 5 , 6 ) ;
1849
1849
1850
1850
assert ( float16_1 . buffer !== float16_7 . buffer ) ;
1851
1851
assert . equalFloat16ArrayValues ( float16_7 , [ 1 , 5 , 6 , 3 ] ) ;
0 commit comments