Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 97x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 893x 893x 893x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 212x 212x 212x 212x 212x 212x 212x 5x 5x 5x 5x 5x 5x 5x 207x 207x 212x 190x 190x 190x 190x 190x 190x 190x 190x 210x 17x 17x 207x 212x 57x 57x 36x 36x 36x 57x 57x 57x 57x 57x 207x 212x 95x 95x 207x 207x 212x 14x 14x 1x 14x 11x 11x 14x 207x 207x 212x 212x 212x 212x 212x 212x 4x 4x 4x 212x 212x 212x 4x 4x 4x 212x 212x 212x 212x 212x 212x 212x 212x 4x 4x 4x 212x 212x 212x 4x 4x 4x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 1x 1x 1x 1x 206x 212x 67x 67x 67x 212x 79x 79x 79x 79x 20x 20x 20x 20x 4x 4x 4x 4x 4x 4x 4x 79x 79x 79x 206x 206x 206x 206x 206x 206x 206x 206x 206x 212x 212x 212x 212x 212x 212x 212x 212x 29x 29x 212x 212x 29x 29x 29x 29x 29x 2x 2x 2x 2x 2x 2x 2x 2x 27x 29x 212x 212x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 743x 31x 31x 31x 743x 743x 743x 743x 38x 3x 3x 38x 38x 38x 38x 29x 29x 29x 29x 38x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 6x 6x 6x 7x 7x 7x 1x 1x 1x 7x 38x 743x 743x 743x 743x 709x 709x 702x 702x 702x 702x 702x 702x 702x 2x 2x 702x 713x 713x 713x 30x 30x 30x 30x 713x 713x 713x 713x 5x 5x 5x 713x 713x 165x 165x 11x 11x 11x 11x 11x 11x 11x 154x 165x 165x 165x 25x 25x 165x 702x 702x 702x 709x 709x 709x 709x 709x 709x 709x 709x 654x 654x 654x 654x 654x 654x 5886x 5886x 654x 654x 654x 709x 721x 548x 548x 548x 186x 186x 186x 186x 186x 186x 548x 548x 548x 548x 548x 548x 548x 548x 548x 216x 548x 332x 332x 548x 545x 183x 183x 183x 183x 183x 183x 183x 545x 548x 51x 51x 51x 51x 51x 51x 51x 51x 51x 494x 548x 29x 29x 29x 29x 29x 29x 1x 1x 1x 1x 1x 29x 29x 29x 29x 29x 29x 29x 29x 29x 28x 29x 1x 1x 1x 1x 1x 1x 29x 29x 29x 29x 29x 29x 29x 548x 655x 743x 626x 626x 743x 212x 212x 212x 212x 87x 87x 87x 87x 84x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 4x 4x 52x 52x 84x 84x 84x 84x 6x 6x 6x 84x 84x 82x 82x 30x 30x 30x 30x 30x 30x 30x 30x 1x 1x 1x 1x 1x 1x 1x 82x 6x 6x 6x 6x 6x 6x 82x 82x 82x 82x 82x 56x 56x 82x 84x 87x 87x 86x 86x 87x 87x 87x 1x 1x 1x 1x 1x 1x 86x 86x 5x 5x 86x 86x 86x 86x 86x 405x 405x 81x 81x 81x 81x 405x 324x 324x 86x 86x 5x 5x 5x 86x 86x 86x 86x 86x 86x 86x 212x 212x 212x 212x 212x 541x 541x 541x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 212x 204x 204x 204x 204x 67x 67x 67x 8x 67x 67x 67x 67x 67x 67x 67x 204x 206x 206x 116x 116x 113x 113x 113x 3x 116x 206x 206x 161x 2x 2x 2x 159x 206x 206x 206x 206x 206x 206x 7x 1x 1x 1x 1x 1x 6x 6x 6x 6x 6x 6x 7x 1x 1x 1x 1x 1x 6x 5x 5x 6x 6x 6x 6x 206x 206x 206x 1002x 1002x 1002x 1002x 1002x 56x 56x 56x 56x 56x 56x 4x 4x 4x 4x 4x 56x 56x 56x 946x 946x 946x 946x 946x 946x 966x 886x 886x 886x 116x 116x 116x 116x 113x 113x 9x 2x 2x 2x 2x 116x 886x 831x 831x 831x 831x 831x 831x 831x 770x 770x 770x 770x 770x 1x 1x 1x 1x 1x 1x 769x 769x 770x 165x 136x 136x 136x 136x 136x 136x 136x 136x 165x 165x 633x 633x 633x 633x 633x 633x 707x 604x 604x 604x 770x 770x 473x 461x 461x 473x 473x 633x 633x 633x 707x 604x 604x 770x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 206x 7461x 7461x 7461x 7282x 7282x 7282x 40x 40x 7282x 7282x 7255x 7255x 7250x 7250x 7255x 7282x 7282x 179x 179x 7461x 9x 9x 9x 9x 7x 7x 7x 7x 9x 9x 9x 2x 9x 326x 170x 170x 170x 170x 1x 1x 1x 1x 170x 169x 170x 170x 206x 206x 206x 212x 2x 2x 2x 2x 2x 197x 197x 197x 197x 2x 2x 78x 2x 2x 2x 999x 2x 2x 2x 165x 18x 18x 18x 18x 18x 18x 18x 147x 144x 147x 2x 2x 2x 272x 272x 70x 269x 202x 202x 202x 202x 202x 202x 202x 202x 202x 202x 22967x 22967x 10443x 10443x 10443x 10443x 10443x 10443x 202x 202x 202x 202x 202x 202x 202x 202x 202x 202x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 272x 2x 2x 2x 270x 270x 270x 270x 270x 270x 270x 270x 270x 270x 270x 270x 5x 5x 4x 4x 4x 5x 270x 270x 270x 270x 270x 270x 270x 1x 1x 1x 1x 1x 1x 1x 270x 270x 270x 270x 2x 2x 2x 1239x 1239x 137x 137x 137x 137x 137x 1239x 1239x 1239x 1239x 2x 2x 2x 2x 227x 227x 2x 2x 2x 2x 2x 2x 2x 2x 2x 25024x 25024x 25024x 25024x 2x 2x 25024x 25024x 230476x 230476x 1x 1x 230476x 230476x 25021x 25024x 2x 2472x 2472x 2472x 2472x 2472x 2472x 2472x 2x 556x 556x 556x 556x 556x 556x 556x 207x 207x 206x 206x 206x 207x 556x 556x 556x 556x 556x 2x 162x 162x 162x 162x 162x 162x 162x 162x 162x 162x 162x 2x 2x 129x 2x 2x 1324x 1324x 1324x 1324x 129x 129x 1324x 2x 10x 10x 10x 10x 10x 10x 8x 8x 8x 8x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 541x 541x 541x 541x 541x 541x 541x 541x 541x 541x 541x 541x 541x 1x 1x 1x 1x 1x 541x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 2x 23x 2x 21x 12x 19x 7x 7x 23x 23x 96x 96x 96x 24528x 24528x 64x 64x 64x 24464x 24464x 24528x 23868x 23868x 23626x 23626x 23868x 23868x 596x 596x 596x 24528x 24528x 24528x 501x 501x 96x 23x 23x 23x 23x 23x 23x 23x 540x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 23x 2x 23x 2x 21x 12x 19x 7x 7x 23x 23x 75x 75x 75x 75x 24528x 24528x 24528x 64x 64x 64x 24464x 24528x 23868x 23868x 23786x 23786x 23868x 23868x 596x 596x 24528x 539x 539x 539x 1673x 539x 497x 497x 539x 75x 23x 23x 23x 23x 23x 23x 23x 23x 517x 494x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 494x 484x 267x 267x 43x 43x 43x 224x 224x 259x 23x 259x 197x 197x 197x 197x 224x 224x 259x 162x 162x 162x 162x 162x 253x 253x 253x 162x 162x 71x 71x 71x 71x 71x 162x 162x 162x 162x 162x 62x 62x 182x 3x 3x 3x 62x 62x 62x 62x 62x 62x 62x 62x 43x 43x 62x 19x 19x 47x 47x 62x 98x 98x 98x 62x 15x 15x 15x 15x 15x 62x 62x 47x 47x 140x 140x 140x 47x 47x 28x 28x 47x 62x 62x 62x 62x 62x 274x 274x 274x 274x 274x 274x 541x 541x 229x 229x 229x 926x 89992x 89992x 89992x 89992x 89992x 89992x 926x 926x 325x 325x 229x 229x 229x 541x 541x 541x 541x 541x 541x 541x 541x 423x 423x 423x 50897x 50747x 50747x 50747x 423x 423x 423x 406x 406x 541x 541x 541x 541x 255x 255x 541x 541x 541x 541x 2x 2x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 2x 2x 2x 1339x 32x 1339x 1307x 1307x 1339x 2x 2x 2x 2x 2x 826x 826x 826x 826x 826x 826x 826x 767x 767x 826x 59x 59x 59x 826x 826x 59x 59x 59x 767x 767x 767x 767x 767x 1534x 1534x 1534x 767x 767x 767x 767x 767x 767x 767x 767x 826x 826x 2x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 158x 2x 16x 16x 16x 16x 2x 17x 17x 17x 17x 2x 206x 206x 206x 206x 5x 5x 5x 206x 206x 206x 206x 69x 204x 137x 137x 206x 206x 206x 62x 62x 61x 61x 61x 62x 62x 206x 206x 206x 206x 206x 20x 20x 206x 206x 206x 206x 206x 2x 2x 2x 2x 2x 15x 15x 15x 15x 15x 2x 2x 2x 2x 2x 206x 206x 206x 206x 206x 3x 3x 3x 3x 1x 1x 3x 3x 206x 206x 206x 206x 206x 6x 6x 6x 4x 4x 4x 4x 4x 4x 1x 1x 1x 1x 6x 1x 1x 6x 6x 206x 206x 70x 70x 70x 12x 12x 12x 12x 70x 70x 206x 2x 136x 136x 136x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x | // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. /* A REPL library that you can include in your own code to get a runtime * interface to your program. * * const repl = require("repl"); * // start repl on stdin * repl.start("prompt> "); * * // listen for unix socket connections and start repl on them * net.createServer(function(socket) { * repl.start("node via Unix socket> ", socket); * }).listen("/tmp/node-repl-sock"); * * // listen for TCP socket connections and start repl on them * net.createServer(function(socket) { * repl.start("node via TCP socket> ", socket); * }).listen(5001); * * // expose foo to repl context * repl.start("node > ").context.foo = "stdin is fun"; */ 'use strict'; const { ArrayPrototypeConcat, ArrayPrototypeFilter, ArrayPrototypeFindIndex, ArrayPrototypeForEach, ArrayPrototypeIncludes, ArrayPrototypeJoin, ArrayPrototypeMap, ArrayPrototypePop, ArrayPrototypePush, ArrayPrototypeReverse, ArrayPrototypeShift, ArrayPrototypeSlice, ArrayPrototypeSome, ArrayPrototypeSort, ArrayPrototypeSplice, ArrayPrototypeUnshift, Boolean, Error, FunctionPrototypeBind, MathMaxApply, NumberIsNaN, NumberParseFloat, ObjectAssign, ObjectCreate, ObjectDefineProperty, ObjectGetOwnPropertyDescriptor, ObjectGetOwnPropertyNames, ObjectGetPrototypeOf, ObjectKeys, ObjectSetPrototypeOf, Promise, PromiseRace, ReflectApply, RegExp, RegExpPrototypeExec, RegExpPrototypeSymbolReplace, RegExpPrototypeSymbolSplit, SafeSet, SafeWeakSet, StringPrototypeCharAt, StringPrototypeCodePointAt, StringPrototypeEndsWith, StringPrototypeIncludes, StringPrototypeRepeat, StringPrototypeSlice, StringPrototypeSplit, StringPrototypeStartsWith, StringPrototypeTrim, StringPrototypeTrimLeft, StringPrototypeToLocaleLowerCase, Symbol, SyntaxError, SyntaxErrorPrototype, globalThis, } = primordials; const { NativeModule } = require('internal/bootstrap/loaders'); const { makeRequireFunction, addBuiltinLibsToObject } = require('internal/modules/cjs/helpers'); const { isIdentifierStart, isIdentifierChar } = require('internal/deps/acorn/acorn/dist/acorn'); const { decorateErrorStack, isError, deprecate } = require('internal/util'); const { inspect } = require('internal/util/inspect'); const vm = require('vm'); const path = require('path'); const fs = require('fs'); const { Interface } = require('readline'); const { commonPrefix } = require('internal/readline/utils'); const { Console } = require('console'); const CJSModule = require('internal/modules/cjs/loader').Module; let _builtinLibs = ArrayPrototypeFilter( CJSModule.builtinModules, (e) => !StringPrototypeStartsWith(e, '_'), ); const nodeSchemeBuiltinLibs = ArrayPrototypeMap( _builtinLibs, (lib) => `node:${lib}`); ArrayPrototypeForEach( NativeModule.getSchemeOnlyModuleNames(), (lib) => ArrayPrototypePush(nodeSchemeBuiltinLibs, `node:${lib}`), ); const domain = require('domain'); let debug = require('internal/util/debuglog').debuglog('repl', (fn) => { debug = fn; }); const { codes: { ERR_CANNOT_WATCH_SIGINT, ERR_INVALID_REPL_EVAL_CONFIG, ERR_INVALID_REPL_INPUT, ERR_SCRIPT_EXECUTION_INTERRUPTED, }, isErrorStackTraceLimitWritable, overrideStackTrace, } = require('internal/errors'); const { sendInspectorCommand } = require('internal/util/inspector'); const { getOptionValue } = require('internal/options'); const { validateFunction, validateObject, } = require('internal/validators'); const experimentalREPLAwait = getOptionValue( '--experimental-repl-await' ); const pendingDeprecation = getOptionValue('--pending-deprecation'); const { REPL_MODE_SLOPPY, REPL_MODE_STRICT, isRecoverableError, kStandaloneREPL, setupPreview, setupReverseSearch, } = require('internal/repl/utils'); const { getOwnNonIndexProperties, propertyFilter: { ALL_PROPERTIES, SKIP_SYMBOLS } } = internalBinding('util'); const { startSigintWatchdog, stopSigintWatchdog } = internalBinding('contextify'); const history = require('internal/repl/history'); const { extensionFormatMap, legacyExtensionFormatMap, } = require('internal/modules/esm/formats'); let nextREPLResourceNumber = 1; // This prevents v8 code cache from getting confused and using a different // cache from a resource of the same name function getREPLResourceName() { return `REPL${nextREPLResourceNumber++}`; } // Lazy-loaded. let processTopLevelAwait; const globalBuiltins = new SafeSet(vm.runInNewContext('Object.getOwnPropertyNames(globalThis)')); const parentModule = module; const domainSet = new SafeWeakSet(); const kBufferedCommandSymbol = Symbol('bufferedCommand'); const kContextId = Symbol('contextId'); let addedNewListener = false; try { // Hack for require.resolve("./relative") to work properly. module.filename = path.resolve('repl'); } catch { // path.resolve('repl') fails when the current working directory has been // deleted. Fall back to the directory name of the (absolute) executable // path. It's not really correct but what are the alternatives? const dirname = path.dirname(process.execPath); module.filename = path.resolve(dirname, 'repl'); } // Hack for repl require to work properly with node_modules folders module.paths = CJSModule._nodeModulePaths(module.filename); // This is the default "writer" value, if none is passed in the REPL options, // and it can be overridden by custom print functions, such as `probe` or // `eyes.js`. const writer = (obj) => inspect(obj, writer.options); writer.options = { ...inspect.defaultOptions, showProxy: true }; function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined, replMode) { if (!(this instanceof REPLServer)) { return new REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined, replMode); } let options; if (prompt !== null && typeof prompt === 'object') { // An options object was given. options = { ...prompt }; stream = options.stream || options.socket; eval_ = options.eval; useGlobal = options.useGlobal; ignoreUndefined = options.ignoreUndefined; prompt = options.prompt; replMode = options.replMode; } else { options = {}; } if (!options.input && !options.output) { // Legacy API, passing a 'stream'/'socket' option. if (!stream) { // Use stdin and stdout as the default streams if none were given. stream = process; } // We're given a duplex readable/writable Stream, like a `net.Socket` // or a custom object with 2 streams, or the `process` object. options.input = stream.stdin || stream; options.output = stream.stdout || stream; } if (options.terminal === undefined) { options.terminal = options.output.isTTY; } options.terminal = !!options.terminal; if (options.terminal && options.useColors === undefined) { // If possible, check if stdout supports colors or not. if (options.output.hasColors) { options.useColors = options.output.hasColors(); } else if (process.env.NODE_DISABLE_COLORS === undefined) { options.useColors = true; } } // TODO(devsnek): Add a test case for custom eval functions. const preview = options.terminal && (options.preview !== undefined ? !!options.preview : !eval_); ObjectDefineProperty(this, 'inputStream', { __proto__: null, get: pendingDeprecation ? deprecate(() => this.input, 'repl.inputStream and repl.outputStream are deprecated. ' + 'Use repl.input and repl.output instead', 'DEP0141') : () => this.input, set: pendingDeprecation ? deprecate((val) => this.input = val, 'repl.inputStream and repl.outputStream are deprecated. ' + 'Use repl.input and repl.output instead', 'DEP0141') : (val) => this.input = val, enumerable: false, configurable: true }); ObjectDefineProperty(this, 'outputStream', { __proto__: null, get: pendingDeprecation ? deprecate(() => this.output, 'repl.inputStream and repl.outputStream are deprecated. ' + 'Use repl.input and repl.output instead', 'DEP0141') : () => this.output, set: pendingDeprecation ? deprecate((val) => this.output = val, 'repl.inputStream and repl.outputStream are deprecated. ' + 'Use repl.input and repl.output instead', 'DEP0141') : (val) => this.output = val, enumerable: false, configurable: true }); this.allowBlockingCompletions = !!options.allowBlockingCompletions; this.useColors = !!options.useColors; this._domain = options.domain || domain.create(); this.useGlobal = !!useGlobal; this.ignoreUndefined = !!ignoreUndefined; this.replMode = replMode || module.exports.REPL_MODE_SLOPPY; this.underscoreAssigned = false; this.last = undefined; this.underscoreErrAssigned = false; this.lastError = undefined; this.breakEvalOnSigint = !!options.breakEvalOnSigint; this.editorMode = false; // Context id for use with the inspector protocol. this[kContextId] = undefined; if (this.breakEvalOnSigint && eval_) { // Allowing this would not reflect user expectations. // breakEvalOnSigint affects only the behavior of the default eval(). throw new ERR_INVALID_REPL_EVAL_CONFIG(); } if (options[kStandaloneREPL]) { // It is possible to introspect the running REPL accessing this variable // from inside the REPL. This is useful for anyone working on the REPL. module.exports.repl = this; } else if (!addedNewListener) { // Add this listener only once and use a WeakSet that contains the REPLs // domains. Otherwise we'd have to add a single listener to each REPL // instance and that could trigger the `MaxListenersExceededWarning`. process.prependListener('newListener', (event, listener) => { if (event === 'uncaughtException' && process.domain && listener.name !== 'domainUncaughtExceptionClear' && domainSet.has(process.domain)) { // Throw an error so that the event will not be added and the current // domain takes over. That way the user is notified about the error // and the current code evaluation is stopped, just as any other code // that contains an error. throw new ERR_INVALID_REPL_INPUT( 'Listeners for `uncaughtException` cannot be used in the REPL'); } }); addedNewListener = true; } domainSet.add(this._domain); const savedRegExMatches = ['', '', '', '', '', '', '', '', '', '']; const sep = '\u0000\u0000\u0000'; const regExMatcher = new RegExp(`^${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` + `${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` + `${sep}(.*)$`); eval_ = eval_ || defaultEval; const self = this; // Pause taking in new input, and store the keys in a buffer. const pausedBuffer = []; let paused = false; function pause() { paused = true; } function unpause() { if (!paused) return; paused = false; let entry; const tmpCompletionEnabled = self.isCompletionEnabled; while ((entry = ArrayPrototypeShift(pausedBuffer)) !== undefined) { const { 0: type, 1: payload, 2: isCompletionEnabled } = entry; switch (type) { case 'key': { const { 0: d, 1: key } = payload; self.isCompletionEnabled = isCompletionEnabled; self._ttyWrite(d, key); break; } case 'close': self.emit('exit'); break; } if (paused) { break; } } self.isCompletionEnabled = tmpCompletionEnabled; } function defaultEval(code, context, file, cb) { const asyncESM = require('internal/process/esm_loader'); let result, script, wrappedErr; let err = null; let wrappedCmd = false; let awaitPromise = false; const input = code; // It's confusing for `{ a : 1 }` to be interpreted as a block // statement rather than an object literal. So, we first try // to wrap it in parentheses, so that it will be interpreted as // an expression. Note that if the above condition changes, // lib/internal/repl/utils.js needs to be changed to match. if (RegExpPrototypeExec(/^\s*{/, code) !== null && RegExpPrototypeExec(/;\s*$/, code) === null) { code = `(${StringPrototypeTrim(code)})\n`; wrappedCmd = true; } // `experimentalREPLAwait` is set to true by default. // Shall be false in case `--no-experimental-repl-await` flag is used. if (experimentalREPLAwait && StringPrototypeIncludes(code, 'await')) { if (processTopLevelAwait === undefined) { ({ processTopLevelAwait } = require('internal/repl/await')); } try { const potentialWrappedCode = processTopLevelAwait(code); if (potentialWrappedCode !== null) { code = potentialWrappedCode; wrappedCmd = true; awaitPromise = true; } } catch (e) { let recoverableError = false; if (e.name === 'SyntaxError') { let parentURL; try { const { pathToFileURL } = require('url'); // Adding `/repl` prevents dynamic imports from loading relative // to the parent of `process.cwd()`. parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href; } catch { // Continue regardless of error. } // Remove all "await"s and attempt running the script // in order to detect if error is truly non recoverable const fallbackCode = RegExpPrototypeSymbolReplace(/\bawait\b/g, code, ''); try { vm.createScript(fallbackCode, { filename: file, displayErrors: true, importModuleDynamically: (specifier, _, importAssertions) => { return asyncESM.esmLoader.import(specifier, parentURL, importAssertions); } }); } catch (fallbackError) { if (isRecoverableError(fallbackError, fallbackCode)) { recoverableError = true; err = new Recoverable(e); } } } if (!recoverableError) { decorateErrorStack(e); err = e; } } } // First, create the Script object to check the syntax if (code === '\n') return cb(null); if (err === null) { let parentURL; try { const { pathToFileURL } = require('url'); // Adding `/repl` prevents dynamic imports from loading relative // to the parent of `process.cwd()`. parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href; } catch { // Continue regardless of error. } while (true) { try { if (self.replMode === module.exports.REPL_MODE_STRICT && RegExpPrototypeExec(/^\s*$/, code) === null) { // "void 0" keeps the repl from returning "use strict" as the result // value for statements and declarations that don't return a value. code = `'use strict'; void 0;\n${code}`; } script = vm.createScript(code, { filename: file, displayErrors: true, importModuleDynamically: (specifier, _, importAssertions) => { return asyncESM.esmLoader.import(specifier, parentURL, importAssertions); } }); } catch (e) { debug('parse error %j', code, e); if (wrappedCmd) { // Unwrap and try again wrappedCmd = false; awaitPromise = false; code = input; wrappedErr = e; continue; } // Preserve original error for wrapped command const error = wrappedErr || e; if (isRecoverableError(error, code)) err = new Recoverable(error); else err = error; } break; } } // This will set the values from `savedRegExMatches` to corresponding // predefined RegExp properties `RegExp.$1`, `RegExp.$2` ... `RegExp.$9` RegExpPrototypeExec(regExMatcher, ArrayPrototypeJoin(savedRegExMatches, sep)); let finished = false; function finishExecution(err, result) { if (finished) return; finished = true; // After executing the current expression, store the values of RegExp // predefined properties back in `savedRegExMatches` for (let idx = 1; idx < savedRegExMatches.length; idx += 1) { savedRegExMatches[idx] = RegExp[`$${idx}`]; } cb(err, result); } if (!err) { // Unset raw mode during evaluation so that Ctrl+C raises a signal. let previouslyInRawMode; if (self.breakEvalOnSigint) { // Start the SIGINT watchdog before entering raw mode so that a very // quick Ctrl+C doesn't lead to aborting the process completely. if (!startSigintWatchdog()) throw new ERR_CANNOT_WATCH_SIGINT(); previouslyInRawMode = self._setRawMode(false); } try { try { const scriptOptions = { displayErrors: false, breakOnSigint: self.breakEvalOnSigint }; if (self.useGlobal) { result = script.runInThisContext(scriptOptions); } else { result = script.runInContext(context, scriptOptions); } } finally { if (self.breakEvalOnSigint) { // Reset terminal mode to its previous value. self._setRawMode(previouslyInRawMode); // Returns true if there were pending SIGINTs *after* the script // has terminated without being interrupted itself. if (stopSigintWatchdog()) { self.emit('SIGINT'); } } } } catch (e) { err = e; if (process.domain) { debug('not recoverable, send to domain'); process.domain.emit('error', err); process.domain.exit(); return; } } if (awaitPromise && !err) { let sigintListener; pause(); let promise = result; if (self.breakEvalOnSigint) { const interrupt = new Promise((resolve, reject) => { sigintListener = () => { const tmp = Error.stackTraceLimit; if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; const err = new ERR_SCRIPT_EXECUTION_INTERRUPTED(); if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = tmp; reject(err); }; prioritizedSigintQueue.add(sigintListener); }); promise = PromiseRace([promise, interrupt]); } (async () => { try { const result = await promise; finishExecution(null, result); } catch (err) { if (err && process.domain) { debug('not recoverable, send to domain'); process.domain.emit('error', err); process.domain.exit(); return; } finishExecution(err); } finally { // Remove prioritized SIGINT listener if it was not called. prioritizedSigintQueue.delete(sigintListener); unpause(); } })(); } } if (!awaitPromise || err) { finishExecution(err, result); } } self.eval = self._domain.bind(eval_); self._domain.on('error', function debugDomainError(e) { debug('domain error'); let errStack = ''; if (typeof e === 'object' && e !== null) { overrideStackTrace.set(e, (error, stackFrames) => { let frames; if (typeof stackFrames === 'object') { // Search from the bottom of the call stack to // find the first frame with a null function name const idx = ArrayPrototypeFindIndex( ArrayPrototypeReverse(stackFrames), (frame) => frame.getFunctionName() === null ); // If found, get rid of it and everything below it frames = ArrayPrototypeSplice(stackFrames, idx + 1); } else { frames = stackFrames; } // FIXME(devsnek): this is inconsistent with the checks // that the real prepareStackTrace dispatch uses in // lib/internal/errors.js. if (typeof Error.prepareStackTrace === 'function') { return Error.prepareStackTrace(error, frames); } ArrayPrototypePush(frames, error); return ArrayPrototypeJoin(ArrayPrototypeReverse(frames), '\n at '); }); decorateErrorStack(e); if (e.domainThrown) { delete e.domain; delete e.domainThrown; } if (isError(e)) { if (e.stack) { if (e.name === 'SyntaxError') { // Remove stack trace. e.stack = RegExpPrototypeSymbolReplace( /^\s+at\s.*\n?/gm, RegExpPrototypeSymbolReplace(/^REPL\d+:\d+\r?\n/, e.stack, ''), ''); const importErrorStr = 'Cannot use import statement outside a ' + 'module'; if (StringPrototypeIncludes(e.message, importErrorStr)) { e.message = 'Cannot use import statement inside the Node.js ' + 'REPL, alternatively use dynamic import'; e.stack = RegExpPrototypeSymbolReplace( /SyntaxError:.*\n/, e.stack, `SyntaxError: ${e.message}\n`); } } else if (self.replMode === module.exports.REPL_MODE_STRICT) { e.stack = RegExpPrototypeSymbolReplace( /(\s+at\s+REPL\d+:)(\d+)/, e.stack, (_, pre, line) => pre + (line - 1) ); } } errStack = self.writer(e); // Remove one line error braces to keep the old style in place. if (errStack[0] === '[' && errStack[errStack.length - 1] === ']') { errStack = StringPrototypeSlice(errStack, 1, -1); } } } if (!self.underscoreErrAssigned) { self.lastError = e; } if (options[kStandaloneREPL] && process.listenerCount('uncaughtException') !== 0) { process.nextTick(() => { process.emit('uncaughtException', e); self.clearBufferedCommand(); self.lines.level = []; self.displayPrompt(); }); } else { if (errStack === '') { errStack = self.writer(e); } const lines = RegExpPrototypeSymbolSplit(/(?<=\n)/, errStack); let matched = false; errStack = ''; ArrayPrototypeForEach(lines, (line) => { if (!matched && RegExpPrototypeExec(/^\[?([A-Z][a-z0-9_]*)*Error/, line) !== null) { errStack += writer.options.breakLength >= line.length ? `Uncaught ${line}` : `Uncaught:\n${line}`; matched = true; } else { errStack += line; } }); if (!matched) { const ln = lines.length === 1 ? ' ' : ':\n'; errStack = `Uncaught${ln}${errStack}`; } // Normalize line endings. errStack += StringPrototypeEndsWith(errStack, '\n') ? '' : '\n'; self.output.write(errStack); self.clearBufferedCommand(); self.lines.level = []; self.displayPrompt(); } }); self.clearBufferedCommand(); function completer(text, cb) { ReflectApply(complete, self, [text, self.editorMode ? self.completeOnEditorMode(cb) : cb]); } ReflectApply(Interface, this, [{ input: options.input, output: options.output, completer: options.completer || completer, terminal: options.terminal, historySize: options.historySize, prompt }]); self.resetContext(); this.commands = ObjectCreate(null); defineDefaultCommands(this); // Figure out which "writer" function to use self.writer = options.writer || module.exports.writer; if (self.writer === writer) { // Conditionally turn on ANSI coloring. writer.options.colors = self.useColors; if (options[kStandaloneREPL]) { ObjectDefineProperty(inspect, 'replDefaults', { __proto__: null, get() { return writer.options; }, set(options) { validateObject(options, 'options'); return ObjectAssign(writer.options, options); }, enumerable: true, configurable: true }); } } function _parseREPLKeyword(keyword, rest) { const cmd = this.commands[keyword]; if (cmd) { ReflectApply(cmd.action, this, [rest]); return true; } return false; } self.on('close', function emitExit() { if (paused) { ArrayPrototypePush(pausedBuffer, ['close']); return; } self.emit('exit'); }); let sawSIGINT = false; let sawCtrlD = false; const prioritizedSigintQueue = new SafeSet(); self.on('SIGINT', function onSigInt() { if (prioritizedSigintQueue.size > 0) { for (const task of prioritizedSigintQueue) { task(); } return; } const empty = self.line.length === 0; self.clearLine(); _turnOffEditorMode(self); const cmd = self[kBufferedCommandSymbol]; if (!(cmd && cmd.length > 0) && empty) { if (sawSIGINT) { self.close(); sawSIGINT = false; return; } self.output.write( '(To exit, press Ctrl+C again or Ctrl+D or type .exit)\n' ); sawSIGINT = true; } else { sawSIGINT = false; } self.clearBufferedCommand(); self.lines.level = []; self.displayPrompt(); }); self.on('line', function onLine(cmd) { debug('line %j', cmd); cmd = cmd || ''; sawSIGINT = false; if (self.editorMode) { self[kBufferedCommandSymbol] += cmd + '\n'; // code alignment const matches = self._sawKeyPress ? RegExpPrototypeExec(/^\s+/, cmd) : null; if (matches) { const prefix = matches[0]; self.write(prefix); self.line = prefix; self.cursor = prefix.length; } ReflectApply(_memory, self, [cmd]); return; } // Check REPL keywords and empty lines against a trimmed line input. const trimmedCmd = StringPrototypeTrim(cmd); // Check to see if a REPL keyword was used. If it returns true, // display next prompt and return. if (trimmedCmd) { if (StringPrototypeCharAt(trimmedCmd, 0) === '.' && StringPrototypeCharAt(trimmedCmd, 1) !== '.' && NumberIsNaN(NumberParseFloat(trimmedCmd))) { const matches = RegExpPrototypeExec(/^\.([^\s]+)\s*(.*)$/, trimmedCmd); const keyword = matches && matches[1]; const rest = matches && matches[2]; if (ReflectApply(_parseREPLKeyword, self, [keyword, rest]) === true) { return; } if (!self[kBufferedCommandSymbol]) { self.output.write('Invalid REPL keyword\n'); finish(null); return; } } } const evalCmd = self[kBufferedCommandSymbol] + cmd + '\n'; debug('eval %j', evalCmd); self.eval(evalCmd, self.context, getREPLResourceName(), finish); function finish(e, ret) { debug('finish', e, ret); ReflectApply(_memory, self, [cmd]); if (e && !self[kBufferedCommandSymbol] && StringPrototypeStartsWith(StringPrototypeTrim(cmd), 'npm ')) { self.output.write('npm should be run outside of the ' + 'Node.js REPL, in your normal shell.\n' + '(Press Ctrl+D to exit.)\n'); self.displayPrompt(); return; } // If error was SyntaxError and not JSON.parse error if (e) { if (e instanceof Recoverable && !sawCtrlD) { // Start buffering data like that: // { // ... x: 1 // ... } self[kBufferedCommandSymbol] += cmd + '\n'; self.displayPrompt(); return; } self._domain.emit('error', e.err || e); } // Clear buffer if no SyntaxErrors self.clearBufferedCommand(); sawCtrlD = false; // If we got any output - print it (if no error) if (!e && // When an invalid REPL command is used, error message is printed // immediately. We don't have to print anything else. So, only when // the second argument to this function is there, print it. arguments.length === 2 && (!self.ignoreUndefined || ret !== undefined)) { if (!self.underscoreAssigned) { self.last = ret; } self.output.write(self.writer(ret) + '\n'); } // Display prompt again (unless we already did by emitting the 'error' // event on the domain instance). if (!e) { self.displayPrompt(); } } }); self.on('SIGCONT', function onSigCont() { if (self.editorMode) { self.output.write(`${self._initialPrompt}.editor\n`); self.output.write( '// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)\n'); self.output.write(`${self[kBufferedCommandSymbol]}\n`); self.prompt(true); } else { self.displayPrompt(true); } }); const { reverseSearch } = setupReverseSearch(this); const { clearPreview, showPreview } = setupPreview( this, kContextId, kBufferedCommandSymbol, preview ); // Wrap readline tty to enable editor mode and pausing. const ttyWrite = FunctionPrototypeBind(self._ttyWrite, self); self._ttyWrite = (d, key) => { key = key || {}; if (paused && !(self.breakEvalOnSigint && key.ctrl && key.name === 'c')) { ArrayPrototypePush(pausedBuffer, ['key', [d, key], self.isCompletionEnabled]); return; } if (!self.editorMode || !self.terminal) { // Before exiting, make sure to clear the line. if (key.ctrl && key.name === 'd' && self.cursor === 0 && self.line.length === 0) { self.clearLine(); } clearPreview(key); if (!reverseSearch(d, key)) { ttyWrite(d, key); if (key.name !== 'escape') { showPreview(); } } return; } // Editor mode if (key.ctrl && !key.shift) { switch (key.name) { // TODO(BridgeAR): There should not be a special mode necessary for full // multiline support. case 'd': // End editor mode _turnOffEditorMode(self); sawCtrlD = true; ttyWrite(d, { name: 'return' }); break; case 'n': // Override next history item case 'p': // Override previous history item break; default: ttyWrite(d, key); } } else { switch (key.name) { case 'up': // Override previous history item case 'down': // Override next history item break; case 'tab': // Prevent double tab behavior self._previousKey = null; ttyWrite(d, key); break; default: ttyWrite(d, key); } } }; self.displayPrompt(); } ObjectSetPrototypeOf(REPLServer.prototype, Interface.prototype); ObjectSetPrototypeOf(REPLServer, Interface); // Prompt is a string to print on each line for the prompt, // source is a stream to use for I/O, defaulting to stdin/stdout. function start(prompt, source, eval_, useGlobal, ignoreUndefined, replMode) { return new REPLServer( prompt, source, eval_, useGlobal, ignoreUndefined, replMode); } REPLServer.prototype.setupHistory = function setupHistory(historyFile, cb) { history(this, historyFile, cb); }; REPLServer.prototype.clearBufferedCommand = function clearBufferedCommand() { this[kBufferedCommandSymbol] = ''; }; REPLServer.prototype.close = function close() { if (this.terminal && this._flushing && !this._closingOnFlush) { this._closingOnFlush = true; this.once('flushHistory', () => ReflectApply(Interface.prototype.close, this, []) ); return; } process.nextTick(() => ReflectApply(Interface.prototype.close, this, []) ); }; REPLServer.prototype.createContext = function() { let context; if (this.useGlobal) { context = globalThis; } else { sendInspectorCommand((session) => { session.post('Runtime.enable'); session.once('Runtime.executionContextCreated', ({ params }) => { this[kContextId] = params.context.id; }); context = vm.createContext(); session.post('Runtime.disable'); }, () => { context = vm.createContext(); }); ArrayPrototypeForEach(ObjectGetOwnPropertyNames(globalThis), (name) => { // Only set properties that do not already exist as a global builtin. if (!globalBuiltins.has(name)) { ObjectDefineProperty(context, name, { __proto__: null, ...ObjectGetOwnPropertyDescriptor(globalThis, name), }); } }); context.global = context; const _console = new Console(this.output); ObjectDefineProperty(context, 'console', { __proto__: null, configurable: true, writable: true, value: _console }); } const replModule = new CJSModule('<repl>'); replModule.paths = CJSModule._resolveLookupPaths('<repl>', parentModule); ObjectDefineProperty(context, 'module', { __proto__: null, configurable: true, writable: true, value: replModule }); ObjectDefineProperty(context, 'require', { __proto__: null, configurable: true, writable: true, value: makeRequireFunction(replModule) }); addBuiltinLibsToObject(context, '<REPL>'); return context; }; REPLServer.prototype.resetContext = function() { this.context = this.createContext(); this.underscoreAssigned = false; this.underscoreErrAssigned = false; // TODO(BridgeAR): Deprecate the lines. this.lines = []; this.lines.level = []; ObjectDefineProperty(this.context, '_', { __proto__: null, configurable: true, get: () => this.last, set: (value) => { this.last = value; if (!this.underscoreAssigned) { this.underscoreAssigned = true; this.output.write('Expression assignment to _ now disabled.\n'); } } }); ObjectDefineProperty(this.context, '_error', { __proto__: null, configurable: true, get: () => this.lastError, set: (value) => { this.lastError = value; if (!this.underscoreErrAssigned) { this.underscoreErrAssigned = true; this.output.write( 'Expression assignment to _error now disabled.\n'); } } }); // Allow REPL extensions to extend the new context this.emit('reset', this.context); }; REPLServer.prototype.displayPrompt = function(preserveCursor) { let prompt = this._initialPrompt; if (this[kBufferedCommandSymbol].length) { prompt = '...'; const len = this.lines.level.length ? this.lines.level.length - 1 : 0; const levelInd = StringPrototypeRepeat('..', len); prompt += levelInd + ' '; } // Do not overwrite `_initialPrompt` here ReflectApply(Interface.prototype.setPrompt, this, [prompt]); this.prompt(preserveCursor); }; // When invoked as an API method, overwrite _initialPrompt REPLServer.prototype.setPrompt = function setPrompt(prompt) { this._initialPrompt = prompt; ReflectApply(Interface.prototype.setPrompt, this, [prompt]); }; const importRE = /\bimport\s*\(\s*['"`](([\[email protected]/:-]+\/)?(?:[\[email protected]/:-]*))(?![^'"`])$/; const requireRE = /\brequire\s*\(\s*['"`](([\[email protected]/:-]+\/)?(?:[\[email protected]/:-]*))(?![^'"`])$/; const fsAutoCompleteRE = /fs(?:\.promises)?\.\s*[a-z][a-zA-Z]+\(\s*["'](.*)/; const simpleExpressionRE = /(?:[\w$'"`[{(](?:\w|\$|['"`\]})])*\??\.)*[a-zA-Z_$](?:\w|\$)*\??\.?$/; const versionedFileNamesRe = /-\d+\.\d+/; function isIdentifier(str) { if (str === '') { return false; } const first = StringPrototypeCodePointAt(str, 0); if (!isIdentifierStart(first)) { return false; } const firstLen = first > 0xffff ? 2 : 1; for (let i = firstLen; i < str.length; i += 1) { const cp = StringPrototypeCodePointAt(str, i); if (!isIdentifierChar(cp)) { return false; } if (cp > 0xffff) { i += 1; } } return true; } function isNotLegacyObjectPrototypeMethod(str) { return isIdentifier(str) && str !== '__defineGetter__' && str !== '__defineSetter__' && str !== '__lookupGetter__' && str !== '__lookupSetter__'; } function filteredOwnPropertyNames(obj) { if (!obj) return []; // `Object.prototype` is the only non-contrived object that fulfills // `Object.getPrototypeOf(X) === null && // Object.getPrototypeOf(Object.getPrototypeOf(X.constructor)) === X`. let isObjectPrototype = false; if (ObjectGetPrototypeOf(obj) === null) { const ctorDescriptor = ObjectGetOwnPropertyDescriptor(obj, 'constructor'); if (ctorDescriptor && ctorDescriptor.value) { const ctorProto = ObjectGetPrototypeOf(ctorDescriptor.value); isObjectPrototype = ctorProto && ObjectGetPrototypeOf(ctorProto) === obj; } } const filter = ALL_PROPERTIES | SKIP_SYMBOLS; return ArrayPrototypeFilter( getOwnNonIndexProperties(obj, filter), isObjectPrototype ? isNotLegacyObjectPrototypeMethod : isIdentifier); } function getGlobalLexicalScopeNames(contextId) { return sendInspectorCommand((session) => { let names = []; session.post('Runtime.globalLexicalScopeNames', { executionContextId: contextId }, (error, result) => { if (!error) names = result.names; }); return names; }, () => []); } REPLServer.prototype.complete = function() { ReflectApply(this.completer, this, arguments); }; function gracefulReaddir(...args) { try { return ReflectApply(fs.readdirSync, null, args); } catch { // Continue regardless of error. } } function completeFSFunctions(match) { let baseName = ''; let filePath = match[1]; let fileList = gracefulReaddir(filePath, { withFileTypes: true }); if (!fileList) { baseName = path.basename(filePath); filePath = path.dirname(filePath); fileList = gracefulReaddir(filePath, { withFileTypes: true }) || []; } const completions = ArrayPrototypeMap( ArrayPrototypeFilter( fileList, (dirent) => StringPrototypeStartsWith(dirent.name, baseName) ), (d) => d.name ); return [[completions], baseName]; } // Provide a list of completions for the given leading text. This is // given to the readline interface for handling tab completion. // // Example: // complete('let foo = util.') // -> [['util.print', 'util.debug', 'util.log', 'util.inspect'], // 'util.' ] // // Warning: This eval's code like "foo.bar.baz", so it will run property // getter code. function complete(line, callback) { // List of completion lists, one for each inheritance "level" let completionGroups = []; let completeOn, group; // Ignore right whitespace. It could change the outcome. line = StringPrototypeTrimLeft(line); let filter = ''; let match; // REPL commands (e.g. ".break"). if ((match = RegExpPrototypeExec(/^\s*\.(\w*)$/, line)) !== null) { ArrayPrototypePush(completionGroups, ObjectKeys(this.commands)); completeOn = match[1]; if (completeOn.length) { filter = completeOn; } } else if ((match = RegExpPrototypeExec(requireRE, line)) !== null) { // require('...<Tab>') completeOn = match[1]; filter = completeOn; if (this.allowBlockingCompletions) { const subdir = match[2] || ''; const extensions = ObjectKeys(this.context.require.extensions); const indexes = ArrayPrototypeMap(extensions, (extension) => `index${extension}`); ArrayPrototypePush(indexes, 'package.json', 'index'); group = []; let paths = []; if (completeOn === '.') { group = ['./', '../']; } else if (completeOn === '..') { group = ['../']; } else if (RegExpPrototypeExec(/^\.\.?\//, completeOn) !== null) { paths = [process.cwd()]; } else { paths = ArrayPrototypeConcat(module.paths, CJSModule.globalPaths); } ArrayPrototypeForEach(paths, (dir) => { dir = path.resolve(dir, subdir); const dirents = gracefulReaddir(dir, { withFileTypes: true }) || []; ArrayPrototypeForEach(dirents, (dirent) => { if (RegExpPrototypeExec(versionedFileNamesRe, dirent.name) !== null || dirent.name === '.npm') { // Exclude versioned names that 'npm' installs. return; } const extension = path.extname(dirent.name); const base = StringPrototypeSlice(dirent.name, 0, -extension.length); if (!dirent.isDirectory()) { if (StringPrototypeIncludes(extensions, extension) && (!subdir || base !== 'index')) { ArrayPrototypePush(group, `${subdir}${base}`); } return; } ArrayPrototypePush(group, `${subdir}${dirent.name}/`); const absolute = path.resolve(dir, dirent.name); if (ArrayPrototypeSome( gracefulReaddir(absolute) || [], (subfile) => ArrayPrototypeIncludes(indexes, subfile) )) { ArrayPrototypePush(group, `${subdir}${dirent.name}`); } }); }); if (group.length) { ArrayPrototypePush(completionGroups, group); } } ArrayPrototypePush(completionGroups, _builtinLibs, nodeSchemeBuiltinLibs); } else if ((match = RegExpPrototypeExec(importRE, line)) !== null) { // import('...<Tab>') completeOn = match[1]; filter = completeOn; if (this.allowBlockingCompletions) { const subdir = match[2] || ''; // File extensions that can be imported: const extensions = ObjectKeys( getOptionValue('--experimental-specifier-resolution') === 'node' ? legacyExtensionFormatMap : extensionFormatMap); // Only used when loading bare module specifiers from `node_modules`: const indexes = ArrayPrototypeMap(extensions, (ext) => `index${ext}`); ArrayPrototypePush(indexes, 'package.json'); group = []; let paths = []; if (completeOn === '.') { group = ['./', '../']; } else if (completeOn === '..') { group = ['../']; } else if (RegExpPrototypeExec(/^\.\.?\//, completeOn) !== null) { paths = [process.cwd()]; } else { paths = ArrayPrototypeSlice(module.paths); } ArrayPrototypeForEach(paths, (dir) => { dir = path.resolve(dir, subdir); const isInNodeModules = path.basename(dir) === 'node_modules'; const dirents = gracefulReaddir(dir, { withFileTypes: true }) || []; ArrayPrototypeForEach(dirents, (dirent) => { const { name } = dirent; if (RegExpPrototypeExec(versionedFileNamesRe, name) !== null || name === '.npm') { // Exclude versioned names that 'npm' installs. return; } if (!dirent.isDirectory()) { const extension = path.extname(name); if (StringPrototypeIncludes(extensions, extension)) { ArrayPrototypePush(group, `${subdir}${name}`); } return; } ArrayPrototypePush(group, `${subdir}${name}/`); if (!subdir && isInNodeModules) { const absolute = path.resolve(dir, name); const subfiles = gracefulReaddir(absolute) || []; if (ArrayPrototypeSome(subfiles, (subfile) => { return ArrayPrototypeIncludes(indexes, subfile); })) { ArrayPrototypePush(group, `${subdir}${name}`); } } }); }); if (group.length) { ArrayPrototypePush(completionGroups, group); } } ArrayPrototypePush(completionGroups, _builtinLibs, nodeSchemeBuiltinLibs); } else if ((match = RegExpPrototypeExec(fsAutoCompleteRE, line)) !== null && this.allowBlockingCompletions) { ({ 0: completionGroups, 1: completeOn } = completeFSFunctions(match)); // Handle variable member lookup. // We support simple chained expressions like the following (no function // calls, etc.). That is for simplicity and also because we *eval* that // leading expression so for safety (see WARNING above) don't want to // eval function calls. // // foo.bar<|> # completions for 'foo' with filter 'bar' // spam.eggs.<|> # completions for 'spam.eggs' with filter '' // foo<|> # all scope vars with filter 'foo' // foo.<|> # completions for 'foo' with filter '' } else if (line.length === 0 || RegExpPrototypeExec(/\w|\.|\$/, line[line.length - 1]) !== null) { const { 0: match } = RegExpPrototypeExec(simpleExpressionRE, line) || ['']; if (line.length !== 0 && !match) { completionGroupsLoaded(); return; } let expr = ''; completeOn = match; if (StringPrototypeEndsWith(line, '.')) { expr = StringPrototypeSlice(match, 0, -1); } else if (line.length !== 0) { const bits = StringPrototypeSplit(match, '.'); filter = ArrayPrototypePop(bits); expr = ArrayPrototypeJoin(bits, '.'); } // Resolve expr and get its completions. if (!expr) { // Get global vars synchronously ArrayPrototypePush(completionGroups, getGlobalLexicalScopeNames(this[kContextId])); let contextProto = this.context; while ((contextProto = ObjectGetPrototypeOf(contextProto)) !== null) { ArrayPrototypePush(completionGroups, filteredOwnPropertyNames(contextProto)); } const contextOwnNames = filteredOwnPropertyNames(this.context); if (!this.useGlobal) { // When the context is not `global`, builtins are not own // properties of it. // `globalBuiltins` is a `SafeSet`, not an Array-like. ArrayPrototypePush(contextOwnNames, ...globalBuiltins); } ArrayPrototypePush(completionGroups, contextOwnNames); if (filter !== '') addCommonWords(completionGroups); completionGroupsLoaded(); return; } let chaining = '.'; if (StringPrototypeEndsWith(expr, '?')) { expr = StringPrototypeSlice(expr, 0, -1); chaining = '?.'; } const memberGroups = []; const evalExpr = `try { ${expr} } catch {}`; this.eval(evalExpr, this.context, getREPLResourceName(), (e, obj) => { try { let p; if ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') { memberGroups.push(filteredOwnPropertyNames(obj)); p = ObjectGetPrototypeOf(obj); } else { p = obj.constructor ? obj.constructor.prototype : null; } // Circular refs possible? Let's guard against that. let sentinel = 5; while (p !== null && sentinel-- !== 0) { memberGroups.push(filteredOwnPropertyNames(p)); p = ObjectGetPrototypeOf(p); } } catch { // Maybe a Proxy object without `getOwnPropertyNames` trap. // We simply ignore it here, as we don't want to break the // autocompletion. Fixes the bug // https://github.com/nodejs/node/issues/2119 } if (memberGroups.length) { expr += chaining; ArrayPrototypeForEach(memberGroups, (group) => { ArrayPrototypePush(completionGroups, ArrayPrototypeMap(group, (member) => `${expr}${member}`)); }); if (filter) { filter = `${expr}${filter}`; } } completionGroupsLoaded(); }); return; } return completionGroupsLoaded(); // Will be called when all completionGroups are in place // Useful for async autocompletion function completionGroupsLoaded() { // Filter, sort (within each group), uniq and merge the completion groups. if (completionGroups.length && filter) { const newCompletionGroups = []; const lowerCaseFilter = StringPrototypeToLocaleLowerCase(filter); ArrayPrototypeForEach(completionGroups, (group) => { const filteredGroup = ArrayPrototypeFilter(group, (str) => { // Filter is always case-insensitive following chromium autocomplete // behavior. return StringPrototypeStartsWith( StringPrototypeToLocaleLowerCase(str), lowerCaseFilter ); }); if (filteredGroup.length) { ArrayPrototypePush(newCompletionGroups, filteredGroup); } }); completionGroups = newCompletionGroups; } const completions = []; // Unique completions across all groups. const uniqueSet = new SafeSet(); uniqueSet.add(''); // Completion group 0 is the "closest" (least far up the inheritance // chain) so we put its completions last: to be closest in the REPL. ArrayPrototypeForEach(completionGroups, (group) => { ArrayPrototypeSort(group, (a, b) => (b > a ? 1 : -1)); const setSize = uniqueSet.size; ArrayPrototypeForEach(group, (entry) => { if (!uniqueSet.has(entry)) { ArrayPrototypeUnshift(completions, entry); uniqueSet.add(entry); } }); // Add a separator between groups. if (uniqueSet.size !== setSize) { ArrayPrototypeUnshift(completions, ''); } }); // Remove obsolete group entry, if present. if (completions[0] === '') { ArrayPrototypeShift(completions); } callback(null, [completions, completeOn]); } } REPLServer.prototype.completeOnEditorMode = (callback) => (err, results) => { if (err) return callback(err); const { 0: completions, 1: completeOn = '' } = results; let result = ArrayPrototypeFilter(completions, Boolean); if (completeOn && result.length !== 0) { result = [commonPrefix(result)]; } callback(null, [result, completeOn]); }; REPLServer.prototype.defineCommand = function(keyword, cmd) { if (typeof cmd === 'function') { cmd = { action: cmd }; } else { validateFunction(cmd.action, 'cmd.action'); } this.commands[keyword] = cmd; }; // TODO(BridgeAR): This should be replaced with acorn to build an AST. The // language became more complex and using a simple approach like this is not // sufficient anymore. function _memory(cmd) { const self = this; self.lines = self.lines || []; self.lines.level = self.lines.level || []; // Save the line so I can do magic later if (cmd) { const len = self.lines.level.length ? self.lines.level.length - 1 : 0; ArrayPrototypePush(self.lines, StringPrototypeRepeat(' ', len) + cmd); } else { // I don't want to not change the format too much... ArrayPrototypePush(self.lines, ''); } if (!cmd) { self.lines.level = []; return; } // I need to know "depth." // Because I can not tell the difference between a } that // closes an object literal and a } that closes a function const countMatches = (regex, str) => { let count = 0; while (RegExpPrototypeExec(regex, str) !== null) count++; return count; }; // Going down is { and ( e.g. function() { // going up is } and ) const dw = countMatches(/[{(]/g, cmd); const up = countMatches(/[})]/g, cmd); let depth = dw.length - up.length; if (depth) { (function workIt() { if (depth > 0) { // Going... down. // Push the line#, depth count, and if the line is a function. // Since JS only has functional scope I only need to remove // "function() {" lines, clearly this will not work for // "function() // {" but nothing should break, only tab completion for local // scope will not work for this function. ArrayPrototypePush(self.lines.level, { line: self.lines.length - 1, depth: depth }); } else if (depth < 0) { // Going... up. const curr = ArrayPrototypePop(self.lines.level); if (curr) { const tmp = curr.depth + depth; if (tmp < 0) { // More to go, recurse depth += curr.depth; workIt(); } else if (tmp > 0) { // Remove and push back curr.depth += depth; ArrayPrototypePush(self.lines.level, curr); } } } }()); } } function addCommonWords(completionGroups) { // Only words which do not yet exist as global property should be added to // this list. ArrayPrototypePush(completionGroups, [ 'async', 'await', 'break', 'case', 'catch', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export', 'false', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', 'return', 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield', ]); } function _turnOnEditorMode(repl) { repl.editorMode = true; ReflectApply(Interface.prototype.setPrompt, repl, ['']); } function _turnOffEditorMode(repl) { repl.editorMode = false; repl.setPrompt(repl._initialPrompt); } function defineDefaultCommands(repl) { repl.defineCommand('break', { help: 'Sometimes you get stuck, this gets you out', action: function() { this.clearBufferedCommand(); this.displayPrompt(); } }); let clearMessage; if (repl.useGlobal) { clearMessage = 'Alias for .break'; } else { clearMessage = 'Break, and also clear the local context'; } repl.defineCommand('clear', { help: clearMessage, action: function() { this.clearBufferedCommand(); if (!this.useGlobal) { this.output.write('Clearing context...\n'); this.resetContext(); } this.displayPrompt(); } }); repl.defineCommand('exit', { help: 'Exit the REPL', action: function() { this.close(); } }); repl.defineCommand('help', { help: 'Print this help message', action: function() { const names = ArrayPrototypeSort(ObjectKeys(this.commands)); const longestNameLength = MathMaxApply( ArrayPrototypeMap(names, (name) => name.length) ); ArrayPrototypeForEach(names, (name) => { const cmd = this.commands[name]; const spaces = StringPrototypeRepeat(' ', longestNameLength - name.length + 3); const line = `.${name}${cmd.help ? spaces + cmd.help : ''}\n`; this.output.write(line); }); this.output.write('\nPress Ctrl+C to abort current expression, ' + 'Ctrl+D to exit the REPL\n'); this.displayPrompt(); } }); repl.defineCommand('save', { help: 'Save all evaluated commands in this REPL session to a file', action: function(file) { try { fs.writeFileSync(file, ArrayPrototypeJoin(this.lines, '\n')); this.output.write(`Session saved to: ${file}\n`); } catch { this.output.write(`Failed to save: ${file}\n`); } this.displayPrompt(); } }); repl.defineCommand('load', { help: 'Load JS from a file into the REPL session', action: function(file) { try { const stats = fs.statSync(file); if (stats && stats.isFile()) { _turnOnEditorMode(this); const data = fs.readFileSync(file, 'utf8'); this.write(data); _turnOffEditorMode(this); this.write('\n'); } else { this.output.write( `Failed to load: ${file} is not a valid file\n` ); } } catch { this.output.write(`Failed to load: ${file}\n`); } this.displayPrompt(); } }); if (repl.terminal) { repl.defineCommand('editor', { help: 'Enter editor mode', action() { _turnOnEditorMode(this); this.output.write( '// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)\n'); } }); } } function Recoverable(err) { this.err = err; } ObjectSetPrototypeOf(Recoverable.prototype, SyntaxErrorPrototype); ObjectSetPrototypeOf(Recoverable, SyntaxError); module.exports = { start, writer, REPLServer, REPL_MODE_SLOPPY, REPL_MODE_STRICT, Recoverable }; ObjectDefineProperty(module.exports, 'builtinModules', { __proto__: null, get: () => _builtinLibs, set: (val) => _builtinLibs = val, enumerable: true, configurable: true }); ObjectDefineProperty(module.exports, '_builtinLibs', { __proto__: null, get: pendingDeprecation ? deprecate( () => _builtinLibs, 'repl._builtinLibs is deprecated. Check module.builtinModules instead', 'DEP0142' ) : () => _builtinLibs, set: pendingDeprecation ? deprecate( (val) => _builtinLibs = val, 'repl._builtinLibs is deprecated. Check module.builtinModules instead', 'DEP0142' ) : (val) => _builtinLibs = val, enumerable: false, configurable: true }); |