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 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121
|
Changes with njs 0.8.9 14 Jan 2025
nginx modules:
*) Bugfix: removed extra VM creation per server.
Previously, when js_import was declared in http or stream blocks,
an extra copy of the VM instance was created for each server
block. This was not needed and consumed a lot of memory for
configurations with many server blocks.
This issue was introduced in 9b674412 (0.8.6) and was partially
fixed for location blocks only in 685b64f0 (0.8.7).
Core:
*) Feature: added fs module for QuickJS engine.
Changes with njs 0.8.8 10 Dec 2024
nginx modules:
*) Feature: implemented shared dictionary for QuickJS engine.
*) Improvement: js_preload_object is refactored.
*) Bugfix: fixed limit rated output.
*) Bugfix: optimized use of SSL contexts for
js_fetch_trusted_certificate directive.
Core:
*) Feature: implemented process object for QuickJS engine.
*) Feature: implemented process.kill() method.
*) Bugfix: fixed tests with libxml2 2.13 and later.
*) Bugfix: fixed promise resolving when Promise is inherited.
*) Bugfix: fixed absolute scope in cloned VMs.
Changes with njs 0.8.7 22 Oct 2024
nginx modules:
*) Bugfix: eliminated unnecessary VM creation.
Previously, njs consumed memory proportionally to the number of
nginx locations. The issue was introduced in 9b674412 (0.8.6).
*) Improvement: added strict syntax validation for js_body_filter.
*) Improvement: improved error messages for module loading
failures.
Core:
*) Feature: implemented fs.readlink() and friends.
*) Improvement: implemented lazy stack symbolization.
*) Bugfix: fixed heap-buffer-overflow in Buffer.prototype.indexOf().
The issue was introduced in 5d15a8d6 (0.8.6).
*) Bugfix: fixed Buffer.prototype.lastIndexOf() when `from` is
provided.
Changes with njs 0.8.6 02 Oct 2024
nginx modules:
*) Feature: introduced QuickJS engine.
*) Feature: added optional nocache flag for js_set directive.
Thanks to Thomas P.
*) Feature: exposed capture group variables in HTTP module.
Thanks to Thomas P.
Core:
*) Feature: added Buffer module for QuickJS engine.
*) Bugfix: fixed handling of empty labelled statement in a function.
*) Bugfix: fixed Function constructor handling when called without
arguments.
*) Bugfix: fixed Buffer.prototype.writeInt8() and friends.
*) Bugfix: fixed Buffer.prototype.writeFloat() and friends.
*) Bugfix: fixed Buffer.prototype.lastIndexOf().
*) Bugfix: fixed Buffer.prototype.write().
*) Bugfix: fixed maybe-uninitialized warnings in error creation.
*) Bugfix: fixed 'ctx.codepoint' initialization in UTF-8 decoding.
*) Bugfix: fixed 'length' initialization in Array.prototype.pop().
*) Bugfix: fixed handling of encode arg in fs.readdir() and
fs.realpath().
Changes with njs 0.8.5 25 Jun 2024
nginx modules:
*) Change: r.variables.var, r.requestText, r.responseText,
s.variables.var, and the "data" argument of the s.on() callback
with "upload" or "download" event types will now convert bytes
invalid in UTF-8 encoding into the replacement character. When
working with binary data, use r.rawVariables.var, r.requestBuffer,
r.responseBuffer, s.rawVariables.var, and the "upstream" or
"downstream" event type for s.on() instead.
*) Feature: added timeout argument for shared dictionary methods
add(), set() and incr().
*) Bugfix: fixed checking for duplicate js_set variables.
*) Bugfix: fixed request Host header when the port is non-standard.
*) Bugfix: fixed handling of a zero-length request body in ngx.fetch()
and r.subrequest().
*) Bugfix: fixed heap-buffer-overflow in Headers.get().
*) Bugfix: fixed r.subrequest() error handling.
Core:
*) Feature: added zlib module for QuickJS engine.
*) Bugfix: fixed zlib.inflate().
*) Bugfix: fixed String.prototype.replaceAll() with zero-length
argument.
*) Bugfix: fixed retval handling after an exception in
Array.prototype.toSpliced(), Array.prototype.toReversed(),
Array.prototype.toSorted().
*) Bugfix: fixed RegExp.prototype[@@replace]() with replacements
containing "$'", "$\`" and strings with Unicode characters.
*) Bugfix: fixed a one-byte overread in decodeURI() and
decodeURIComponent().
*) Bugfix: fixed tracking of argument scope.
*) Bugfix: fixed integer overflow in Date.parse().
Changes with njs 0.8.4 16 Apr 2024
nginx modules:
*) Feature: allowing to set Server header for outgoing headers.
*) Improvement: validating URI and args arguments in r.subrequest().
*) Improvement: checking for duplicate js_set variables.
*) Bugfix: fixed clear() method of a shared dictionary without
timeout introduced in 0.8.3.
*) Bugfix: fixed r.send() with Buffer argument.
Core:
*) Feature: added QuickJS engine support in CLI.
*) Bugfix: fixed atob() with non-padded base64 strings.
Changes with njs 0.8.3 07 Feb 2024
nginx modules:
*) Bugfix: fixed Headers.set().
*) Bugfix: fixed js_set with Buffer values.
*) Bugfix: fixed clear() method of a shared dictionary when
a timeout is not specified.
*) Bugfix: fixed stub_status statistics when js_periodic is
enabled.
Core:
*) Bugfix: fixed building with libxml2 2.12 and later.
*) Bugfix: fixed Date constructor for overflows and with
NaN values.
*) Bugfix: fixed underflow in querystring.parse().
*) Bugfix: fixed potential buffer overread in
String.prototype.match().
*) Bugfix: fixed parsing of for-in loops.
*) Bugfix: fixed parsing of hexadecimal, octal, and binary
literals with no digits.
Changes with njs 0.8.2 24 Oct 2023
nginx modules:
*) Feature: introduced console object. The following methods
were introduced: error(), info(), log(), time(), timeEnd(),
warn().
*) Bugfix: fixed HEAD response handling with large Content-Length
in fetch API.
*) Bugfix: fixed items() method for a shared dictionary.
*) Bugfix: fixed delete() method for a shared dictionary.
Core:
*) Feature: extended "fs" module. Added existsSync().
*) Bugfix: fixed "xml" module. Fixed broken XML exception handling
in parse() method.
*) Bugfix: fixed RegExp.prototype.exec() with global regexp and
unicode input.
*) Bugfix: fixed return statement parsing with invalid expression.
Changes with njs 0.8.1 12 Sep 2023
nginx modules:
*) Feature: introduced js_periodic directive.
The directive specifies a JS handler to run at regular intervals.
*) Feature: implemented items() method for a shared dictionary.
The method returns all the non-expired key-value pairs.
*) Bugfix: fixed size() and keys() methods of a shared dictionary.
*) Bugfix: fixed erroneous exception in r.internalRedirect()
introduced in 0.8.0.
Core:
*) Bugfix: fixed incorrect order of keys in
Object.getOwnPropertyNames().
Changes with njs 0.8.0 6 Jul 2023
nginx modules:
*) Change: removed special treatment of forbidden headers in Fetch API
introduced in 0.7.10.
*) Change: removed deprecated since 0.5.0 r.requestBody and
r.responseBody in HTTP module.
*) Change: throwing an exception in r.internalRedirect() while
filtering in HTTP module.
*) Feature: introduced global nginx properties.
ngx.build - an optional nginx build name, corresponds to
--build=name argument of configure script, by default is "".
ngx.conf_file_path - the file path to current nginx configuration
file.
ngx.error_log_path - the file path to current error log file.
ngx.prefix - the directory that keeps server files.
ngx.version - the nginx version as a string, for example: "1.25.0".
ngx.version_number - the nginx version as a number, for example:
1025000.
ngx.worker_id - corresponds to an nginx internal worker id.
The value is between 0 and worker_processes - 1.
*) Feature: introduced js_shared_dict_zone directive.
The directive allows to declare a dictionary that is shared among the
working processes.
*) Improvement: added compile-time options to disable njs modules.
For example to disable libxslt related code:
NJS_LIBXSLT=NO ./configure .. --add-module=/path/to/njs/module
*) Bugfix: fixed r.status setter when filtering in HTTP module.
*) Bugfix: fixed setting of Location header in HTTP module.
Core:
*) Change: native methods are provided with retval argument.
This change breaks compatibility with C extension for njs
requiring to modify the code.
*) Change: non-compliant deprecated String methods were removed.
The following methods were removed: String.bytesFrom(),
String.prototype.fromBytes(), String.prototype.fromUTF8(),
String.prototype.toBytes(), String.prototype.toUTF8(),
String.prototype.toString(encoding).
*) Change: removed support for building with GNU readline.
*) Feature: added Array.from(), Array.prototype.toSorted(),
Array.prototype.toSpliced(), Array.prototype.toReversed().
*) Feature: added %TypedArray%.prototype.toSorted(),
%TypedArray%.prototype.toSpliced(),
%TypedArray%.prototype.toReversed().
*) Feature: added CryptoKey properties in WebCrypto.
The following properties for CryptoKey were added:
algorithm, extractable, type, usages.
*) Bugfix: fixed retval of crypto.getRandomValues().
*) Bugfix: fixed evaluation of computed property names with function
expressions.
*) Bugfix: fixed implicit name for a function expression declared in
arrays.
*) Bugfix: fixed parsing of for-in loops.
*) Bugfix: fixed Date.parse() with ISO-8601 format and UTC time
offset.
Changes with njs 0.7.12 10 Apr 2023
nginx modules:
*) Bugfix: fixed Headers() constructor in Fetch API.
Core:
*) Feature: added Hash.copy() method in "crypto" module.
*) Feature: added "zlib" module.
*) Improvement: added support for export {name as default}
statement.
*) Bugfix: fixed Number constructor according to the spec.
Changes with njs 0.7.11 9 Mar 2023
nginx modules:
*) Bugfix: added missed linking with libxml2 for the dynamic module.
The bug was introduced in 0.7.10.
Core:
*) Feature: added XMLNode API to modify XML documents.
*) Change: removed XML_PARSE_DTDVALID during parsing of XML document
due to security implications. The issue was introduced
in 0.7.10. When XML_PARSE_DTDVALID is enabled, libxml2 parses and
executes external entities present inside an XML document.
*) Bugfix: fixed the detection of await in arguments.
*) Bugfix: fixed Error() instance dumping when "name" prop is not
primitive.
*) Bugfix: fixed array instance with a getter property dumping.
*) Bugfix: fixed njs_object_property() with NJS_WHITEOUT properties.
*) Bugfix: fixed func instance dumping with "name" as getter.
*) Bugfix: fixed attaching of a stack to an error object.
*) Bugfix: fixed String.prototype.replace() with replacement containing
"$'", "$`".
Changes with njs 0.7.10 7 Feb 2023
nginx modules:
*) Feature: added Request, Response and Headers ctors in Fetch API.
*) Bugfix: fixed nginx logger callback for calls in master process.
Core:
*) Feature: added signal support in CLI.
*) Feature: added "xml" module for working with XML documents.
*) Feature: extended support for symmetric and asymmetric keys
in WebCrypto. Most notably JWK format for importKey() was added.
*) Feature: extended support for symmetric and asymmetric keys
in WebCrypto. Most notably JWK format for importKey() was added.
generateKey() and exportKey() were also implemented.
*) Feature: added String.prototype.replaceAll().
*) Bugfix: fixed for(expr1; conditional syntax error handling.
*) Bugfix: fixed Object.values() and Object.entries() with external
objects.
*) Bugfix: fixed RegExp.prototype[@@replace]().
Changes with njs 0.7.9 17 Nov 2022
nginx modules:
*) Bugfix: fixed Fetch Response prototype reinitialization.
When at least one js_import directive was declared in both HTTP
and Stream, ngx.fetch() returned inapproriate response in Stream.
The bug was introduced in 0.7.7.
Core:
*) Bugfix: fixed String.prototype.replace(re) if re.exec() returns
non-flat array.
*) Bugfix: fixed Array.prototype.fill() when start object changes
"this".
*) Bugfix: fixed description for fs.mkdir() and fs.rmdir() methods.
*) Bugfix: fixed %TypedArray%.prototype.set(s) when s element changes
"this".
*) Bugfix: fixed Array.prototype.splice(s, d) when d resizes "this"
during evaluation.
*) Bugfix: fixed for-in loop with left and right hand side
expressions.
Changes with njs 0.7.8 25 Oct 2022
nginx modules:
*) Feature: added js_preload_object directive.
*) Feature: added ngx.conf_prefix property.
*) Feature: added s.sendUpstream() and s.sendDownstream()
in stream module.
*) Feature: added support for HEAD method in Fetch API.
*) Improvement: improved async callback support for s.send()
in stream module.
Core:
*) Feature: added "name" instance property for a function
object.
*) Feature: added njs.memoryStats object.
*) Bugfix: fixed String.prototype.trimEnd() with unicode
string.
*) Bugfix: fixed Object.freeze() with fast arrays.
*) Bugfix: fixed Object.defineProperty() with fast arrays.
*) Bugfix: fixed async token as a property name of an object.
*) Bugfix: fixed property set instruction when key modifies
base binding.
*) Bugfix: fixed complex assignments.
*) Bugfix: fixed handling of unhandled promise rejection.
*) Bugfix: fixed process.env when duplicate environ variables
are present.
*) Bugfix: fixed double declaration detection in modules.
*) Bugfix: fixed bound function calls according to the spec.
*) Bugfix: fixed break label for if statement.
*) Bugfix: fixed labeled empty statements.
Changes with njs 0.7.7 30 Aug 2022
nginx modules:
*) Feature: the number of nginx configuration contexts where
js directives can be specified is extended.
HTTP: js_import, js_path, js_set and js_var are allowed
in server and location contexts. js_content, js_body_filter
and js_header_filter are allowed in 'if' context.
Stream: js_import, js_path, js_set and js_var are allowed
in server context.
*) Feature: added r.internal property.
*) Bugfix: fixed reading response body in fetch API.
*) Bugfix: fixed "js_fetch_timeout" in stream module.
*) Bugfix: fixed socket leak with 0 fetch timeout.
Core:
*) Feature: extended "fs" module. Added fs.openSync(),
fs.promises.open(), fs.fstatSync(), fs.readSync(),
fs.writeSync().
The following properties of FileHandle are implemented:
fd, read(), stat(), write(), close().
*) Bugfix: fixed parseInt(), parseFloat(), Symbol.for()
with no arguments.
Changes with njs 0.7.6 19 Jul 2022
nginx modules:
*) Feature: improved r.args object. Added support for multiple
arguments with the same key. Added case sensitivity for
keys. Keys and values are percent-decoded now.
*) Bugfix: fixed r.headersOut setter for special headers.
Core:
*) Feature: added Symbol.for() and Symbol.keyfor().
*) Feature: added btoa() and atob() from WHATWG spec.
*) Bugfix: fixed large non-decimal literals.
*) Bugfix: fixed unicode argument trimming in parseInt().
*) Bugfix: fixed break instruction in a try-catch block.
*) Bugfix: fixed async function declaration in CLI.
Changes with njs 0.7.5 21 Jun 2022
nginx modules:
*) Change: adapting to changes in nginx header structures.
*) Bugfix: fixed r.headersOut special getters when value
is absent.
*) Change: returning undefined value instead of an empty string
for Content-Type when the header is absent.
Core:
*) Bugfix: fixed catching of the exception thrown from an
awaited function.
*) Bugfix: fixed function value initialization.
*) Bugfix: fixed interpreter when await fails.
*) Bugfix: fixed typed-array constructor when source array
is changed while iterating.
*) Bugfix: fixed String.prototype.replace() with byte strings.
*) Bugfix: fixed template literal from producing byte-strings.
*) Bugfix: fixed array iterator with sparse arrays.
*) Bugfix: fixed memory free while converting a flat array to
a slow array.
*) Bugfix: properly handling NJS_DECLINE in promise native
functions.
*) Bugfix: fixed working with an array-like object in Promise.all()
and friends.
Changes with njs 0.7.4 24 May 2022
nginx modules:
*) Feature: added extended directive to configure Fetch API.
The following directives were added: "js_fetch_timeout",
"js_fetch_verify", "js_fetch_buffer_size",
"js_fetch_max_response_buffer_size".
*) Change: r.internalRedirect() now accepts escaped URIs.
*) Bugfix: fixed Response parsing with more than 8 headers
in Fetch API.
Core:
*) Feature: added njs.version_number property.
*) Feature: added compatibility with BoringSSL for
WebCrypto API.
*) Bugfix: fixed Array.prototype.sort() when arr size is changed
in a comparator.
*) Bugfix: fixed Array.prototype.slice() with slow "this" argument.
*) Bugfix: fixed aggregation methods of Promise ctor with
array-like object.
*) Bugfix: fixed Array.prototype.lastIndexOf() with unicode
string as "this".
*) Bugfix: fixed JSON.parse() when reviver function is provided.
*) Bugfix: fixed Object.defineProperty() when a recursive descriptor
is provided.
*) Bugfix: fixed Array.prototype.fill() for typed-arrays.
*) Bugfix: making function expression binding immutable according
the specs.
*) Bugfix: fixed redefinition of special props in
Object.defineProperty().
Changes with njs 0.7.3 12 Apr 2022
Core:
*) Feature: added support of module resolution callback.
This feature allows a host environment to control
how imported modules are loaded.
*) Bugfix: fixed backtraces while traversing imported user
modules.
*) Bugfix: fixed Array.prototype.concat() when "this" is a slow
array.
*) Bugfix: fixed frame allocation from an awaited frame.
*) Bugfix: fixed allocation of large array literals.
*) Bugfix: fixed interpreter when "toString" conversion fails.
Changes with njs 0.7.2 25 Jan 2022
Core:
*) Bugfix: fixed Array.prototype.join() when array is changed
while iterating.
*) Bugfix: fixed Array.prototype.slice() when array is changed
while iterating.
*) Bugfix: fixed Array.prototype.concat() when array is changed
while iterating.
*) Bugfix: fixed Array.prototype.reverse() when array is changed
while iterating.
*) Bugfix: fixed Buffer.concat() with subarrays.
Thanks to Sylvain Etienne.
*) Bugfix: fixed type confusion bug while resolving promises.
*) Bugfix: fixed Function.prototype.apply() with large array
arguments.
*) Bugfix: fixed recursive async function calls.
*) Bugfix: fixed function redeclaration. The bug was introduced
in 0.7.0.
Changes with njs 0.7.1 28 Dec 2021
nginx modules:
*) Change: the "js_include" directive deprecated since 0.4.0 was
removed.
*) Change: PCRE/PCRE2-specific code was moved to the modules.
This ensures that njs uses the same RegExp library as nginx.
Core:
*) Feature: extended "fs" module. Added stat(), fstat()
and friends.
*) Change: default RegExp engine for CLI is switched
to PCRE2.
*) Bugfix: fixed decodeURI() and decodeURIComponent() with
invalid byte strings. The bug was introduced in 0.4.3.
*) Bugfix: fixed heap-use-after-free in await frame.
The bug was introduced in 0.7.0.
*) Bugfix: fixed WebCrypto sign() and verify() methods
with OpenSSL 3.0.
*) Bugfix: fixed exception throwing when RegExp match fails.
The bug was introduced in 0.1.15.
*) Bugfix: fixed catching of exception thrown in try block
of async function. The bug was introduced in 0.7.0.
*) Bugfix: fixed execution of async function in synchronous
context. The bug was introduced in 0.7.0.
*) Bugfix: fixed function redeclaration in CLI when interactive
mode is on. The bug was introduced in 0.6.2.
*) Bugfix: fixed typeof operator with DataView object.
*) Bugfix: eliminated information leak in Buffer.from().
Changes with njs 0.7.0 19 Oct 2021
nginx modules:
*) Feature: added HTTPS support for Fetch API.
*) Feature: added setReturnValue() method.
Core:
*) Feature: introduced Async/Await implementation.
*) Feature: added WebCrypto API implementation.
*) Bugfix: fixed copying of closures for declared
functions. The bug was introduced in 0.6.0.
*) Bugfix: fixed unhandled promise rejection in handle
events.
*) Bugfix: fixed Response.headers getter in Fetch API.
Changes with njs 0.6.2 31 Aug 2021
nginx modules:
*) Bugfix: fixed CPU hog when js_filter is registered
in both directions.
Core:
*) Feature: introduced AggregateError implementation.
*) Feature: added remaining Promise constructor methods.
The following methods were added: Promise.all(),
Promise.allSettled(), Promise.any(), Promise.race().
*) Improvement: removed recursion from code generator.
*) Bugfix: fixed rest parameter parsing without binding
identifier.
*) Bugfix: fixed resolve/reject callback for
Promise.prototype.finally().
*) Bugfix: fixed %TypedArray%.prototype.join() with
detached buffer.
*) Bugfix: fixed memory leak in interactive shell.
Changes with njs 0.6.1 29 Jun 2021
*) Bugfix: fixed RegExpBuiltinExec() with UTF-8 only regexps.
The bug was introduced in 0.4.2.
*) Bugfix: fixed parsing of export default declaration with
non-assignment expressions.
Thanks to Artem S. Povalyukhin.
Changes with njs 0.6.0 15 Jun 2021
Core:
*) Feature: added let and const declaration support.
*) Feature: added RegExp.prototype[Symbol.split].
*) Feature: added sticky flag support for RegExp.
*) Bugfix: fixed heap-buffer-overflow in
String.prototype.lastIndexOf().
*) Bugfix: fixed RegExp.prototype.test() according to the
specification.
*) Bugfix: fixed String.prototype.split() according to the
specification.
*) Bugfix: fixed use-of-uninitialized-value while tracking
rejected promises.
*) Bugfix: fixed njs.dump() for objects with circular
references.
Changes with njs 0.5.3 30 Mar 2021
nginx modules:
*) Feature: added the "js_var" directive.
Changes with njs 0.5.2 09 Mar 2021
nginx modules:
*) Feature: added the "js_body_filter" directive.
*) Feature: introduced the "status" property for stream session
object.
Core:
*) Feature: added njs.on('exit') callback support.
*) Bugfix: fixed property descriptor reuse for not extensible
objects.
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed Object.freeze() and friends according to
the specification.
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed Function() in CLI mode.
*) Bugfix: fixed for-in iteration of typed array values.
Thanks to Artem S. Povalyukhin.
Changes with njs 0.5.1 16 Feb 2021
nginx modules:
*) Feature: introduced ngx.fetch() method implementing Fetch API.
The following init options are supported:
body, headers, buffer_size (nginx specific),
max_response_body_size (nginx specific), method.
The following properties and methods of Response object are
implemented: arrayBuffer(), bodyUsed, json(), headers, ok,
redirect, status, statusText, text(), type, url.
The following properties and methods of Header object are
implemented: get(), getAll(), has().
Notable limitations: only the http:// scheme is supported,
redirects are not handled.
In collaboration with 洪志道 (Hong Zhi Dao).
*) Feature: added the "js_header_filter" directive.
*) Bugfix: fixed processing buffered data in body filter
in stream module.
Core:
*) Bugfix: fixed safe mode bypass in Function constructor.
*) Bugfix: fixed Date.prototype.toISOString() with invalid date
values.
Changes with njs 0.5.0 01 Dec 2020
nginx modules:
*) Feature: introduced global "ngx" object.
The following methods were added:
ngx.log(level, msg)
The following properties were added:
ngx.INFO,
ngx.WARN,
ngx.ERR.
*) Feature: added support for Buffer object where string
is expected.
*) Feature: added Buffer version of existing properties.
The following properties were added:
r.requestBuffer (r.requestBody),
r.responseBuffer (r.responseBody),
r.rawVariables (r.variables),
s.rawVariables (s.variables).
The following events were added in stream module:
upstream (upload),
downstream (download).
*) Improvement: added aliases to existing properties.
The following properties were added:
r.requestText (r.requestBody),
r.responseText (r.responseBody).
*) Improvement: throwing an exception in r.internalRedirect()
for a subrequest.
*) Bugfix: fixed promise r.subrequest() with error_page redirect.
*) Bugfix: fixed promise events handling.
Core:
*) Feature: added TypeScript definitions for built-in
modules.
Thanks to Jakub Jirutka.
*) Feature: tracking unhandled promise rejection.
*) Feature: added initial iterator support.
Thanks to Artem S. Povalyukhin.
*) Improvement: TypeScript definitions are refactored.
Thanks to Jakub Jirutka.
*) Improvement: added forgotten support for
Object.prototype.valueOf() in Buffer.from().
*) Bugfix: fixed heap-use-after-free in JSON.parse().
*) Bugfix: fixed heap-use-after-free in JSON.stringify().
*) Bugfix: fixed JSON.stringify() for arrays resizable via
getters.
*) Bugfix: fixed heap-buffer-overflow for
RegExp.prototype[Symbol.replace].
*) Bugfix: fixed returned value for Buffer.prototype.write*
functions.
*) Bugfix: fixed querystring.stringify().
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed the catch handler for
Promise.prototype.finally().
*) Bugfix: fixed querystring.parse().
Changes with njs 0.4.4 29 Sep 2020
nginx modules:
*) Bugfix: fixed location merge.
*) Bugfix: fixed r.httpVersion for HTTP/2.
Core:
*) Feature: added support for numeric separators (ES12).
*) Feature: added remaining methods for %TypedArray%.prototype.
The following methods were added: every(), filter(), find(),
findIndex(), forEach(), includes(), indexOf(), lastIndexOf(),
map(), reduce(), reduceRight(), reverse(), some().
*) Feature: added %TypedArray% remaining methods.
The following methods were added: from(), of().
*) Feature: added DataView object.
*) Feature: added Buffer object implementation.
*) Feature: added support for ArrayBuffer in
TextDecoder.prototype.decode().
*) Feature: added support for Buffer object in "crypto" methods.
*) Feature: added support for Buffer object in "fs" methods.
*) Change: Hash.prototype.digest() and Hmac.prototype.digest()
now return a Buffer instance instead of a byte string when
encoding is not provided.
*) Change: fs.readFile() and friends now return a Buffer instance
instead of a byte string when encoding is not provided.
*) Bugfix: fixed function "prototype" property handler while
setting.
*) Bugfix: fixed function "constructor" property handler while
setting.
*) Bugfix: fixed String.prototype.indexOf() for byte strings.
*) Bugfix: fixed RegExpBuiltinExec() with a global flag and
byte strings.
*) Bugfix: fixed RegExp.prototype[Symbol.replace] when the
replacement value is a function.
*) Bugfix: fixed TextDecoder.prototype.decode() with non-zero
TypedArray offset.
Changes with njs 0.4.3 11 Aug 2020
Core:
*) Feature: added Query String module.
*) Feature: improved fs.mkdir() to support recursive directory creation.
Thanks to Artem S. Povalyukhin.
*) Feature: improved fs.rmdir() to support recursive directory removal.
Thanks to Artem S. Povalyukhin.
*) Feature: introduced UTF-8 decoder according to WHATWG encoding spec.
*) Feature: added TextEncoder/TextDecoder implementation.
*) Bugfix: fixed parsing return statement without semicolon.
*) Bugfix: fixed njs_number_to_int32() for big-endian platforms.
*) Bugfix: fixed unit test on big-endian platforms.
*) Bugfix: fixed regexp-literals parsing with '=' characters.
*) Bugfix: fixed pre/post increment/decrement in assignment operations.
Changes with njs 0.4.2 07 Jul 2020
Core:
*) Feature: added RegExp.prototype[Symbol.replace].
*) Feature: introduced line level backtrace.
*) Feature: added %TypedArray%.prototype.sort().
*) Feature: extended "fs" module. Added mkdir(), readdir(), rmdir()
and friends.
Thanks to Artem S. Povalyukhin.
*) Improvement: parser refactoring.
*) Bugfix: fixed TypedScript API description for HTTP headers.
*) Bugfix: fixed TypedScript API description for NjsByteString type.
*) Bugfix: fixed String.prototype.repeat() according to the
specification.
*) Bugfix: fixed parsing of flags for regexp literals.
*) Bugfix: fixed index generation for global objects in generator.
*) Bugfix: fixed String.prototype.replace() according to the
specification.
*) Bugfix: fixed %TypedArray%.prototype.copyWithin() with nonzero
byte offset.
*) Bugfix: fixed Array.prototype.splice() for sparse arrays.
*) Bugfix: fixed Array.prototype.reverse() for sparse arrays.
*) Bugfix: fixed Array.prototype.sort() for sparse arrays.
Changes with njs 0.4.1 19 May 2020
*) Feature: added support for multi-value headers in r.headersIn.
*) Feature: introduced raw headers API.
*) Feature: added TypedScript API description.
Core:
*) Bugfix: fixed Array.prototype.slice() for sparse arrays.
Changes with njs 0.4.0 23 Apr 2020
nginx modules:
*) Feature: added js_import directive.
*) Feature: added support for multi-value headers in r.headersOut.
*) Improvement: iteration over r.headersOut with special headers.
*) Improvement: iteration over r.headersOut with duplicates.
*) Change: r.responseBody property handler now returns "undefined"
instead of throwing an exception if response body is not available.
Core:
*) Feature: added script arguments support in CLI.
*) Feature: converting externals values to native js objects.
*) Bugfix: fixed NULL-pointer dereference in "__proto__" property
handler.
*) Bugfix: fixed handling of no-newline at the end of the script.
*) Bugfix: fixed RegExp() constructor with empty pattern and
non-empty flags.
*) Bugfix: fixed String.prototype.replace() when function
returns non-string.
*) Bugfix: fixed reading of pseudofiles in "fs".
Changes with njs 0.3.9 03 Mar 2020
nginx modules:
*) Feature: added detached mode for r.subrequest(). Responses to
detached subrequests are ignored. Unlike ordinary subrequests,
a detached subrequest can be created inside a variable handler.
Core:
*) Feature: added promises API for "fs" module.
Thanks to Artem S. Povalyukhin.
*) Feature: extended "fs" module. Added access(), symlink(), unlink(),
realpath() and friends.
Thanks to Artem S. Povalyukhin.
*) Improvement: introduced memory-efficient ordinary arrays.
*) Improvement: lexer refactoring.
*) Bugfix: fixed matching of native functions in backtraces.
*) Bugfix: fixed callback invocations in "fs" module.
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed Object.getOwnPropertySymbols().
*) Bugfix: fixed heap-buffer-overflow in njs_json_append_string().
*) Bugfix: fixed encodeURI() and decodeURI() according to
the specification.
*) Bugfix: fixed Number.prototype.toPrecision().
*) Bugfix: fixed handling of space argument in JSON.stringify().
*) Bugfix: fixed JSON.stringify() with Number() and String() objects.
*) Bugfix: fixed Unicode Escaping in JSON.stringify() according
to specification.
*) Bugfix: fixed non-native module importing.
Thanks to 洪志道 (Hong Zhi Dao).
*) Bugfix: fixed njs.dump() with the Date() instance in a container.
Changes with njs 0.3.8 21 Jan 2020
nginx modules:
*) Feature: added Promise support for r.subrequest(). If callback
is not provided r.subrequest() returns an ordinary Promise object
that resolves to subrequest response object.
*) Change: r.parent property handler now returns "undefined"
instead of throwing exception if parent object is not available.
Core:
*) Feature: added Promise support. Implemented according to
the specification without: Promise.all(), Promise.allSettled(),
Promise.race().
*) Feature: added initial Typed-arrays support.
Thanks to Tiago Natel de Moura.
*) Feature: added ArrayBuffer support.
Thanks to Tiago Natel de Moura.
*) Feature: added initial Symbol support.
Thanks to Artem S. Povalyukhin.
*) Feature: added externals support for JSON.stringify().
*) Feature: added Object.is().
Thanks to Artem S. Povalyukhin.
*) Feature: added Object.setPrototypeOf().
Thanks to Artem S. Povalyukhin.
*) Feature: introduced nullish coalescing operator.
Thanks to Valentin Bartenev.
*) Bugfix: fixed Object.getPrototypeOf() according to the
specification.
*) Bugfix: fixed Object.prototype.valueOf() according to the
specification.
*) Bugfix: fixed JSON.stringify() with unprintable values and
replacer function.
*) Bugfix: fixed operator "in" according to the specification.
*) Bugfix: fixed Object.defineProperties() according to the
specification.
*) Bugfix: fixed Object.create() according to the specification.
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed Number.prototype.toString(radix) when
fast-math is enabled.
*) Bugfix: fixed RegExp() instance properties.
*) Bugfix: fixed import segfault.
Thanks to 洪志道 (Hong Zhi Dao).
Changes with njs 0.3.7 19 Nov 2019
nginx modules:
*) Improvement: refactored iteration over external objects.
Core:
*) Feature: added Object.assign().
*) Feature: added Array.prototype.copyWithin().
*) Feature: added support for labels in console.time().
*) Change: removed console.help() from CLI.
*) Improvement: moved constructors and top-level objects to
global object.
*) Improvement: arguments validation for configure script.
*) Improvement: refactored JSON methods.
*) Bugfix: fixed heap-buffer-overflow in njs_array_reverse_iterator()
function. The following functions were affected:
Array.prototype.lastIndexOf(), Array.prototype.reduceRight().
*) Bugfix: fixed [[Prototype]] slot of NativeErrors.
*) Bugfix: fixed NativeError.prototype.message properties.
*) Bugfix: added conversion of "this" value to object in
Array.prototype functions.
*) Bugfix: fixed iterator for Array.prototype.find() and
Array.prototype.findIndex() functions.
*) Bugfix: fixed Array.prototype.includes() and
Array.prototype.join() with "undefined" argument.
*) Bugfix: fixed "constructor" property of "Hash" and "Hmac"
objects.
*) Bugfix: fixed "__proto__" property of getters and setters.
*) Bugfix: fixed "Date" object string formatting.
*) Bugfix: fixed handling of NaN and -0 arguments in Math.min()
and Math.max().
*) Bugfix: fixed Math.round() according to the specification.
*) Bugfix: reimplemented "bound" functions according to
the specification.
Changes with njs 0.3.6 22 Oct 2019
nginx modules:
*) Improvement: getting special headers from r.headersIn.
Core:
*) Feature: added new Function() support.
*) Feature: added Number.prototype.toFixed().
*) Feature: added Number.prototype.toPrecision().
*) Feature: added Number.prototype.toExponential().
*) Improvement: making "prototype" property of function
instances writable.
*) Improvement: limiting recursion depth while compiling.
*) Improvement: moving global functions to the global object.
*) Bugfix: fixed prototype mutation for object literals.
*) Bugfix: fixed heap-buffer-overflow while parsing regexp literals.
*) Bugfix: fixed integer-overflow while parsing exponent
of number literals.
*) Bugfix: fixed parseFloat().
*) Bugfix: fixed Array.prototype functions according to the specification.
The following functions were fixed: every, includes, indexOf, filter,
find, findIndex, forEach, lastIndexOf, map, pop, push, reduce,
reduceRight, shift, some, unshift.
*) Bugfix: fixed handing of accessor descriptors in Object.freeze().
*) Bugfix: fixed String.prototype.replace() when first argument
is not a string.
*) Bugfix: fixed stack-use-after-scope in Array.prototype.map().
*) Bugfix: Date.prototype.toUTCString() format was aligned to ES9.
*) Bugfix: fixed buffer overflow in Number.prototype.toString(radix).
*) Bugfix: fixed Regexp.prototype.test() for regexps with backreferences.
*) Bugfix: fixed Array.prototype.map() for objects with nonexistent values.
*) Bugfix: fixed Array.prototype.pop() and shift() for sparse objects.
*) Bugfix: fixed Date.UTC() according to the specification.
*) Bugfix: fixed Date() constructor according to the specification.
*) Bugfix: fixed type of Date.prototype.
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed Date.prototype.setTime().
Thanks to Artem S. Povalyukhin.
*) Bugfix: fixed default number of arguments expected by built-in functions.
*) Bugfix: fixed "caller" and "arguments" properties of a function instance.
Thanks to Artem S. Povalyukhin.
Changes with njs 0.3.5 15 Aug 2019
Core:
*) Bugfix: fixed module importing using require(). The bug was
introduced in 0.3.4.
*) Bugfix: fixed [[SetPrototypeOf]].
Changes with njs 0.3.4 13 Aug 2019
Core:
*) Feature: added Object shorthand methods and computed property
names. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
*) Feature: added getter/setter literal support.
Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
*) Feature: added fs.renameSync().
*) Feature: added String.prototype.trimStart() and
String.prototype.trimEnd().
*) Improvement: added memory-sanitizer support.
*) Improvement: Unicode case tables updated to version 12.1.
*) Improvement: added UTF8 validation for string literals.
*) Bugfix: fixed reading files with zero size in fs.readFileSync().
*) Bugfix: extended the list of space separators in
String.prototype.trim().
*) Bugfix: fixed using of uninitialized value in
String.prototype.padStart().
*) Bugfix: fixed String.prototype.replace() for '$0' and '$&'
replacement string.
*) Bugfix: fixed String.prototype.replace() for byte strings with
regex argument.
*) Bugfix: fixed global match in String.prototype.replace()
with regexp argument.
*) Bugfix: fixed Array.prototype.slice() for primitive types.
*) Bugfix: fixed heap-buffer-overflow while importing module.
*) Bugfix: fixed UTF-8 character escaping.
*) Bugfix: fixed Object.values() and Object.entries() for shared
objects.
*) Bugfix: fixed uninitialized memory access in
String.prototype.match().
*) Bugfix: fixed String.prototype.match() for byte strings with
regex argument.
*) Bugfix: fixed Array.prototype.lastIndexOf() with undefined
arguments.
*) Bugfix: fixed String.prototype.substring() with empty substring.
*) Bugfix: fixed invalid memory access in
String.prototype.substring().
*) Bugfix: fixed String.fromCharCode() for code points > 65535
and NaN.
*) Bugfix: fixed String.prototype.toLowerCase() and
String.prototype.toUpperCase().
*) Bugfix: fixed Error() constructor with no arguments.
*) Bugfix: fixed "in" operator for values with accessor descriptors.
*) Bugfix: fixed Object.defineProperty() for non-boolean descriptor
props.
*) Bugfix: fixed Error.prototype.toString() with UTF8 string
properties.
*) Bugfix: fixed Error.prototype.toString() with non-string values
for "name" and "message".
Changes with njs 0.3.3 25 Jun 2019
nginx modules:
*) Improvement: getting of special response headers in headersOut.
*) Improvement: working with unknown methods in subrequest().
*) Improvement: added support for null as a second argument
of r.subrequest().
*) Bugfix: fixed processing empty output chain in stream body filter.
Core:
*) Feature: added runtime support for property getter/setter.
Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
*) Feature: added "process" global object.
*) Feature: writable most of built-in properties and methods.
*) Feature: added generic implementation of Array.prototype.fill().
*) Bugfix: fixed integer-overflow in String.prototype.concat().
*) Bugfix: fixed setting of object properties.
*) Bugfix: fixed Array.prototype.toString().
*) Bugfix: fixed Date.prototype.toJSON().
*) Bugfix: fixed overwriting "constructor" property of built-in
prototypes.
*) Bugfix: fixed processing of invalid surrogate pairs in strings.
*) Bugfix: fixed processing of invalid surrogate pairs in JSON
strings.
*) Bugfix: fixed heap-buffer-overflow in toUpperCase() and
toLowerCase().
*) Bugfix: fixed escaping lone closing square brackets in RegExp()
constructor.
*) Bugfix: fixed String.prototype.toBytes() for ASCII strings.
*) Bugfix: fixed handling zero byte characters inside RegExp
pattern strings.
*) Bugfix: fixed String.prototype.toBytes() for ASCII strings.
*) Bugfix: fixed truth value of JSON numbers in JSON.parse().
*) Bugfix: fixed use-of-uninitialized-value in
njs_string_replace_join().
*) Bugfix: fixed parseInt('-0').
Thanks to Artem S. Povalyukhin.
Changes with njs 0.3.2 21 May 2019
Core:
*) Feature: added support for template literals.
Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
*) Feature: executing command from command line arguments.
*) Feature: added support for RegExp "groups" object (ES9).
*) Feature: added block scoped function definitions support.
*) Feature: added support for building with GNU Readline library.
*) Feature: made configurable "length", "name", and most of built-in
methods.
*) Feature: made all constructor properties configurable.
*) Bugfix: fixed Regexp.prototype.exec() for Unicode-only regexps.
*) Bugfix: fixed njs_vm_value_dump() for empty string values.
*) Bugfix: fixed RegExp constructor for regexp value arguments.
*) Bugfix: fixed walking over prototypes chain during iteration
over an object.
*) Bugfix: fixed overflow in Array.prototype.concat().
*) Bugfix: fixed length calculation for UTF-8 string with escape
characters.
*) Bugfix: fixed parsing surrogate pair presents as UTF-16 escape
sequences.
*) Bugfix: fixed processing asterisk quantifier for
String.prototype.match().
*) Bugfix: fixed Date() constructor with one argument.
*) Bugfix: fixed arrays expansion.
*) Bugfix: fixed heap-buffer-overflow in String.prototype.replace().
*) Bugfix: fixed heap-buffer-overflow in
String.prototype.lastIndexOf().
*) Bugfix: fixed regexp literals parsing with escaped backslash and
backslash in square brackets.
*) Bugfix: fixed regexp literals with lone closing brackets.
*) Bugfix: fixed uninitialized-memory-access in
Object.defineProperties().
*) Bugfix: fixed processing "*" quantifier for
String.prototype.replace().
*) Bugfix: fixed Array.prototype.slice() for UTF8-invalid byte
strings.
*) Bugfix: fixed String.prototype.split() for UTF8-invalid byte
strings.
*) Bugfix: fixed handling of empty block statements.
Changes with njs 0.3.1 16 Apr 2019
Core:
*) Feature: added arrow functions support.
Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
*) Feature: added Object.getOwnPropertyNames().
Thanks to Artem S. Povalyukhin.
*) Feature: added Object.getOwnPropertyDescriptors().
Thanks to Artem S. Povalyukhin.
*) Feature: making __proto__ accessor descriptor of Object instances
mutable.
*) Feature: added shebang support in CLI.
*) Feature: added support for module mode execution in CLI. In module
mode global this is unavailable.
*) Bugfix: fixed editline detection.
*) Bugfix: fixed Function.prototype.bind().
Thanks to 洪志道 (Hong Zhi Dao).
*) Bugfix: fixed checking of duplication of parameters for functions.
Thanks to 洪志道 (Hong Zhi Dao).
*) Bugfix: fixed function declaration with the same name as a variable.
Thanks to 洪志道 (Hong Zhi Dao).
*) Improvement: code related to parsing of objects, variables and
functions is refactored.
Thanks to 洪志道 (Hong Zhi Dao).
*) Improvement: console.log() improved for outputting large values.
*) Improvement: console.log() improved for outputting strings in a
compliant way (without escaping and quotes).
*) Improvement: using ES6 version of ToInt32(), ToUint32(), ToLength().
Changes with njs 0.3.0 26 Mar 2019
nginx modules:
*) Feature: added js_path directive.
*) Change: returning undefined value instead of empty strings
for absent properties in the following objects: r.args,
r.headersIn, r.headersOut, r.variables, s.variables.
*) Change: returning undefined value instead of throwing an
exception for r.requestBody when request body is unavailable.
*) Bugfix: fixed crash while iterating over r.args when a value is
absent in a key-value pair.
Core:
*) Feature: added initial ES6 modules support. Default import and
default export statements are supported.
Thanks to 洪志道 (Hong Zhi Dao).
*) Feature: added Object.prototype.propertyIsEnumerable().
*) Feature: reporting file name and function name in disassembler
output.
*) Bugfix: fixed function redeclarations in interactive shell.
Thanks to 洪志道 (Hong Zhi Dao).
*) Bugfix: fixed RegExp literals parsing.
*) Bugfix: fixed setting length of UTF8 string in fs.readFileSync().
*) Bugfix: fixed nxt_file_dirname() for paths with no dir component.
Changes with njs 0.2.8 26 Feb 2019
nginx modules:
*) Change: properties of HTTP request deprecarted in 0.2.2 are
removed.
*) Feature: added support for delete operation in r.headersOut.
*) Feature: added support for setting nginx variables.
*) Bugfix: fixed r.subrequest() for empty body value.
*) Improvement: setting special response headers in r.headersOut.
Core:
*) Feature: added labels support.
*) Feature: added setImmediate() method.
*) Feature: added support for shorthand property names for Object
literals.
*) Bugfix: fixed Function.prototype.bind().
*) Bugfix: fixed parsing of string literals containing newline
characters.
*) Bugfix: fixed line number in reporting variable reference errors.
*) Bugfix: fixed creation of long UTF8 strings.
*) Bugfix: fixed String.prototype.split() for unicode strings.
*) Bugfix: fixed heap-buffer-overflow in String.prototype.split().
*) Bugfix: fixed Array.prototype.fill().
Thanks to Artem S. Povalyukhin.
*) Improvement: code related to function invocation is refactored.
Thanks to 洪志道 (Hong Zhi Dao).
*) Improvement: code related to variables is refactored.
Thanks to 洪志道 (Hong Zhi Dao).
*) Improvement: parser is refactored.
Thanks to 洪志道 (Hong Zhi Dao).
*) Improvement: reporting filenames in exceptions.
Changes with njs 0.2.7 25 Dec 2018
Core:
*) Feature: rest parameters syntax (destructuring is not supported).
Thanks to Alexander Pyshchev.
*) Feature: added Object.entries() method.
*) Feature: added Object.values() method.
*) Improvement: code generator refactored and simplified.
*) Bugfix: fixed automatic semicolon insertion.
*) Bugfix: fixed assignment expression from compound assignment.
*) Bugfix: fixed comparison of Byte and UTF8 strings.
*) Bugfix: fixed type of iteration variable in for-in with array
values.
*) Bugfix: fixed building on paltforms without librt.
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.6 27 Nov 2018
Core:
*) Feature: making built-in prototypes mutable.
*) Feature: making global object mutable.
*) Feature: console.time() and console.timeEnd() methods.
*) Feature: allowing variables and functions to be redeclared.
*) Feature: extending Object.defineProperty() spec conformance.
*) Feature: introduced quiet mode for CLI to handle simple expressions
from stdin.
*) Feature: introduced compact form of backtraces to handle stack
overflows.
*) Improvement: improved wording for various exceptions.
*) Bugfix: fixed closure values handling.
*) Bugfix: fixed equality operator for various value types.
*) Bugfix: fixed handling of "this" keyword in various scopes.
*) Bugfix: fixed handling non-object values in Object.keys().
*) Bugfix: fixed parsing of throw statement inside if statement.
*) Bugfix: fixed parsing of newline after throw statement.
*) Bugfix: fixed parsing of statements in if statement without newline.
*) Bugfix: fixed size uint32_t overflow in njs_array_expand().
*) Bugfix: fixed typeof operator for object_value type.
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.5 30 Oct 2018
nginx modules:
*) Bugfix: fixed counting pending events in stream module.
*) Bugfix: fixed s.off() in stream module.
*) Bugfix: fixed processing of data chunks in js_filter in stream module.
*) Bugfix: fixed http status and contentType getter in http module.
*) Bugfix: fixed http response and parent getters in http module.
Core:
*) Feature: arguments object support.
*) Feature: non-integer fractions support.
*) Improvement: handling non-array values in Array.prototype.slice().
*) Bugfix: fixed Array.prototype.length setter.
*) Bugfix: fixed njs_array_alloc() for length > 2**31.
*) Bugfix: handling int overflow in njs_array_alloc() on 32bit
archs.
*) Bugfix: fixed code size mismatch error message.
*) Bugfix: fixed delete operator in a loop.
*) Bugfix: fixed Object.getOwnPropertyDescriptor() for complex
object (inherited from Array and string values).
*) Bugfix: fixed Object.prototype.hasOwnProperty() for non-object
properties.
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.4 18 Aug 2018
nginx modules:
*) Change: stream module handlers are refactored.
New methods and properties:
s.on(), s.off(), s.allow(), s.done(), s.decline(),
s.deny().
Removed properties of Stream object:
s.OK, s.ABORT, s.AGAIN, s.DECLINED, s.ERROR (replaced
with s.allow(), s.done([code]), s.deny()).
s.buffer (for reading replaced with data argument of
the corresponding callback, for writing use s.send()).
s.fromUpstream (replaced with a callback for a corresponding
event).
s.eof (replaced with flags.last).
Core:
*) Feature: added Function.prototype.length.
*) Feature: introduced sandboxing mode.
*) Improvement: added exception strings where appropriate.
*) Improvement: improved wording for primitive type conversion
exception.
*) Bugfix: throwing TypeError for attempts to change frozen
properties.
*) Bugfix: fixed Object.defineProperty() for existing properties.
*) Bugfix: respecting the enumerable attribute while iterating
by for in.
*) Bugfix: respecting writable attribute for property handlers.
*) Bugfix: fixed exception handling in arguments of a function.
*) Bugfix: fixed Object.prototype.toString for different
value types.
*) Bugfix: fixed Object() constructor for object types arguments.
*) Bugfix: fixed comparison of objects and strings.
*) Bugfix: fixed String.slice() for undefined arguments.
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.3 31 Jul 2018
nginx modules:
*) Bugfix: making a subrequest from a Reply object caused
a segmentation fault.
*) Bugfix: getting the parent property of the main Request
object caused a segmentation fault.
Core:
*) Feature: added the pretty string representation for values.
*) Feature: correctly printing floating point numbers.
*) Feature: correctly parsing floating point numbers.
*) Feature: String.bytesFrom() method (decoding hex, base64,
base64url into a byte string).
*) Feature: String.padStart() and String.padEnd() methods.
*) Feature: added support of binary literals.
*) Improvement: added information about illegal token in number parsing.
*) Improvement: allowed uppercased O in octal literal values.
*) Improvement: added support for multiple arguments in console.log().
*) Bugfix: fixed applying call() to methods of external values.
*) Bugfix: fixed addition operator applied to an object.
*) Bugfix: fixed exception handling in njs_vm_value_to_ext_string().
*) Bugfix: fixed Number() with boolean, null and undefined arguments.
*) Bugfix: fixed error handling of setting non-numeric Array.length.
*) Bugfix: fixed autocompletion for global objects.
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.2 19 Jun 2018
nginx modules:
*) Change: merged HTTP Response and Reply into Request.
New members of Request:
req.status (res.status)
req.parent (reply.parent)
req.requestBody (req.body)
req.responseBody (reply.body)
req.headersIn (req.headers)
req.headersOut (res.headers)
req.sendHeader() (res.sendHeader())
req.send() (res.send())
req.finish() (res.finish())
req.return() (res.return())
Deprecated members of Request:
req.body (use req.requestBody or req.responseBody)
req.headers (use req.headersIn or req.headersOut)
req.response
Deprecated members of Response:
res.contentLength (use req.headersOut['Content-Length'])
res.contentType (use req.headersOut['Content-Type'])
The deprecated properties will be removed in the following
releases.
*) Feature: HTTP internalRedirect() method.
Core:
*) Bugfix: fixed heap-buffer-overflow in crypto.createHmac().
Changes with njs 0.2.1 31 May 2018
nginx modules:
*) Feature: HTTP request body getter.
*) Improvement: moved njs vm to the main configuration.
*) Improvement: improved logging for js_set and js_content directives.
*) Improvement: setting status code to 500 by default in
js_content handler.
*) Improvement: added the debug for the returned status code in
js_content.
*) Bugfix: fixed error logging in js_include.
Core:
*) Feature: added array length setter.
*) Improvement: public header cleanup. njscript.h is renamed to njs.h.
*) Bugfix: fixed crypto update() method after digest() is called.
*) Bugfix: fixed crypto.createHmac() for keys with size >= alg size
and < 64.
*) Bugfix: fixed JSON.stringify() for arrays with empty cells.
*) Bugfix: fixed exception type for unsupported types in
JSON.stringify().
*) Bugfix: fixed handling of undefined arguments of functions.
*) Bugfix: fixed handling of missing arg of
Object.getOwnPropertyDescriptor().
*) Bugfix: fixed handling of properties in
Object.getOwnPropertyDescriptor().
*) Bugfix: fixed the writeable flag of Array.length property.
*) Bugfix: fixed return value type of clearTimeout().
*) Bugfix: fixed njs_vm_external_bind().
*) Bugfix: miscellaneous additional bugs have been fixed.
Changes with njs 0.2.0 3 Apr 2018
*) Feature: reporting njs version by CLI.
*) Feature: textual description for type converting exceptions.
*) Feature: setTimeout() and clearTimeout() methods.
*) Feature: Byte string to hex, base64, base64url encodings.
*) Feature: Node.js style crypto methods.
*) Feature: HTTP and stream warn() and error() methods.
*) Feature: HTTP subrequest() method.
*) Feature: HTTP return() method.
*) Bugfix: miscellaneous bugs have been fixed in the core and
interactive shell.
Changes with njs 0.1.15 20 Nov 2017
*) Feature: Error, EvalError, InternalError, RangeError,
ReferenceError, SyntaxError, TypeError, URIError objects.
*) Feature: octal literals support.
*) Feature: File system access fs.readFile(), fs.readFileSync(),
fs.appendFile(), fs.appendFileSync(), fs.writeFile(),
fs.writeFileSync() methods.
*) Feature: nginx modules print backtrace on exception.
*) Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.1.14 09 Oct 2017
*) Feature: JSON object.
*) Feature: object level completions in interactive shell.
*) Feature: various configure improvements.
*) Bugfix: miscellaneous bugs have been fixed in the core and
interactive shell.
Changes with njs 0.1.13 31 Aug 2017
*) Feature: console.log() and console.help() methods in interactive
shell.
*) Feature: interactive shell prints backtrace on exception.
*) Feature: interactive shell by default if libedit is available.
*) Bugfix: processing of large files from stdin in command line mode.
*) Bugfix: improved editline detection.
Changes with njs 0.1.12 08 Aug 2017
*) Feature: Interactive shell.
*) Bugfix: in Object.isSealed().
Changes with njs 0.1.11 27 Jun 2017
*) Feature: Object.keys(), Object.prototype.hasOwnProperty() methods.
*) Feature: Object.defineProperty(), Object.defineProperties(),
Object.getOwnPropertyDescriptor() methods.
*) Feature: Object.getPrototypeOf(), Object.prototype.isPrototypeOf()
methods.
*) Feature: Object.preventExtensions(), Object.isExtensible(),
Object.freeze(), Object.isFrozen(), Object.seal(), Object.isSealed()
methods.
*) Feature: scientific notation literals support.
*) Feature: hexadecimal literals support.
*) Bugfix: processing of large array indexes.
*) Bugfix: in parseInt() and Date.parse().
Changes with njs 0.1.10 04 Apr 2017
*) Feature: nested functions and function closures.
*) Feature: Array.of(), Array.prototype.fill(), Array.prototype.find(),
Array.prototype.findIndex() methods.
*) Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.9 01 Feb 2017
*) Bugfix: global variables were not initialized when njs was used
in nginx.
Changes with njs 0.1.8 24 Jan 2017
*) Change: the "strict" mode is enforced, variables must be explicitly
declared.
*) Feature: "for" and "for-in" loops support variable declaration.
*) Bugfix: global and function scopes have been fixed.
*) Bugfix: now "for-in" loop does not discard the last value of property
variable.
*) Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.7 27 Dec 2016
*) Change: the "js_include" directive has been disabled at server and
location levels.
*) Feature: exponentiation operators.
*) Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.6 13 Dec 2016
*) Change: the "js_set" directive has been disabled at server and
location levels.
*) Feature: ES6 Math methods.
*) Bugfix: miscellaneous bugs and segmentation faults have been fixed.
|