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 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310 12311 12312 12313 12314 12315 12316 12317 12318 12319 12320 12321 12322 12323 12324 12325 12326 12327 12328 12329 12330 12331 12332 12333 12334 12335 12336 12337 12338 12339 12340 12341 12342 12343 12344 12345 12346 12347 12348 12349 12350 12351 12352 12353 12354 12355 12356 12357 12358 12359 12360 12361 12362 12363 12364 12365 12366 12367 12368 12369 12370 12371 12372 12373 12374 12375 12376 12377 12378 12379 12380 12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 12392 12393 12394 12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 12406 12407 12408 12409 12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 12421 12422 12423 12424 12425 12426 12427 12428 12429 12430 12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587 12588 12589 12590 12591 12592 12593 12594 12595 12596 12597 12598 12599 12600 12601 12602 12603 12604 12605 12606 12607 12608 12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000 13001 13002 13003 13004 13005 13006 13007 13008 13009 13010 13011 13012 13013 13014 13015 13016 13017 13018 13019 13020 13021 13022 13023 13024 13025 13026 13027 13028 13029 13030 13031 13032 13033 13034 13035 13036 13037 13038 13039 13040 13041 13042 13043 13044 13045 13046 13047 13048 13049 13050 13051 13052 13053 13054 13055 13056 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13086 13087 13088 13089 13090 13091 13092 13093 13094 13095 13096 13097 13098 13099 13100 13101 13102 13103 13104 13105 13106 13107 13108 13109 13110 13111 13112 13113 13114 13115 13116 13117 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 13132 13133 13134 13135 13136 13137 13138 13139 13140 13141 13142 13143 13144 13145 13146 13147 13148 13149 13150 13151 13152 13153 13154 13155 13156 13157 13158 13159 13160 13161 13162 13163 13164 13165 13166 13167 13168 13169 13170 13171 13172 13173 13174 13175 13176 13177 13178 13179 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 13197 13198 13199 13200 13201 13202 13203 13204 13205 13206 13207 13208 13209 13210 13211 13212 13213 13214 13215 13216 13217 13218 13219 13220 13221 13222 13223 13224 13225 13226 13227 13228 13229 13230 13231 13232 13233 13234 13235 13236 13237 13238 13239 13240 13241 13242 13243 13244 13245 13246 13247 13248 13249 13250 13251 13252 13253 13254 13255 13256 13257 13258 13259 13260 13261 13262 13263 13264 13265 13266 13267 13268 13269 13270 13271 13272 13273 13274 13275 13276 13277 13278 13279 13280 13281 13282 13283 13284 13285 13286 13287 13288 13289 13290 13291 13292 13293 13294 13295 13296 13297 13298 13299 13300 13301 13302 13303 13304 13305 13306 13307 13308 13309 13310 13311 13312 13313 13314 13315 13316 13317 13318 13319 13320 13321 13322 13323 13324 13325 13326 13327 13328 13329 13330 13331 13332 13333 13334 13335 13336 13337 13338 13339 13340 13341 13342 13343 13344 13345 13346 13347 13348 13349 13350 13351 13352 13353 13354 13355 13356 13357 13358 13359 13360 13361 13362 13363 13364 13365 13366 13367 13368 13369 13370 13371 13372 13373 13374 13375 13376 13377 13378 13379 13380 13381 13382 13383 13384 13385 13386 13387 13388 13389 13390 13391 13392 13393 13394 13395 13396 13397 13398 13399 13400 13401 13402 13403 13404 13405 13406 13407 13408 13409 13410 13411 13412 13413 13414 13415 13416 13417 13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520 13521 13522 13523 13524 13525 13526 13527 13528 13529 13530 13531 13532 13533 13534 13535 13536 13537 13538 13539 13540 13541 13542 13543 13544 13545 13546 13547 13548 13549 13550 13551 13552 13553 13554 13555 13556 13557 13558 13559 13560 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 13581 13582 13583 13584 13585 13586 13587 13588 13589 13590 13591 13592 13593 13594 13595 13596 13597 13598 13599 13600 13601 13602 13603 13604 13605 13606 13607 13608 13609 13610 13611 13612 13613 13614 13615 13616 13617 13618 13619 13620 13621 13622 13623 13624 13625 13626 13627 13628 13629 13630 13631 13632 13633 13634 13635 13636 13637 13638 13639 13640 13641 13642 13643 13644 13645 13646 13647 13648 13649 13650 13651 13652 13653 13654 13655 13656 13657 13658 13659 13660 13661 13662 13663 13664 13665 13666 13667 13668 13669 13670 13671 13672 13673 13674 13675 13676 13677 13678 13679 13680 13681 13682 13683 13684 13685 13686 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 13704 13705 13706 13707 13708 13709 13710 13711 13712 13713 13714 13715 13716 13717 13718 13719 13720 13721 13722 13723 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 13740 13741 13742 13743 13744 13745 13746 13747 13748 13749 13750 13751 13752 13753 13754 13755 13756 13757 13758 13759 13760 13761 13762 13763 13764 13765 13766 13767 13768 13769 13770 13771 13772 13773 13774 13775 13776 13777 13778 13779 13780 13781 13782 13783 13784 13785 13786 13787 13788 13789 13790 13791 13792 13793 13794 13795 13796 13797 13798 13799 13800 13801 13802 13803 13804 13805 13806 13807 13808 13809 13810 13811 13812 13813 13814 13815 13816 13817 13818 13819 13820 13821 13822 13823 13824 13825 13826 13827 13828 13829 13830 13831 13832 13833 13834 13835 13836 13837 13838 13839 13840 13841 13842 13843 13844 13845 13846 13847 13848 13849 13850 13851 13852 13853 13854 13855 13856 13857 13858 13859 13860 13861 13862 13863 13864 13865 13866 13867 13868 13869 13870 13871 13872 13873 13874 13875 13876 13877 13878 13879 13880 13881 13882 13883 13884 13885 13886 13887 13888 13889 13890 13891 13892 13893 13894 13895 13896 13897 13898 13899 13900 13901 13902 13903 13904 13905 13906 13907 13908 13909 13910 13911 13912 13913 13914 13915 13916 13917 13918 13919 13920 13921 13922 13923 13924 13925 13926 13927 13928 13929 13930 13931 13932 13933 13934 13935 13936 13937 13938 13939 13940 13941 13942 13943 13944 13945 13946 13947 13948 13949 13950 13951 13952 13953 13954 13955 13956 13957 13958 13959 13960 13961 13962 13963 13964 13965 13966 13967 13968 13969 13970 13971 13972 13973 13974 13975 13976 13977 13978 13979 13980 13981 13982 13983 13984 13985 13986 13987 13988 13989 13990 13991 13992 13993 13994 13995 13996 13997 13998 13999 14000 14001 14002 14003 14004 14005 14006 14007 14008 14009 14010 14011 14012 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 14025 14026 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 14043 14044 14045 14046 14047 14048 14049 14050 14051 14052 14053 14054 14055 14056 14057 14058 14059 14060 14061 14062 14063 14064 14065 14066 14067 14068 14069 14070 14071 14072 14073 14074 14075 14076 14077 14078 14079 14080 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 14096 14097 14098 14099 14100 14101 14102 14103 14104 14105 14106 14107 14108 14109 14110 14111 14112 14113 14114 14115 14116 14117 14118 14119 14120 14121 14122 14123 14124 14125 14126 14127 14128 14129 14130 14131 14132 14133 14134 14135 14136 14137 14138 14139 14140 14141 14142 14143 14144 14145 14146 14147 14148 14149 14150 14151 14152 14153 14154 14155 14156 14157 14158 14159 14160 14161 14162 14163 14164 14165 14166 14167 14168 14169 14170 14171 14172 14173 14174 14175 14176 14177 14178 14179 14180 14181 14182 14183 14184 14185 14186 14187 14188 14189 14190 14191 14192 14193 14194 14195 14196 14197 14198 14199 14200 14201 14202 14203 14204 14205 14206 14207 14208 14209 14210 14211 14212 14213 14214 14215 14216 14217 14218 14219 14220 14221 14222 14223 14224 14225 14226 14227 14228 14229 14230 14231 14232 14233 14234 14235 14236 14237 14238 14239 14240 14241 14242 14243 14244 14245 14246 14247 14248 14249 14250 14251 14252 14253 14254 14255 14256 14257 14258 14259 14260 14261 14262 14263 14264 14265 14266 14267 14268 14269 14270 14271 14272 14273 14274 14275 14276 14277 14278 14279 14280 14281 14282 14283 14284 14285 14286 14287 14288 14289 14290 14291 14292 14293 14294 14295 14296 14297 14298 14299 14300 14301 14302 14303 14304 14305 14306 14307 14308 14309 14310 14311 14312 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 14330 14331 14332 14333 14334 14335 14336 14337 14338 14339 14340 14341 14342 14343 14344 14345 14346 14347 14348 14349 14350 14351 14352 14353 14354 14355 14356 14357 14358 14359 14360 14361 14362 14363 14364 14365 14366 14367 14368 14369 14370 14371 14372 14373 14374 14375 14376 14377 14378 14379 14380 14381 14382 14383 14384 14385 14386 14387 14388 14389 14390 14391 14392 14393 14394 14395 14396 14397 14398 14399 14400 14401 14402 14403 14404 14405 14406 14407 14408 14409 14410 14411 14412 14413 14414 14415 14416 14417 14418 14419 14420 14421 14422 14423 14424 14425 14426 14427 14428 14429 14430 14431 14432 14433 14434 14435 14436 14437 14438 14439 14440 14441 14442 14443 14444 14445 14446 14447 14448 14449 14450 14451 14452 14453 14454 14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574 14575 14576 14577 14578 14579 14580 14581 14582 14583 14584 14585 14586 14587 14588 14589 14590 14591 14592 14593 14594 14595 14596 14597 14598 14599 14600 14601 14602 14603 14604 14605 14606 14607 14608 14609 14610 14611 14612 14613 14614 14615 14616 14617 14618 14619 14620 14621 14622 14623 14624 14625 14626 14627 14628 14629 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 14645 14646 14647 14648 14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 14659 14660 14661 14662 14663 14664 14665 14666 14667 14668 14669 14670 14671 14672 14673 14674 14675 14676 14677 14678 14679 14680 14681 14682 14683 14684 14685 14686 14687 14688 14689 14690 14691 14692 14693 14694 14695 14696 14697 14698 14699 14700 14701 14702 14703 14704 14705 14706 14707 14708 14709 14710 14711 14712 14713 14714 14715 14716 14717 14718 14719 14720 14721 14722 14723 14724 14725 14726 14727 14728 14729 14730 14731 14732 14733 14734 14735 14736 14737 14738 14739 14740 14741 14742 14743 14744 14745 14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844 14845 14846 14847 14848 14849 14850 14851 14852 14853 14854 14855 14856 14857 14858 14859 14860 14861 14862 14863 14864 14865 14866 14867 14868 14869 14870 14871 14872 14873 14874 14875 14876 14877 14878 14879 14880 14881 14882 14883 14884 14885 14886 14887 14888 14889 14890 14891 14892 14893 14894 14895 14896 14897 14898 14899 14900 14901 14902 14903 14904 14905 14906 14907 14908 14909 14910 14911 14912 14913 14914 14915 14916 14917 14918 14919 14920 14921 14922 14923 14924 14925 14926 14927 14928 14929 14930 14931 14932 14933 14934 14935 14936 14937 14938 14939 14940 14941 14942 14943 14944 14945 14946 14947 14948 14949 14950 14951 14952 14953 14954 14955 14956 14957 14958 14959 14960 14961 14962 14963 14964 14965 14966 14967 14968 14969 14970 14971 14972 14973 14974 14975 14976 14977 14978 14979 14980 14981 14982 14983 14984 14985 14986 14987 14988 14989 14990 14991 14992 14993 14994 14995 14996 14997 14998 14999 15000 15001 15002 15003 15004 15005 15006 15007 15008 15009 15010 15011 15012 15013 15014 15015 15016 15017 15018 15019 15020 15021 15022 15023 15024 15025 15026 15027 15028 15029 15030 15031 15032 15033 15034 15035 15036 15037 15038 15039 15040 15041 15042 15043 15044 15045 15046 15047 15048 15049 15050 15051 15052 15053 15054 15055 15056 15057 15058 15059 15060 15061 15062 15063 15064 15065 15066 15067 15068 15069 15070 15071 15072 15073 15074 15075 15076 15077 15078 15079 15080 15081 15082 15083 15084 15085 15086 15087 15088 15089 15090 15091 15092 15093 15094 15095 15096 15097 15098 15099 15100 15101 15102 15103 15104 15105 15106 15107 15108 15109 15110 15111 15112 15113 15114 15115 15116 15117 15118 15119 15120 15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 15149 15150 15151 15152 15153 15154 15155 15156 15157 15158 15159 15160 15161 15162 15163 15164 15165 15166 15167 15168 15169 15170 15171 15172 15173 15174 15175 15176 15177 15178 15179 15180 15181 15182 15183 15184 15185 15186 15187 15188 15189 15190 15191 15192 15193 15194 15195 15196 15197 15198 15199 15200 15201 15202 15203 15204 15205 15206 15207 15208 15209 15210 15211 15212 15213 15214 15215 15216 15217 15218 15219 15220 15221 15222 15223 15224 15225 15226 15227 15228 15229 15230 15231 15232 15233 15234 15235 15236 15237 15238 15239 15240 15241 15242 15243 15244 15245 15246 15247 15248 15249 15250 15251 15252 15253 15254 15255 15256 15257 15258 15259 15260 15261 15262 15263 15264 15265 15266 15267 15268 15269 15270 15271 15272 15273 15274 15275 15276 15277 15278 15279 15280 15281 15282 15283 15284 15285 15286 15287 15288 15289 15290 15291 15292 15293 15294 15295 15296 15297 15298 15299 15300 15301 15302 15303 15304 15305 15306 15307 15308 15309 15310 15311 15312 15313 15314 15315 15316 15317 15318 15319 15320 15321 15322 15323 15324 15325 15326 15327 15328 15329 15330 15331 15332 15333 15334 15335 15336 15337 15338 15339 15340 15341 15342 15343 15344 15345 15346 15347 15348 15349 15350 15351 15352 15353 15354 15355 15356 15357 15358 15359 15360 15361 15362 15363 15364 15365 15366 15367 15368 15369 15370 15371 15372 15373 15374 15375 15376 15377 15378 15379 15380 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397 15398 15399 15400 15401 15402 15403 15404 15405 15406 15407 15408 15409 15410 15411 15412 15413 15414 15415 15416 15417 15418 15419 15420 15421 15422 15423 15424 15425 15426 15427 15428 15429 15430 15431 15432 15433 15434 15435 15436 15437 15438 15439 15440 15441 15442 15443 15444 15445 15446 15447 15448 15449 15450 15451 15452 15453 15454 15455 15456 15457 15458 15459 15460 15461 15462 15463 15464 15465 15466 15467 15468 15469 15470 15471 15472 15473 15474 15475 15476 15477 15478 15479 15480 15481 15482 15483 15484 15485 15486 15487 15488 15489 15490 15491 15492 15493 15494 15495 15496 15497 15498 15499 15500 15501 15502 15503 15504 15505 15506 15507 15508 15509 15510 15511 15512 15513 15514 15515 15516 15517 15518 15519 15520 15521 15522 15523 15524 15525 15526 15527 15528 15529 15530 15531 15532 15533 15534 15535 15536 15537 15538 15539 15540 15541 15542 15543 15544 15545 15546 15547 15548 15549 15550 15551 15552 15553 15554 15555 15556 15557 15558 15559 15560 15561 15562 15563 15564 15565 15566 15567 15568 15569 15570 15571 15572 15573 15574 15575 15576 15577 15578 15579 15580 15581 15582 15583 15584 15585 15586 15587 15588 15589 15590 15591 15592 15593 15594 15595 15596 15597 15598 15599 15600 15601 15602 15603 15604 15605 15606 15607 15608 15609 15610 15611 15612 15613 15614 15615 15616 15617 15618 15619 15620 15621 15622 15623 15624 15625 15626 15627 15628 15629 15630 15631 15632 15633 15634 15635 15636 15637 15638 15639 15640 15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710 15711 15712 15713 15714 15715 15716 15717 15718 15719 15720 15721 15722 15723 15724 15725 15726 15727 15728 15729 15730 15731 15732 15733 15734 15735 15736 15737 15738 15739 15740 15741 15742 15743 15744 15745 15746 15747 15748 15749 15750 15751 15752 15753 15754 15755 15756 15757 15758 15759 15760 15761 15762 15763 15764 15765 15766 15767 15768 15769 15770 15771 15772 15773 15774 15775 15776 15777 15778 15779 15780 15781 15782 15783 15784 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797 15798 15799 15800 15801 15802 15803 15804 15805 15806 15807 15808 15809 15810 15811 15812 15813 15814 15815 15816 15817 15818 15819 15820 15821 15822 15823 15824 15825 15826 15827 15828 15829 15830 15831 15832 15833 15834 15835 15836 15837 15838 15839 15840 15841 15842 15843 15844 15845 15846 15847 15848 15849 15850 15851 15852 15853 15854 15855 15856 15857 15858 15859 15860 15861 15862 15863 15864 15865 15866 15867 15868 15869 15870 15871 15872 15873 15874 15875 15876 15877 15878 15879 15880 15881 15882 15883 15884 15885 15886 15887 15888 15889 15890 15891 15892 15893 15894 15895 15896 15897 15898 15899 15900 15901 15902 15903 15904 15905 15906 15907 15908 15909 15910 15911 15912 15913 15914 15915 15916 15917 15918 15919 15920 15921 15922 15923 15924 15925 15926 15927 15928 15929 15930 15931 15932 15933 15934 15935 15936 15937 15938 15939 15940 15941 15942 15943 15944 15945 15946 15947 15948 15949 15950 15951 15952 15953 15954 15955 15956 15957 15958 15959 15960 15961 15962 15963 15964 15965 15966 15967 15968 15969 15970 15971 15972 15973 15974 15975 15976 15977 15978 15979 15980 15981 15982 15983 15984 15985 15986 15987 15988 15989 15990 15991 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 16010 16011 16012 16013 16014 16015 16016 16017 16018 16019 16020 16021 16022 16023 16024 16025 16026 16027 16028 16029 16030 16031 16032 16033 16034 16035 16036 16037 16038 16039 16040 16041 16042 16043 16044 16045 16046 16047 16048 16049 16050 16051 16052 16053 16054 16055 16056 16057 16058 16059 16060 16061 16062 16063 16064 16065 16066 16067 16068 16069 16070 16071 16072 16073 16074 16075 16076 16077 16078 16079 16080 16081 16082 16083 16084 16085 16086 16087 16088 16089 16090 16091 16092 16093 16094 16095 16096 16097 16098 16099 16100 16101 16102 16103 16104 16105 16106 16107 16108 16109 16110 16111 16112 16113 16114 16115 16116 16117 16118 16119 16120 16121 16122 16123 16124 16125 16126 16127 16128 16129 16130 16131 16132 16133 16134 16135 16136 16137 16138 16139 16140 16141 16142 16143 16144 16145 16146 16147 16148 16149 16150 16151 16152 16153 16154 16155 16156 16157 16158 16159 16160 16161 16162 16163 16164 16165 16166 16167 16168 16169 16170 16171 16172 16173 16174 16175 16176 16177 16178 16179 16180 16181 16182 16183 16184 16185 16186 16187 16188 16189 16190 16191 16192 16193 16194 16195 16196 16197 16198 16199 16200 16201 16202 16203 16204 16205 16206 16207 16208 16209 16210 16211 16212 16213 16214 16215 16216 16217 16218 16219 16220 16221 16222 16223 16224 16225 16226 16227 16228 16229 16230 16231 16232 16233 16234 16235 16236 16237 16238 16239 16240 16241 16242 16243 16244 16245 16246 16247 16248 16249 16250 16251 16252 16253 16254 16255 16256 16257 16258 16259 16260 16261 16262 16263 16264 16265 16266 16267 16268 16269 16270 16271 16272 16273 16274 16275 16276 16277 16278 16279 16280 16281 16282 16283 16284 16285 16286 16287 16288 16289 16290 16291 16292 16293 16294 16295 16296 16297 16298 16299 16300 16301 16302 16303 16304 16305 16306 16307 16308 16309 16310 16311 16312 16313 16314 16315 16316 16317 16318 16319 16320 16321 16322 16323 16324 16325 16326 16327 16328 16329 16330 16331 16332 16333 16334 16335 16336 16337 16338 16339 16340 16341 16342 16343 16344 16345 16346 16347 16348 16349 16350 16351 16352 16353 16354 16355 16356 16357 16358 16359 16360 16361 16362 16363 16364 16365 16366 16367 16368 16369 16370 16371 16372 16373 16374 16375 16376 16377 16378 16379 16380 16381 16382 16383 16384 16385 16386 16387 16388 16389 16390 16391 16392 16393 16394 16395 16396 16397 16398 16399 16400 16401 16402 16403 16404 16405 16406 16407 16408 16409 16410 16411 16412 16413 16414 16415 16416 16417 16418 16419 16420 16421 16422 16423 16424 16425 16426 16427 16428 16429 16430 16431 16432 16433 16434 16435 16436 16437 16438 16439 16440 16441 16442 16443 16444 16445 16446 16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 16469 16470 16471 16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 16492 16493 16494 16495 16496 16497 16498 16499 16500 16501 16502 16503 16504 16505 16506 16507 16508 16509 16510 16511 16512 16513 16514 16515 16516 16517 16518 16519 16520 16521 16522 16523 16524 16525 16526 16527 16528 16529 16530 16531 16532 16533 16534 16535 16536 16537 16538 16539 16540 16541 16542 16543 16544 16545 16546 16547 16548 16549 16550 16551 16552 16553 16554 16555 16556 16557 16558 16559 16560 16561 16562 16563 16564 16565 16566 16567 16568 16569 16570 16571 16572 16573 16574 16575 16576 16577 16578 16579 16580 16581 16582 16583 16584 16585 16586 16587 16588 16589 16590 16591 16592 16593 16594 16595 16596 16597 16598 16599 16600 16601 16602 16603 16604 16605 16606 16607 16608 16609 16610 16611 16612 16613 16614 16615 16616 16617 16618 16619 16620 16621 16622 16623 16624 16625 16626 16627 16628 16629 16630 16631 16632 16633 16634 16635 16636 16637 16638 16639 16640 16641 16642 16643 16644 16645 16646 16647 16648 16649 16650 16651 16652 16653 16654 16655 16656 16657 16658 16659 16660 16661 16662 16663 16664 16665 16666 16667 16668 16669 16670 16671 16672 16673 16674 16675 16676 16677 16678 16679 16680 16681 16682 16683 16684 16685 16686 16687 16688 16689 16690 16691 16692 16693 16694 16695 16696 16697 16698 16699 16700 16701 16702 16703 16704 16705 16706 16707 16708 16709 16710 16711 16712 16713 16714 16715 16716 16717 16718 16719 16720 16721 16722 16723 16724 16725 16726 16727 16728 16729 16730 16731 16732 16733 16734 16735 16736 16737 16738 16739 16740 16741 16742 16743 16744 16745 16746 16747 16748 16749 16750 16751 16752 16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845 16846 16847 16848 16849 16850 16851 16852 16853 16854 16855 16856 16857 16858 16859 16860 16861 16862 16863 16864 16865 16866 16867 16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939 16940 16941 16942 16943 16944 16945 16946 16947 16948 16949 16950 16951 16952 16953 16954 16955 16956 16957 16958 16959 16960 16961 16962 16963 16964 16965 16966 16967 16968 16969 16970 16971 16972 16973 16974 16975 16976 16977 16978 16979 16980 16981 16982 16983 16984 16985 16986 16987 16988 16989 16990 16991 16992 16993 16994 16995 16996 16997 16998 16999 17000 17001 17002 17003 17004 17005 17006 17007 17008 17009 17010 17011 17012 17013 17014 17015 17016 17017 17018 17019 17020 17021 17022 17023 17024 17025 17026 17027 17028 17029 17030 17031 17032 17033 17034 17035 17036 17037 17038 17039 17040 17041 17042 17043 17044 17045 17046 17047 17048 17049 17050 17051 17052 17053 17054 17055 17056 17057 17058 17059 17060 17061 17062 17063 17064 17065 17066 17067 17068 17069 17070 17071 17072 17073 17074 17075 17076 17077 17078 17079 17080 17081 17082 17083 17084 17085 17086 17087 17088 17089 17090 17091 17092 17093 17094 17095 17096 17097 17098 17099 17100 17101 17102 17103 17104 17105 17106 17107 17108 17109 17110 17111 17112 17113 17114 17115 17116 17117 17118 17119 17120 17121 17122 17123 17124 17125 17126 17127 17128 17129 17130 17131 17132 17133 17134 17135 17136 17137 17138 17139 17140 17141 17142 17143 17144 17145 17146 17147 17148 17149 17150 17151 17152 17153 17154 17155 17156 17157 17158 17159 17160 17161 17162 17163 17164 17165 17166 17167 17168 17169 17170 17171 17172 17173 17174 17175 17176 17177 17178 17179 17180 17181 17182 17183 17184 17185 17186 17187 17188 17189 17190 17191 17192 17193 17194 17195 17196 17197 17198 17199 17200 17201 17202 17203 17204 17205 17206 17207 17208 17209 17210 17211 17212 17213 17214 17215 17216 17217 17218 17219 17220 17221 17222 17223 17224 17225 17226 17227 17228 17229 17230 17231 17232 17233 17234 17235 17236 17237 17238 17239 17240 17241 17242 17243 17244 17245 17246 17247 17248 17249 17250 17251 17252 17253 17254 17255 17256 17257 17258 17259 17260 17261 17262 17263 17264 17265 17266 17267 17268 17269 17270 17271 17272 17273 17274 17275 17276 17277 17278 17279 17280 17281 17282 17283 17284 17285 17286 17287 17288 17289 17290 17291 17292 17293 17294 17295 17296 17297 17298 17299 17300 17301 17302 17303 17304 17305 17306 17307 17308 17309 17310 17311 17312 17313 17314 17315 17316 17317 17318 17319 17320 17321 17322 17323 17324 17325 17326 17327 17328 17329 17330 17331 17332 17333 17334 17335 17336 17337 17338 17339 17340 17341 17342 17343 17344 17345 17346 17347 17348 17349 17350 17351 17352 17353 17354 17355 17356 17357 17358 17359 17360 17361 17362 17363 17364 17365 17366 17367 17368 17369 17370 17371 17372 17373 17374 17375 17376 17377 17378 17379 17380 17381 17382 17383 17384 17385 17386 17387 17388 17389 17390 17391 17392 17393 17394 17395 17396 17397 17398 17399 17400 17401 17402 17403 17404 17405 17406 17407 17408 17409 17410 17411 17412 17413 17414 17415 17416 17417 17418 17419 17420 17421 17422 17423 17424 17425 17426 17427 17428 17429 17430 17431 17432 17433 17434 17435 17436 17437 17438 17439 17440 17441 17442 17443 17444 17445 17446 17447 17448 17449 17450 17451 17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 17473 17474 17475 17476 17477 17478 17479 17480 17481 17482 17483 17484 17485 17486 17487 17488 17489 17490 17491 17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 17502 17503 17504 17505 17506 17507 17508 17509 17510 17511 17512 17513 17514 17515 17516 17517 17518 17519 17520 17521 17522 17523 17524 17525 17526 17527 17528 17529 17530 17531 17532 17533 17534 17535 17536 17537 17538 17539 17540 17541 17542 17543 17544 17545 17546 17547 17548 17549 17550 17551 17552 17553 17554 17555 17556 17557 17558 17559 17560 17561 17562 17563 17564 17565 17566 17567 17568 17569 17570 17571 17572 17573 17574 17575 17576 17577 17578 17579 17580 17581 17582 17583
|
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>ECMAScript Language Specification ECMA-262 6th Edition – DRAFT</title>
<link href="es6-draft.css" rel="stylesheet">
<script src="es6-draft-sections.js"></script>
</head>
<body>
<div id="unofficial">
<p><strong>This is <em>not</em> the official ECMAScript Language Specification.</strong></p>
<p>This is a draft of the next edition of the standard. See also:</p>
<ul>
<li><a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf">ECMAScript Language Specification,
Edition 5.1 (PDF)</a>, the most recent official, final standard.</li>
<li><a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts">The ES specification drafts archive</a> for
PDF and Word versions of this document, and older drafts.</li>
<li><a href="https://github.com/jorendorff/es-spec-html">The script that produced this web page</a>, and especially the <a
href="https://github.com/jorendorff/es-spec-html/issues?state=open">issue tracker — please file bugs when you find
them</a>. Patches are welcome too.</li>
</ul>
<p>For copyright information, see Ecma International’s legal disclaimer in the document itself.</p>
</div>
<hgroup>
<h1>Draft</h1>
<h1>ECMA-262</h1>
<h1>6<sup>th</sup> Edition / Draft March 17, 2015</h1>
<h1>Ecma/TC39/2015/0XX</h1>
</hgroup>
<hgroup>
<h1>ECMAScript 2015</h1>
<h1>Language Specification</h1>
<p>Draft<br>Release Candidate #3</p>
<p>Report Errors and Issues at: https://bugs.ecmascript.org</p>
<p>Product: Draft for 6th Edition</p>
<p>Component: choose an appropriate one</p>
<p>Version: Rev 36, March 17, 2015 Draft</p>
</hgroup>
<section id="contents">
<h1>Contents</h1>
</section>
<section>
<h1>Introduction</h1>
<p>This is the sixth edition of ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript
has grown to be one of the world’s most widely used general purpose programming languages. It is best known as the
language embedded in web browsers but has also been widely adopted for server and embedded applications. The sixth edition is
the most extensive update to ECMAScript since the publication of the first edition in 1997.</p>
<p>Goals for the sixth edition include providing better support for large applications, library creation, and for use of
ECMAScript as a compilation target for other languages. Some of its major enhancements include modules, class declarations,
lexical block scoping, iterators and generators, promises for asynchronous programming, destructuring patterns, and proper tail
calls. The ECMAScript library of built-ins has been expanded to support additional data abstractions including maps, sets, and
arrays of binary numeric values as well as additional support for Unicode supplemental characters in strings and regular
expressions. The built-ins are now extensible via subclassing.</p>
<p>Focused development of the sixth edition started in 2009, as the fifth edition was being prepared for publication. However,
this was preceded by significant experimentation and language enhancement design efforts dating to the publication of the third
edition in 1999. In a very real sense, the completion of the sixth edition is the culmination of a fifteen year effort. Dozens
of individuals representing many organizations have made very significant contributions within TC39 to the development of this
edition and to the prior editions. In addition, a vibrant informal community has emerged supporting TC39’s ECMAScript
efforts. This community has reviewed numerous drafts, filed thousands of bug reports, performed implementation experiments,
contributed test suites, and educated the world-wide developer community about ECMAScript. Unfortunately, it is impossible to
identify and acknowledge every person and organization who has contributed to this effort.</p>
<p>New uses and requirements for ECMAScript continue to emerge. The sixth edition provides the foundation for regular,
incremental language and library enhancements.</p>
<p>Allen Wirfs-Brock<br>ECMA-262, 6<sup>th</sup> Edition Project Editor</p>
<p>This Ecma Standard has been adopted by the General Assembly of <month> <year>.</p>
<p><b>ECMA-262 Edition History</b></p>
<p>This Ecma Standard is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript
(Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company’s Navigator 2.0
browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet
Explorer 3.0.</p>
<p>The development of this Standard started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma
General Assembly of June 1997.</p>
<p>That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international
standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it
fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.</p>
<p>The third edition of the Standard introduced powerful regular expressions, better string handling, new control statements,
try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation
future language growth. The third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999
and published as ISO/IEC 16262:2002 in June 2002.</p>
<p>After publication of the third edition, ECMAScript achieved massive adoption in conjunction with the World Wide Web where it
has become the programming language that is supported by essentially all web browsers. Significant work was done to develop a
fourth edition of ECMAScript. However, that work was not completed and not published as the fourth edition of ECMAScript but
some of it was incorporated into the development of the sixth edition.</p>
<p>The fifth edition of ECMAScript (published as ECMA-262 5<sup>th</sup> edition) codified de facto interpretations of the
language specification that have become common among browser implementations and added support for new features that had emerged
since the publication of the third edition. Such features include accessor properties, reflective creation and inspection of
objects, program control of property attributes, additional array manipulation functions, support for the JSON object encoding
format, and a strict mode that provides enhanced error checking and program security. The Fifth Edition was adopted by the Ecma
General Assembly of December 2009.</p>
<p>The Fifth Edition was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international
standard ISO/IEC 16262:2011. Edition 5.1 of the ECMAScript Standard incorporated minor corrections and is the same text as
ISO/IEC 16262:2011. The 5.1 Edition was adopted by the Ecma General Assembly of June 2011.</p>
<p><i>"DISCLAIMER</i></p>
<p><i>This draft document may be copied and furnished to others, and derivative works that comment on or otherwise explain it or
assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of
any kind, provided that the above copyright notice and this section are included on all such copies and derivative works.
However, this document itself may not be modified in any way, including by removing the copyright notice or references to Ecma
International, except as needed for the purpose of developing any document or deliverable produced by Ecma
International.</i></p>
<p><i>This disclaimer is valid only prior to final version of this document. After approval all rights on the standard are
reserved by Ecma International.</i></p>
<p><i>The limited permissions are granted through the standardization phase and will not be revoked by Ecma International or its
successors or assigns during this time.</i></p>
<p><i>This document and the information contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT
INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."</i></p>
</section>
<div class="inner-title">ECMAScript 2015 Language Specification</div>
<section id="sec-scope">
<h1><span class="secnum" id="sec-1"><a href="#sec-scope" title="link to this section">1</a></span> Scope</h1>
<p>This Standard defines the ECMAScript 2015 general purpose programming language.</p>
</section>
<section id="sec-conformance">
<h1><span class="secnum" id="sec-2"><a href="#sec-conformance" title="link to this section">2</a></span> Conformance</h1>
<p>A conforming implementation of ECMAScript must provide and support all the types, values, objects, properties, functions, and
program syntax and semantics described in this specification.</p>
<p>A conforming implementation of ECMAScript must interpret source text input in conformance with the Unicode Standard, Version
5.1.0 or later and ISO/IEC 10646. If the adopted ISO/IEC 10646-1 subset is not otherwise specified, it is presumed to be the
Unicode set, collection 10646.</p>
<p>A conforming implementation of ECMAScript that provides an application programming interface that supports programs that need
to adapt to the linguistic and cultural conventions used by different human languages and countries must implement the interface
defined by the most recent edition of ECMA-402 that is compatible with this specification.</p>
<p>A conforming implementation of ECMAScript may provide additional types, values, objects, properties, and functions beyond
those described in this specification. In particular, a conforming implementation of ECMAScript may provide properties not
described in this specification, and values for those properties, for objects that are described in this specification.</p>
<p>A conforming implementation of ECMAScript may support program and regular expression syntax not described in this
specification. In particular, a conforming implementation of ECMAScript may support program syntax that makes use of the
“future reserved words” listed in <a href="#sec-future-reserved-words">subclause 11.6.2.2</a> of this
specification.</p>
<p>A conforming implementation of ECMAScript must not implement any extension that is listed as a Forbidden Extension in <a
href="#sec-forbidden-extensions">subclause 16.1</a>.</p>
</section>
<section id="sec-normative-references">
<h1><span class="secnum" id="sec-3"><a href="#sec-normative-references" title="link to this section">3</a></span> Normative
references</h1>
<p>The following referenced documents are indispensable for the application of this document. For dated references, only the
edition cited applies. For undated references, the latest edition of the referenced document (including any amendments)
applies.</p>
<p class="formal-reference">IEEE Std 754-2008: <i>IEEE Standard for Floating-Point Arithmetic</i>. Institute of Electrical and
Electronic Engineers, New York (2008)</p>
<p class="formal-reference">ISO/IEC 10646:2003: <i>Information Technology – Universal Multiple-Octet Coded Character Set
(UCS) plus Amendment 1:2005, Amendment 2:2006, Amendment 3:2008, and Amendment 4:2008</i>, plus additional amendments and
corrigenda, or successor</p>
<p class="formal-reference"><i>The Unicode Standard, Version 5.0</i>, as amended by Unicode 5.1.0, or successor.<br><a
href="http://www.unicode.org/versions/latest">http://www.unicode.org/versions/latest</a></p>
<p class="formal-reference"><i>Unicode Standard Annex #15, Unicode Normalization Forms, version Unicode 5.1.0</i>, or
successor.<br><a href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a></p>
<p class="formal-reference"><i>Unicode Standard Annex #31, Unicode Identifiers and Pattern Syntax, version Unicode 5.1.0</i>, or
successor. <a href="http://www.unicode.org/reports/tr31/">http://www.unicode.org/reports/tr31/</a></p>
<p>ECMA-402, <i>ECMAScript 2015 Internationalization API Specification</i>.<br><a
href="http://www.ecma-international.org/publications/standards/Ecma-402.htm">http://www.ecma-international.org/publications/standards/Ecma-402.htm</a></p>
<p>ECMA-404, <i>The JSON Data Interchange Format</i>.<br><a
href="http://www.ecma-international.org/publications/standards/Ecma-404.htm">http://www.ecma-international.org/publications/standards/Ecma-404.htm</a></p>
</section>
<section id="sec-overview">
<div class="front">
<h1><span class="secnum" id="sec-4"><a href="#sec-overview" title="link to this section">4</a></span> Overview</h1>
<p>This section contains a non-normative overview of the ECMAScript language.</p>
<p>ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects
within a host environment. ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are
no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the
computational environment of an ECMAScript program will provide not only the objects and other facilities described in this
specification but also certain environment-specific objects, whose description and behaviour are beyond the scope of this
specification except to indicate that they may provide certain properties that can be accessed and certain functions that can
be called from an ECMAScript program.</p>
<p>ECMAScript was originally designed to be used as a scripting language, but has become widely used as a general purpose
programming language. A <b><i>scripting language</i></b> is a programming language that is used to manipulate, customize, and
automate the facilities of an existing system. In such systems, useful functionality is already available through a user
interface, and the scripting language is a mechanism for exposing that functionality to program control. In this way, the
existing system is said to provide a host environment of objects and facilities, which completes the capabilities of the
scripting language. A scripting language is intended for use by both professional and non-professional programmers.</p>
<p>ECMAScript was originally designed to be a <b><i>Web scripting language</i></b>, providing a mechanism to enliven Web pages
in browsers and to perform server computation as part of a Web-based client-server architecture. ECMAScript is now used to
provide core scripting capabilities for a variety of host environments. Therefore the core language is specified in this
document apart from any particular host environment.</p>
<p>ECMAScript usage has moved beyond simple scripting and it is now used for the full spectrum of programming tasks in many
different environments and scales. As the usage of ECMAScript has expanded, so has the features and facilities it provides.
ECMAScript is now a fully featured general propose programming language.</p>
<p>Some of the facilities of ECMAScript are similar to those used in other programming languages; in particular C,
Java™, Self, and Scheme as described in:</p>
<p>ISO/IEC 9899:1996, Programming Languages – C.</p>
<p class="formal-reference">Gosling, James, Bill Joy and Guy Steele. <span class="book-title">The Java™ Language
Specification</span>. Addison Wesley Publishing Co., 1996.</p>
<p class="formal-reference">Ungar, David, and Smith, Randall B. <span class="book-title">Self: The Power of Simplicity</span>.
OOPSLA '87 Conference Proceedings, pp. 227–241, Orlando, FL, October 1987.</p>
<p class="formal-reference"><span class="book-title">IEEE Standard for the Scheme Programming Language</span>. IEEE Std
1178-1990.</p>
</div>
<section id="sec-web-scripting">
<h1><span class="secnum" id="sec-4.1"><a href="#sec-web-scripting" title="link to this section">4.1</a></span> Web
Scripting</h1>
<p>A web browser provides an ECMAScript host environment for client-side computation including, for instance, objects that
represent windows, menus, pop-ups, dialog boxes, text areas, anchors, frames, history, cookies, and input/output. Further, the
host environment provides a means to attach scripting code to events such as change of focus, page and image loading,
unloading, error and abort, selection, form submission, and mouse actions. Scripting code appears within the HTML and the
displayed page is a combination of user interface elements and fixed and computed text and images. The scripting code is
reactive to user interaction and there is no need for a main program.</p>
<p>A web server provides a different host environment for server-side computation including objects representing requests,
clients, and files; and mechanisms to lock and share data. By using browser-side and server-side scripting together, it is
possible to distribute computation between the client and server while providing a customized user interface for a Web-based
application.</p>
<p>Each Web browser and server that supports ECMAScript supplies its own host environment, completing the ECMAScript execution
environment.</p>
</section>
<section id="sec-ecmascript-overview">
<div class="front">
<h1><span class="secnum" id="sec-4.2"><a href="#sec-ecmascript-overview" title="link to this section">4.2</a></span>
ECMAScript Overview</h1>
<p>The following is an informal overview of ECMAScript—not all parts of the language are described. This overview is
not part of the standard proper.</p>
<p>ECMAScript is object-based: basic language and host facilities are provided by objects, and an ECMAScript program is a
cluster of communicating objects. In ECMAScript, an <b><i>object</i></b> is a collection of zero or more
<b><i>properties</i></b> each with <b><i>attributes</i></b> that determine how each property can be used—for example,
when the Writable attribute for a property is set to <b>false</b>, any attempt by executed ECMAScript code to assign a
different value to the property fails. Properties are containers that hold other objects, <b><i>primitive values</i></b>, or
<b><i>functions</i></b>. A primitive value is a member of one of the following built-in types: <b>Undefined</b>,
<b>Null</b>, <b>Boolean</b>, <b>Number</b>, <b>String,</b> and <b>Symbol;</b> an object is a member of the built-in type
<b>Object</b>; and a function is a callable object. A function that is associated with an object via a property is called a
<b><i>method</i></b>.</p>
<p>ECMAScript defines a collection of <b><i>built-in objects</i></b> that round out the definition of ECMAScript entities.
These built-in objects include the global object; objects that are fundamental to the runtime semantics of the language
including <b>Object</b>, <b>Function</b>, <b>Boolean</b>, <b>Symbol</b>, and various <b>Error</b> objects; objects that
represent and manipulate numeric values including <b>Math</b>, <b>Number</b>, and <b>Date</b>; the text processing objects
<b>String</b> and <b>RegExp</b>; objects that are indexed collections of values including <b>Array</b> and nine different
kinds of Typed Arrays whose elements all have a specific numeric data representation; keyed collections including <b>Map</b>
and <b>Set</b> objects; objects supporting structured data including the <b>JSON</b> object, <b>ArrayBuffer</b>, and
<b>DataView</b>; objects supporting control abstractions including generator functions and <b>Promise</b> objects;
and<b>,</b> reflection objects including <b>Proxy</b> and <b>Reflect</b>.</p>
<p>ECMAScript also defines a set of built-in <b><i>operators</i></b>. ECMAScript operators include various unary operations,
multiplicative operators, additive operators, bitwise shift operators, relational operators, equality operators, binary
bitwise operators, binary logical operators, assignment operators, and the comma operator.</p>
<p>Large ECMAScript programs are supported by <b><i>modules</i></b> which allow a program to be divided into multiple
sequences of statements and declarations. Each module explicitly identifies declarations it uses that need to be provided by
other modules and which of its declarations are available for use by other modules.</p>
<p>ECMAScript syntax intentionally resembles Java syntax. ECMAScript syntax is relaxed to enable it to serve as an
easy-to-use scripting language. For example, a variable is not required to have its type declared nor are types associated
with properties, and defined functions are not required to have their declarations appear textually before calls to
them.</p>
</div>
<section id="sec-objects">
<h1><span class="secnum" id="sec-4.2.1"><a href="#sec-objects" title="link to this section">4.2.1</a></span> Objects</h1>
<p>Even though ECMAScript includes syntax for class definitions, ECMAScript objects are not fundamentally class-based such
as those in C++, Smalltalk, or Java. Instead objects may be created in various ways including via a literal notation or via
<b><i>constructors</i></b> which create objects and then execute code that initializes all or part of them by assigning
initial values to their properties. Each constructor is a function that has a property named <code>"prototype"</code> that
is used to implement <b><i>prototype-based inheritance</i></b> and <b><i>shared properties</i></b>. Objects are created by
using constructors in <b>new</b> expressions; for example, <code>new Date(2009,11)</code> creates a new Date object.
Invoking a constructor without using <b>new</b> has consequences that depend on the constructor. For example,
<code>Date()</code> produces a string representation of the current date and time rather than an object.</p>
<p>Every object created by a constructor has an implicit reference (called the object’s <i>prototype</i>) to the value
of its constructor’s <code>"prototype"</code> property. Furthermore, a prototype may have a non-null implicit
reference to its prototype, and so on; this is called the <i>prototype chain</i>. When a reference is made to a property in
an object, that reference is to the property of that name in the first object in the prototype chain that contains a
property of that name. In other words, first the object mentioned directly is examined for such a property; if that object
contains the named property, that is the property to which the reference refers; if that object does not contain the named
property, the prototype for that object is examined next; and so on.</p>
<figure>
<object data="figure-1.svg" height="354" type="image/svg+xml" width="719">
<img alt="An image of lots of boxes and arrows." height="354" src="figure-1.png" width="719">
</object>
<figcaption>Figure 1 — Object/Prototype Relationships</figcaption>
</figure>
<p>In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and
inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while
structure, behaviour, and state are all inherited.</p>
<p>All objects that do not directly contain a particular property that their prototype contains share that property and its
value. Figure 1 illustrates this:</p>
<p><b>CF</b> is a constructor (and also an object). Five objects have been created by using <code>new</code> expressions:
<b>cf<sub>1</sub></b>, <b>cf<sub>2</sub></b>, <b>cf<sub>3</sub></b>, <b>cf<sub>4</sub></b>, and <b>cf<sub>5</sub></b>. Each
of these objects contains properties named <code>q1</code> and <code>q2</code>. The dashed lines represent the implicit
prototype relationship; so, for example, <b>cf<sub>3</sub></b>’s prototype is <b>CF<sub>p</sub></b>. The constructor,
<b>CF</b>, has two properties itself, named <code>P1</code> and <code>P2</code>, which are not visible to
<b>CF<sub>p</sub></b>, <b>cf<sub>1</sub></b>, <b>cf<sub>2</sub></b>, <b>cf<sub>3</sub></b>, <b>cf<sub>4</sub></b>, or
<b>cf<sub>5</sub></b>. The property named <code>CFP1</code> in <b>CF<sub>p</sub></b> is shared by <b>cf<sub>1</sub></b>,
<b>cf<sub>2</sub></b>, <b>cf<sub>3</sub></b>, <b>cf<sub>4</sub></b>, and <b>cf<sub>5</sub></b> (but not by <b>CF</b>), as
are any properties found in <b>CF<sub>p</sub></b>’s implicit prototype chain that are not named <code>q1</code>,
<code>q2</code>, or <code>CFP1</code>. Notice that there is no implicit prototype link between <b>CF</b> and
<b>CF<sub>p</sub></b>.</p>
<p>Unlike most class-based object languages, properties can be added to objects dynamically by assigning values to them.
That is, constructors are not required to name or assign values to all or any of the constructed object’s properties.
In the above diagram, one could add a new shared property for <b>cf<sub>1</sub></b>, <b>cf<sub>2</sub></b>,
<b>cf<sub>3</sub></b>, <b>cf<sub>4</sub></b>, and <b>cf<sub>5</sub></b> by assigning a new value to the property in
<b>CF<sub>p</sub></b>.</p>
<p>Although ECMAScript objects are not inherently class-based, it is often convenient to define class-like abstractions
based upon a common pattern of constructor functions, prototype objects, and methods. The ECMAScript built-in objects
themselves follow such a class-like pattern. Beginning with the sixth edition, the ECMAScript language includes syntactic
class definitions that permit programmers to concisely define objects that conform to the same class-like abstraction
pattern used by the built-in objects.</p>
</section>
<section id="sec-strict-variant-of-ecmascript">
<h1><span class="secnum" id="sec-4.2.2"><a href="#sec-strict-variant-of-ecmascript"
title="link to this section">4.2.2</a></span> The Strict Variant of ECMAScript</h1>
<p>The ECMAScript Language recognizes the possibility that some users of the language may wish to restrict their usage of
some features available in the language. They might do so in the interests of security, to avoid what they consider to be
error-prone features, to get enhanced error checking, or for other reasons of their choosing. In support of this
possibility, ECMAScript defines a strict variant of the language. The strict variant of the language excludes some specific
syntactic and semantic features of the regular ECMAScript language and modifies the detailed semantics of some features. The
strict variant also specifies additional error conditions that must be reported by throwing error exceptions in situations
that are not specified as errors by the non-strict form of the language.</p>
<p>The strict variant of ECMAScript is commonly referred to as the <i>strict mode</i> of the language. Strict mode selection
and use of the strict mode syntax and semantics of ECMAScript is explicitly made at the level of individual ECMAScript
source text units. Because strict mode is selected at the level of a syntactic source text unit, strict mode only imposes
restrictions that have local effect within such a source text unit. Strict mode does not restrict or modify any aspect of
the ECMAScript semantics that must operate consistently across multiple source text units. A complete ECMAScript program may
be composed of both strict mode and non-strict mode ECMAScript source text units. In this case, strict mode only applies
when actually executing code that is defined within a strict mode source text unit.</p>
<p>In order to conform to this specification, an ECMAScript implementation must implement both the full unrestricted
ECMAScript language and the strict variant of the ECMAScript language as defined by this specification. In addition, an
implementation must support the combination of unrestricted and strict mode source text units into a single composite
program.</p>
</section>
</section>
<section id="sec-terms-and-definitions">
<div class="front">
<h1><span class="secnum" id="sec-4.3"><a href="#sec-terms-and-definitions" title="link to this section">4.3</a></span> Terms
and definitions</h1>
<p>For the purposes of this document, the following terms and definitions apply.</p>
</div>
<section id="sec-type">
<h1><span class="secnum" id="sec-4.3.1"><a href="#sec-type" title="link to this section">4.3.1</a></span> type</h1>
<p>set of data values as defined in <a href="#sec-ecmascript-data-types-and-values">clause 6</a> of this specification</p>
</section>
<section id="sec-primitive-value">
<h1><span class="secnum" id="sec-4.3.2"><a href="#sec-primitive-value" title="link to this section">4.3.2</a></span>
primitive value</h1>
<p>member of one of the types Undefined, Null, Boolean, Number, Symbol, or String as defined in <a
href="#sec-ecmascript-data-types-and-values">clause 6</a></p>
<div class="note">
<p><span class="nh">NOTE</span> A primitive value is a datum that is represented directly at the lowest level of the
language implementation.</p>
</div>
</section>
<section id="sec-terms-and-definitions-object">
<h1><span class="secnum" id="sec-4.3.3"><a href="#sec-terms-and-definitions-object"
title="link to this section">4.3.3</a></span> object</h1>
<p>member of the type Object</p>
<div class="note">
<p><span class="nh">NOTE</span> An object is a collection of properties and has a single prototype object. The prototype
may be the null value.</p>
</div>
</section>
<section id="sec-constructor">
<h1><span class="secnum" id="sec-4.3.4"><a href="#sec-constructor" title="link to this section">4.3.4</a></span>
constructor</h1>
<p>function object that creates and initializes objects</p>
<div class="note">
<p><span class="nh">NOTE</span> The value of a constructor’s <code>prototype</code> property is a prototype object
that is used to implement inheritance and shared properties.</p>
</div>
</section>
<section id="sec-terms-and-definitions-prototype">
<h1><span class="secnum" id="sec-4.3.5"><a href="#sec-terms-and-definitions-prototype"
title="link to this section">4.3.5</a></span> prototype</h1>
<p>object that provides shared properties for other objects</p>
<div class="note">
<p><span class="nh">NOTE</span> When a constructor creates an object, that object implicitly references the
constructor’s <code>prototype</code> property for the purpose of resolving property references. The
constructor’s <code>prototype</code> property can be referenced by the program expression
<code><i>constructor</i><b>.prototype</b></code>, and properties added to an object’s prototype are shared, through
inheritance, by all objects sharing the prototype. Alternatively, a new object may be created with an explicitly specified
prototype by using the <code><a href="#sec-object.create">Object.create</a></code> built-in function.</p>
</div>
</section>
<section id="sec-ordinary-object">
<h1><span class="secnum" id="sec-4.3.6"><a href="#sec-ordinary-object" title="link to this section">4.3.6</a></span>
ordinary object</h1>
<p>object that has the default behaviour for the essential internal methods that must be supported by all objects.</p>
</section>
<section id="sec-exotic-object">
<h1><span class="secnum" id="sec-4.3.7"><a href="#sec-exotic-object" title="link to this section">4.3.7</a></span> exotic
object</h1>
<p>object that does not have the default behaviour for one or more of the essential internal methods that must be supported
by all objects.</p>
<div class="note">
<p><span class="nh">NOTE</span> Any object that is not an ordinary object is an exotic object.</p>
</div>
</section>
<section id="sec-standard-object">
<h1><span class="secnum" id="sec-4.3.8"><a href="#sec-standard-object" title="link to this section">4.3.8</a></span>
standard object</h1>
<p>object whose semantics are defined by this specification</p>
</section>
<section id="sec-built-in-object">
<h1><span class="secnum" id="sec-4.3.9"><a href="#sec-built-in-object" title="link to this section">4.3.9</a></span>
built-in object</h1>
<p>object specified and supplied by an ECMAScript implementation</p>
<div class="note">
<p><span class="nh">NOTE</span> Standard built-in objects are defined in this specification. An ECMAScript implementation
may specify and supply additional kinds of built-in objects. A <i>built-in constructor</i> is a built-in object that is
also a constructor.</p>
</div>
</section>
<section id="sec-undefined-value">
<h1><span class="secnum" id="sec-4.3.10"><a href="#sec-undefined-value" title="link to this section">4.3.10</a></span>
undefined value</h1>
<p>primitive value used when a variable has not been assigned a value</p>
</section>
<section id="sec-terms-and-definitions-undefined-type">
<h1><span class="secnum" id="sec-4.3.11"><a href="#sec-terms-and-definitions-undefined-type"
title="link to this section">4.3.11</a></span> Undefined type</h1>
<p>type whose sole value is the <b>undefined</b> value</p>
</section>
<section id="sec-null-value">
<h1><span class="secnum" id="sec-4.3.12"><a href="#sec-null-value" title="link to this section">4.3.12</a></span> null
value</h1>
<p>primitive value that represents the intentional absence of any object value</p>
</section>
<section id="sec-terms-and-definitions-null-type">
<h1><span class="secnum" id="sec-4.3.13"><a href="#sec-terms-and-definitions-null-type"
title="link to this section">4.3.13</a></span> Null type</h1>
<p>type whose sole value is the null value</p>
</section>
<section id="sec-terms-and-definitions-boolean-value">
<h1><span class="secnum" id="sec-4.3.14"><a href="#sec-terms-and-definitions-boolean-value"
title="link to this section">4.3.14</a></span> Boolean value</h1>
<p>member of the Boolean type</p>
<div class="note">
<p><span class="nh">NOTE</span> There are only two Boolean values, <b>true</b> and <b>false</b></p>
</div>
</section>
<section id="sec-terms-and-definitions-boolean-type">
<h1><span class="secnum" id="sec-4.3.15"><a href="#sec-terms-and-definitions-boolean-type"
title="link to this section">4.3.15</a></span> Boolean type</h1>
<p>type consisting of the primitive values <b>true</b> and <b>false</b></p>
</section>
<section id="sec-boolean-object">
<h1><span class="secnum" id="sec-4.3.16"><a href="#sec-boolean-object" title="link to this section">4.3.16</a></span>
Boolean object</h1>
<p>member of the Object type that is an instance of the standard built-in <code>Boolean</code> constructor</p>
<div class="note">
<p><span class="nh">NOTE</span> A Boolean object is created by using the <code>Boolean</code> constructor in a
<code>new</code> expression, supplying a Boolean value as an argument. The resulting object has an <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> whose value is the Boolean value. A Boolean
object can be coerced to a Boolean value.</p>
</div>
</section>
<section id="sec-terms-and-definitions-string-value">
<h1><span class="secnum" id="sec-4.3.17"><a href="#sec-terms-and-definitions-string-value"
title="link to this section">4.3.17</a></span> String value</h1>
<p>primitive value that is a finite ordered sequence of zero or more 16-bit unsigned integer</p>
<div class="note">
<p><span class="nh">NOTE</span> A String value is a member of the String type. Each integer value in the sequence usually
represents a single 16-bit unit of UTF-16 text. However, ECMAScript does not place any restrictions or requirements on the
values except that they must be 16-bit unsigned integers.</p>
</div>
</section>
<section id="sec-terms-and-definitions-string-type">
<h1><span class="secnum" id="sec-4.3.18"><a href="#sec-terms-and-definitions-string-type"
title="link to this section">4.3.18</a></span> String type</h1>
<p>set of all possible String values</p>
</section>
<section id="sec-string-object">
<h1><span class="secnum" id="sec-4.3.19"><a href="#sec-string-object" title="link to this section">4.3.19</a></span> String
object</h1>
<p>member of the Object type that is an instance of the standard built-in <code>String</code> constructor</p>
<div class="note">
<p><span class="nh">NOTE</span> A String object is created by using the <code>String</code> constructor in a
<code>new</code> expression, supplying a String value as an argument. The resulting object has an <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> whose value is the String value. A String object
can be coerced to a String value by calling the <code>String</code> constructor as a function (<a
href="#sec-string-constructor-string-value">21.1.1.1</a>).</p>
</div>
</section>
<section id="sec-terms-and-definitions-number-value">
<h1><span class="secnum" id="sec-4.3.20"><a href="#sec-terms-and-definitions-number-value"
title="link to this section">4.3.20</a></span> Number value</h1>
<p>primitive value corresponding to a double-precision 64-bit binary format IEEE 754 value</p>
<div class="note">
<p><span class="nh">NOTE</span> A Number value is a member of the Number type and is a direct representation of a
number.</p>
</div>
</section>
<section id="sec-terms-and-definitions-number-type">
<h1><span class="secnum" id="sec-4.3.21"><a href="#sec-terms-and-definitions-number-type"
title="link to this section">4.3.21</a></span> Number type</h1>
<p>set of all possible Number values including the special “Not-a-Number” (NaN) value, positive infinity, and
negative infinity</p>
</section>
<section id="sec-number-object">
<h1><span class="secnum" id="sec-4.3.22"><a href="#sec-number-object" title="link to this section">4.3.22</a></span> Number
object</h1>
<p>member of the Object type that is an instance of the standard built-in <code>Number</code> constructor</p>
<div class="note">
<p><span class="nh">NOTE</span> A Number object is created by using the <code>Number</code> constructor in a
<code>new</code> expression, supplying a Number value as an argument. The resulting object has an <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> whose value is the Number value. A Number object
can be coerced to a Number value by calling the <code>Number</code> constructor as a function (<a
href="#sec-number-constructor-number-value">20.1.1.1</a>).</p>
</div>
</section>
<section id="sec-terms-and-definitions-infinity">
<h1><span class="secnum" id="sec-4.3.23"><a href="#sec-terms-and-definitions-infinity"
title="link to this section">4.3.23</a></span> Infinity</h1>
<p>number value that is the positive infinite Number value</p>
</section>
<section id="sec-terms-and-definitions-nan">
<h1><span class="secnum" id="sec-4.3.24"><a href="#sec-terms-and-definitions-nan"
title="link to this section">4.3.24</a></span> NaN</h1>
<p>number value that is an IEEE 754 “Not-a-Number” value</p>
</section>
<section id="sec-symbol-value">
<h1><span class="secnum" id="sec-4.3.25"><a href="#sec-symbol-value" title="link to this section">4.3.25</a></span> Symbol
value</h1>
<p>primitive value that represents a unique, non-String Object <a href="#sec-object-type">property key</a></p>
</section>
<section id="sec-terms-and-definitions-symbol-type">
<h1><span class="secnum" id="sec-4.3.26"><a href="#sec-terms-and-definitions-symbol-type"
title="link to this section">4.3.26</a></span> Symbol type</h1>
<p>set of all possible Symbol values</p>
</section>
<section id="sec-symbol-object">
<h1><span class="secnum" id="sec-4.3.27"><a href="#sec-symbol-object" title="link to this section">4.3.27</a></span> Symbol
object</h1>
<p>member of the Object type that is an instance of the standard built-in <code>Symbol</code> constructor</p>
</section>
<section id="sec-terms-and-definitions-function">
<h1><span class="secnum" id="sec-4.3.28"><a href="#sec-terms-and-definitions-function"
title="link to this section">4.3.28</a></span> function</h1>
<p>member of the Object type that may be invoked as a subroutine</p>
<div class="note">
<p><span class="nh">NOTE</span> In addition to its properties, a function contains executable code and state that
determine how it behaves when invoked. A function’s code may or may not be written in ECMAScript.</p>
</div>
</section>
<section id="sec-built-in-function">
<h1><span class="secnum" id="sec-4.3.29"><a href="#sec-built-in-function" title="link to this section">4.3.29</a></span>
built-in function</h1>
<p>built-in object that is a function</p>
<div class="note">
<p><span class="nh">NOTE</span> Examples of built-in functions include <code>parseInt</code> and <code><a
href="#sec-math.exp">Math.exp</a></code>. An implementation may provide implementation-dependent built-in functions that
are not described in this specification.</p>
</div>
</section>
<section id="sec-property">
<h1><span class="secnum" id="sec-4.3.30"><a href="#sec-property" title="link to this section">4.3.30</a></span>
property</h1>
<p>part of an object that associates a key (either a String value or a Symbol value) and a value.</p>
<div class="note">
<p><span class="nh">NOTE</span> Depending upon the form of the property the value may be represented either directly as a
data value (a primitive value, an object, or a function object) or indirectly by a pair of accessor functions.</p>
</div>
</section>
<section id="sec-method">
<h1><span class="secnum" id="sec-4.3.31"><a href="#sec-method" title="link to this section">4.3.31</a></span> method</h1>
<p>function that is the value of a property</p>
<div class="note">
<p><span class="nh">NOTE</span> When a function is called as a method of an object, the object is passed to the function
as its <b>this</b> value.</p>
</div>
</section>
<section id="sec-built-in-method">
<h1><span class="secnum" id="sec-4.3.32"><a href="#sec-built-in-method" title="link to this section">4.3.32</a></span>
built-in method</h1>
<p>method that is a built-in function</p>
<div class="note">
<p><span class="nh">NOTE</span> Standard built-in methods are defined in this specification, and an ECMAScript
implementation may specify and provide other additional built-in methods.</p>
</div>
</section>
<section id="sec-attribute">
<h1><span class="secnum" id="sec-4.3.33"><a href="#sec-attribute" title="link to this section">4.3.33</a></span>
attribute</h1>
<p>internal value that defines some characteristic of a property</p>
</section>
<section id="sec-own-property">
<h1><span class="secnum" id="sec-4.3.34"><a href="#sec-own-property" title="link to this section">4.3.34</a></span> own
property</h1>
<p>property that is directly contained by its object</p>
</section>
<section id="sec-inherited-property">
<h1><span class="secnum" id="sec-4.3.35"><a href="#sec-inherited-property" title="link to this section">4.3.35</a></span>
inherited property</h1>
<p>property of an object that is not an own property but is a property (either own or inherited) of the object’s
prototype</p>
</section>
</section>
<section id="sec-organization-of-this-specification">
<h1><span class="secnum" id="sec-4.4"><a href="#sec-organization-of-this-specification"
title="link to this section">4.4</a></span> Organization of This Specification</h1>
<p>The remainder of this specification is organized as follows:</p>
<p>Clause 5 defines the notational conventions used throughout the specification.</p>
<p>Clauses 6−9 define the execution environment within which ECMAScript programs operate.</p>
<p>Clauses 10−16 define the actual ECMAScript programming language including its syntactic encoding and the execution
semantics of all language features.</p>
<p>Clauses 17−26 define the ECMAScript standard library. It includes the definitions of all of the standard objects that
are available for use by ECMAScript programs as they execute.</p>
</section>
</section>
<section id="sec-notational-conventions">
<div class="front">
<h1><span class="secnum" id="sec-5"><a href="#sec-notational-conventions" title="link to this section">5</a></span> Notational
Conventions</h1>
</div>
<section id="sec-syntactic-and-lexical-grammars">
<div class="front">
<h1><span class="secnum" id="sec-5.1"><a href="#sec-syntactic-and-lexical-grammars"
title="link to this section">5.1</a></span> Syntactic and Lexical Grammars</h1>
</div>
<section id="sec-context-free-grammars">
<h1><span class="secnum" id="sec-5.1.1"><a href="#sec-context-free-grammars" title="link to this section">5.1.1</a></span>
Context-Free Grammars</h1>
<p>A <i>context-free grammar</i> consists of a number of <i>productions</i>. Each production has an abstract symbol called a
<i>nonterminal</i> as its <i>left-hand side</i>, and a sequence of zero or more nonterminal and <i>terminal</i> symbols as
its <i>right-hand side</i>. For each grammar, the terminal symbols are drawn from a specified alphabet.</p>
<p>A <i>chain production</i> is a production that has exactly one nonterminal symbol on its right-hand side along with zero
or more terminal symbols.</p>
<p>Starting from a sentence consisting of a single distinguished nonterminal, called the <i>goal symbol</i>, a given
context-free grammar specifies a <i>language</i>, namely, the (perhaps infinite) set of possible sequences of terminal
symbols that can result from repeatedly replacing any nonterminal in the sequence with a right-hand side of a production for
which the nonterminal is the left-hand side.</p>
</section>
<section id="sec-lexical-and-regexp-grammars">
<h1><span class="secnum" id="sec-5.1.2"><a href="#sec-lexical-and-regexp-grammars"
title="link to this section">5.1.2</a></span> The Lexical and RegExp Grammars</h1>
<p>A <i>lexical grammar</i> for ECMAScript is given in <a href="#sec-ecmascript-language-lexical-grammar">clause 11</a>.
This grammar has as its terminal symbols Unicode code points that conform to the rules for <span
class="nt">SourceCharacter</span> defined in <a href="#sec-source-text">10.1</a>. It defines a set of productions, starting
from the goal symbol <var>InputElementDiv,</var> <var>InputElementTemplateTail,</var> or <span
class="nt">InputElementRegExp</span>, or <var>InputElementRegExpOrTemplateTail,</var> that describe how sequences of such
code points are translated into a sequence of input elements.</p>
<p>Input elements other than white space and comments form the terminal symbols for the syntactic grammar for ECMAScript and
are called ECMAScript <i>tokens</i>. These tokens are the reserved words, identifiers, literals, and punctuators of the
ECMAScript language. Moreover, line terminators, although not considered to be tokens, also become part of the stream of
input elements and guide the process of <a href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a> (<a
href="#sec-automatic-semicolon-insertion">11.9</a>). Simple white space and single-line comments are discarded and do not
appear in the stream of input elements for the syntactic grammar. A <span class="nt">MultiLineComment</span> (that is, a
comment of the form <code>/*</code>…<code>*/</code> regardless of whether it spans more than one line) is likewise
simply discarded if it contains no line terminator; but if a <span class="nt">MultiLineComment</span> contains one or more
line terminators, then it is replaced by a single line terminator, which becomes part of the stream of input elements for
the syntactic grammar.</p>
<p>A <i>RegExp grammar</i> for ECMAScript is given in <a href="#sec-patterns">21.2.1</a>. This grammar also has as its
terminal symbols the code points as defined by <span class="nt">SourceCharacter</span>. It defines a set of productions,
starting from the goal symbol <span class="nt">Pattern</span>, that describe how sequences of code points are translated
into regular expression patterns.</p>
<p>Productions of the lexical and RegExp grammars are distinguished by having two colons “<b>::</b>” as
separating punctuation. The lexical and RegExp grammars share some productions.</p>
</section>
<section id="sec-numeric-string-grammar">
<h1><span class="secnum" id="sec-5.1.3"><a href="#sec-numeric-string-grammar" title="link to this section">5.1.3</a></span>
The Numeric String Grammar</h1>
<p>Another grammar is used for translating Strings into numeric values. This grammar is similar to the part of the lexical
grammar having to do with numeric literals and has as its terminal symbols <span class="nt">SourceCharacter</span>. This
grammar appears in <a href="#sec-tonumber-applied-to-the-string-type">7.1.3.1</a>.</p>
<p>Productions of the numeric string grammar are distinguished by having three colons “<b>:::</b>” as
punctuation.</p>
</section>
<section id="sec-syntactic-grammar">
<h1><span class="secnum" id="sec-5.1.4"><a href="#sec-syntactic-grammar" title="link to this section">5.1.4</a></span> The
Syntactic Grammar</h1>
<p>The <i>syntactic grammar</i> for ECMAScript is given in clauses 11, 12, 13, 14, and 15. This grammar has ECMAScript
tokens defined by the lexical grammar as its terminal symbols (<a href="#sec-lexical-and-regexp-grammars">5.1.2</a>). It
defines a set of productions, starting from two alternative goal symbols <span class="nt">Script</span> and <span
class="nt">Module</span>, that describe how sequences of tokens form syntactically correct independent components of
ECMAScript programs.</p>
<p>When a stream of code points is to be parsed as an ECMAScript <span class="nt">Script</span> or <span
class="nt">Module</span>, it is first converted to a stream of input elements by repeated application of the lexical
grammar; this stream of input elements is then parsed by a single application of the syntactic grammar. The input stream is
syntactically in error if the tokens in the stream of input elements cannot be parsed as a single instance of the goal
nonterminal (<span class="nt">Script</span> or <span class="nt">Module</span>), with no tokens left over.</p>
<p>Productions of the syntactic grammar are distinguished by having just one colon “<b>:</b>” as
punctuation.</p>
<p>The syntactic grammar as presented in clauses 12, 13, 14 and 15 is not a complete account of which token sequences are
accepted as a correct ECMAScript <span class="nt">Script</span> or <span class="nt">Module</span>. Certain additional token
sequences are also accepted, namely, those that would be described by the grammar if only semicolons were added to the
sequence in certain places (such as before line terminator characters). Furthermore, certain token sequences that are
described by the grammar are not considered acceptable if a line terminator character appears in certain
“awkward” places.</p>
<p>In certain cases in order to avoid ambiguities the syntactic grammar uses generalized productions that permit token
sequences that do not form a valid ECMAScript <span class="nt">Script</span> or <span class="nt">Module</span>. For example,
this technique is used for object literals and object destructuring patterns. In such cases a more restrictive
<i>supplemental grammar</i> is provided that further restricts the acceptable token sequences. In certain contexts, when
explicitly specified, the input elements corresponding to such a production are parsed again using a goal symbol of a
supplemental grammar. The input stream is syntactically in error if the tokens in the stream of input elements parsed by a
cover grammar cannot be parsed as a single instance of the corresponding supplemental goal symbol, with no tokens left
over.</p>
</section>
<section id="sec-grammar-notation">
<h1><span class="secnum" id="sec-5.1.5"><a href="#sec-grammar-notation" title="link to this section">5.1.5</a></span>
Grammar Notation</h1>
<p>Terminal symbols of the lexical, RegExp, and numeric string grammars are shown in <code>fixed width</code> font, both in
the productions of the grammars and throughout this specification whenever the text directly refers to such a terminal
symbol. These are to appear in a script exactly as written. All terminal symbol code points specified in this way are to be
understood as the appropriate Unicode code points from the Basic Latin range, as opposed to any similar-looking code points
from other Unicode ranges.</p>
<p>Nonterminal symbols are shown in <var>italic</var> type. The definition of a nonterminal (also called a
“production”) is introduced by the name of the nonterminal being defined followed by one or more colons. (The
number of colons indicates to which grammar the production belongs.) One or more alternative right-hand sides for the
nonterminal then follow on succeeding lines. For example, the syntactic definition:</p>
<div class="gp">
<div class="lhs"><span class="nt">WhileStatement</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">while</code> <code class="t">(</code> <span class="nt">Expression</span> <code class="t">)</code> <span class="nt">Statement</span></div>
</div>
<p>states that the nonterminal <span class="nt">WhileStatement</span> represents the token <code>while</code>, followed by a
left parenthesis token, followed by an <span class="nt">Expression</span>, followed by a right parenthesis token, followed
by a <span class="nt">Statement</span>. The occurrences of <span class="nt">Expression</span> and <span
class="nt">Statement</span> are themselves nonterminals. As another example, the syntactic definition:</p>
<div class="gp">
<div class="lhs"><span class="nt">ArgumentList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">AssignmentExpression</span></div>
<div class="rhs"><span class="nt">ArgumentList</span> <code class="t">,</code> <span class="nt">AssignmentExpression</span></div>
</div>
<p>states that an <span class="nt">ArgumentList</span> may represent either a single <span
class="nt">AssignmentExpression</span> or an <span class="nt">ArgumentList</span>, followed by a comma, followed by an <span
class="nt">AssignmentExpression</span>. This definition of <span class="nt">ArgumentList</span> is recursive, that is, it is
defined in terms of itself. The result is that an <span class="nt">ArgumentList</span> may contain any positive number of
arguments, separated by commas, where each argument expression is an <span class="nt">AssignmentExpression</span>. Such
recursive definitions of nonterminals are common.</p>
<p>The subscripted suffix “<sub>opt</sub>”, which may appear after a terminal or nonterminal, indicates an
optional symbol. The alternative containing the optional symbol actually specifies two right-hand sides, one that omits the
optional element and one that includes it. This means that:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer</span><sub class="g-opt">opt</sub></div>
</div>
<p>is a convenient abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer</span></div>
</div>
<p>and that:</p>
<div class="gp">
<div class="lhs"><span class="nt">IterationStatement</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <span class="nt">Expression</span><sub class="g-opt">opt</sub> <code class="t">;</code> <span class="nt">Expression</span><sub class="g-opt">opt</sub> <code class="t">)</code> <span class="nt">Statement</span></div>
</div>
<p>is a convenient abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">IterationStatement</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <code class="t">;</code> <span class="nt">Expression</span><sub class="g-opt">opt</sub> <code class="t">)</code> <span class="nt">Statement</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <span class="nt">Expression</span> <code class="t">;</code> <span class="nt">Expression</span><sub class="g-opt">opt</sub> <code class="t">)</code> <span class="nt">Statement</span></div>
</div>
<p>which in turn is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">IterationStatement</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <code class="t">;</code> <code class="t">)</code> <span class="nt">Statement</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <code class="t">;</code> <span class="nt">Expression</span> <code class="t">)</code> <span class="nt">Statement</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <span class="nt">Expression</span> <code class="t">;</code> <code class="t">)</code> <span class="nt">Statement</span></div>
<div class="rhs"><code class="t">for</code> <code class="t">(</code> <span class="nt">LexicalDeclaration</span> <span class="nt">Expression</span> <code class="t">;</code> <span class="nt">Expression</span> <code class="t">)</code> <span class="nt">Statement</span></div>
</div>
<p>so, in this example, the nonterminal <span class="nt">IterationStatement</span> actually has four alternative right-hand
sides.</p>
<p>A production may be parameterized by a subscripted annotation of the form “<sub>[parameters]</sub>”, which
may appear as a suffix to the nonterminal symbol defined by the production. “<sub>parameters</sub>” may be
either a single name or a comma separated list of names. A parameterized production is shorthand for a set of productions
defining all combinations of the parameter names, preceded by an underscore, appended to the parameterized nonterminal
symbol. This means that:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span><sub class="g-params">[Return]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>is a convenient abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_Return</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>and that:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span><sub class="g-params">[Return, In]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_Return</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_In</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_Return_In</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>Multiple parameters produce a combinatory number of productions, not all of which are necessarily referenced in a
complete grammar.</p>
<p>References to nonterminals on the right-hand side of a production can also be parameterized. For example:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span><sub class="g-params">[In]</sub></div>
</div>
<p>is equivalent to saying:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement_In</span></div>
</div>
<p>A nonterminal reference may have both a parameter list and an “<sub>opt</sub>” suffix. For example:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer</span><sub class="g-params">[In]</sub><sub class="g-opt">opt</sub></div>
</div>
<p>is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer_In</span></div>
</div>
<p>Prefixing a parameter name with “<sub>?</sub>” on a right-hand side nonterminal reference makes that
parameter value dependent upon the occurrence of the parameter name on the reference to the current production’s
left-hand side symbol. For example:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span><sub class="g-params">[In]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer</span><sub class="g-params">[?In]</sub></div>
</div>
<p>is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">VariableDeclaration_In</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">BindingIdentifier</span> <span class="nt">Initializer_In</span></div>
</div>
<p>If a right-hand side alternative is prefixed with “[+parameter]” that alternative is only available if the
named parameter was used in referencing the production’s nonterminal symbol. If a right-hand side alternative is
prefixed with “[~parameter]” that alternative is only available if the named parameter was <i>not</i> used in
referencing the production’s nonterminal symbol. This means that:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span><sub class="g-params">[Return]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="grhsannot">[+Return]</span> <span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_Return</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>and that</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span><sub class="g-params">[Return]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="grhsannot">[~Return]</span> <span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>is an abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">StatementList</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ReturnStatement</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StatementList_Return</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ExpressionStatement</span></div>
</div>
<p>When the words “<b>one of</b>” follow the colon(s) in a grammar definition, they signify that each of the
terminal symbols on the following line or lines is an alternative definition. For example, the lexical grammar for
ECMAScript contains the production:</p>
<div class="gp">
<div class="lhs"><span class="nt">NonZeroDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code></div>
</div>
<p>which is merely a convenient abbreviation for:</p>
<div class="gp">
<div class="lhs"><span class="nt">NonZeroDigit</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">1</code></div>
<div class="rhs"><code class="t">2</code></div>
<div class="rhs"><code class="t">3</code></div>
<div class="rhs"><code class="t">4</code></div>
<div class="rhs"><code class="t">5</code></div>
<div class="rhs"><code class="t">6</code></div>
<div class="rhs"><code class="t">7</code></div>
<div class="rhs"><code class="t">8</code></div>
<div class="rhs"><code class="t">9</code></div>
</div>
<p>If the phrase “[empty]” appears as the right-hand side of a production, it indicates that the production's
right-hand side contains no terminals or nonterminals.</p>
<p>If the phrase “[lookahead ∉ <var>set</var>]” appears in the right-hand side of a production, it
indicates that the production may not be used if the immediately following input token is a member of the given
<var>set</var>. The <var>set</var> can be written as a list of terminals enclosed in curly brackets. For convenience, the
set can also be written as a nonterminal, in which case it represents the set of all terminals to which that nonterminal
could expand. If the <var>set</var> consists of a single terminal the phrase “[lookahead ≠
<var>terminal</var>]” may be used.</p>
<p>For example, given the definitions</p>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DecimalDigit</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span> <span class="nt">DecimalDigit</span></div>
</div>
<p>the definition</p>
<div class="gp">
<div class="lhs"><span class="nt">LookaheadExample</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">n</code> <span class="grhsannot">[lookahead ∉ {<code class="t">1</code>, <code class="t">3</code>, <code class="t">5</code>, <code class="t">7</code>, <code class="t">9</code>}]</span> <span class="nt">DecimalDigits</span></div>
<div class="rhs"><span class="nt">DecimalDigit</span> <span class="grhsannot">[lookahead ∉ <span class="nt">DecimalDigit</span>]</span></div>
</div>
<p>matches either the letter <code>n</code> followed by one or more decimal digits the first of which is even, or a decimal
digit not followed by another decimal digit.</p>
<p>If the phrase “[no <span class="nt">LineTerminator</span> here]” appears in the right-hand side of a
production of the syntactic grammar, it indicates that the production is <i>a restricted production</i>: it may not be used
if a <span class="nt">LineTerminator</span> occurs in the input stream at the indicated position. For example, the
production:</p>
<div class="gp">
<div class="lhs"><span class="nt">ThrowStatement</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">throw</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">Expression</span> <code class="t">;</code></div>
</div>
<p>indicates that the production may not be used if a <span class="nt">LineTerminator</span> occurs in the script between
the <code>throw</code> token and the <span class="nt">Expression</span>.</p>
<p>Unless the presence of a <span class="nt">LineTerminator</span> is forbidden by a restricted production, any number of
occurrences of <span class="nt">LineTerminator</span> may appear between any two consecutive tokens in the stream of input
elements without affecting the syntactic acceptability of the script.</p>
<p>When an alternative in a production of the lexical grammar or the numeric string grammar appears to be a multi-code point
token, it represents the sequence of code points that would make up such a token.</p>
<p>The right-hand side of a production may specify that certain expansions are not permitted by using the phrase
“<b>but not</b>” and then indicating the expansions to be excluded. For example, the production:</p>
<div class="gp">
<div class="lhs"><span class="nt">Identifier</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">IdentifierName</span> <span class="grhsmod">but not</span> <span class="nt">ReservedWord</span></div>
</div>
<p>means that the nonterminal <span class="nt">Identifier</span> may be replaced by any sequence of code points that could
replace <span class="nt">IdentifierName</span> provided that the same sequence of code points could not replace <span
class="nt">ReservedWord</span>.</p>
<p>Finally, a few nonterminal symbols are described by a descriptive phrase in sans-serif type in cases where it would be
impractical to list all the alternatives:</p>
<div class="gp">
<div class="lhs"><span class="nt">SourceCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="gprose">any Unicode code point</span></div>
</div>
</section>
</section>
<section id="sec-algorithm-conventions">
<h1><span class="secnum" id="sec-5.2"><a href="#sec-algorithm-conventions" title="link to this section">5.2</a></span>
Algorithm Conventions</h1>
<p>The specification often uses a numbered list to specify steps in an algorithm. These algorithms are used to precisely
specify the required semantics of ECMAScript language constructs. The algorithms are not intended to imply the use of any
specific implementation technique. In practice, there may be more efficient algorithms available to implement a given
feature.</p>
<p>Algorithms may be explicitly parameterized, in which case the names and usage of the parameters must be provided as part of
the algorithm’s definition. In order to facilitate their use in multiple parts of this specification, some algorithms,
called <i>abstract</i> <i>operations</i>, are named and written in parameterized functional form so that they may be
referenced by name from within other algorithms. Abstract operations are typically referenced using a functional application
style such as <span style="font-family: Times New Roman">operationName(<i>arg1</i>, <i>arg2</i>)</span>. Some abstract
operations are treated as polymorphically dispatched methods of class-like specification abstractions. Such method-like
abstract operations are typically referenced using a method application style such as <span style="font-family: Times New
Roman"><i>someValue</i>.operationName(<i>arg1</i>, <i>arg2</i>)</span>.</p>
<p>Algorithms may be associated with productions of one of the ECMAScript grammars. A production that has multiple alternative
definitions will typically have a distinct algorithm for each alternative. When an algorithm is associated with a grammar
production, it may reference the terminal and nonterminal symbols of the production alternative as if they were parameters of
the algorithm. When used in this manner, nonterminal symbols refer to the actual alternative definition that is matched when
parsing the source text.</p>
<p>When an algorithm is associated with a production alternative, the alternative is typically shown without any “[
]” grammar annotations. Such annotations should only affect the syntactic recognition of the alternative and have no
effect on the associated semantics for the alternative.</p>
<p>Unless explicitly specified otherwise, all <a href="#sec-context-free-grammars">chain productions</a> have an implicit
definition for every algorithm that might be applied to that production’s left-hand side nonterminal. The implicit
definition simply reapplies the same algorithm name with the same parameters, if any, to the <a
href="#sec-context-free-grammars">chain production</a>’s sole right-hand side nonterminal and then returns the result.
For example, assume there is a production:</p>
<div class="gp">
<div class="lhs"><span class="nt">Block</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">{</code> <span class="nt">StatementList</span> <code class="t">}</code></div>
</div>
<p>but there is no corresponding Evaluation algorithm that is explicitly specified for that production. If in some algorithm
there is a statement of the form: “<span style="font-family: Times New Roman">Return the result of evaluating
<i>Block</i></span>” it is implicit that an Evaluation algorithm exists of the form:</p>
<p><b>Runtime Semantics: Evaluation</b></p>
<div class="gp prod"><span class="nt">Block</span> <span class="geq">:</span> <code class="t">{</code> <span class="nt">StatementList</span> <code class="t">}</code></div>
<ol class="proc">
<li>Return the result of evaluating <i>StatementList</i>.</li>
</ol>
<p>For clarity of expression, algorithm steps may be subdivided into sequential substeps. Substeps are indented and may
themselves be further divided into indented substeps. Outline numbering conventions are used to identify substeps with the
first level of substeps labelled with lower case alphabetic characters and the second level of substeps labelled with lower
case roman numerals. If more than three levels are required these rules repeat with the fourth level using numeric labels. For
example:</p>
<ol class="proc">
<li>Top-level step
<ol class="block">
<li>Substep.</li>
<li>Substep.
<ol class="block">
<li>Subsubstep.
<ol class="block">
<li>Subsubsubstep
<ol class="block">
<li>Subsubsubsubstep
<ol class="block">
<li>Subsubsubsubsubstep</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
</ol>
<p>A step or substep may be written as an “if” predicate that conditions its substeps. In this case, the substeps
are only applied if the predicate is true. If a step or substep begins with the word “else”, it is a predicate
that is the negation of the preceding “if” predicate step at the same level.</p>
<p>A step may specify the iterative application of its substeps.</p>
<p>A step that begins with “Assert:” asserts an invariant condition of its algorithm. Such assertions are used to
make explicit algorithmic invariants that would otherwise be implicit. Such assertions add no additional semantic requirements
and hence need not be checked by an implementation. They are used simply to clarify algorithms.</p>
<p>Mathematical operations such as addition, subtraction, negation, multiplication, division, and the mathematical functions
defined later in this clause should always be understood as computing exact mathematical results on mathematical real numbers,
which unless otherwise noted do not include infinities and do not include a negative zero that is distinguished from positive
zero. Algorithms in this standard that model floating-point arithmetic include explicit steps, where necessary, to handle
infinities and signed zero and to perform rounding. If a mathematical operation or function is applied to a floating-point
number, it should be understood as being applied to the exact mathematical value represented by that floating-point number;
such a floating-point number must be finite, and if it is <span class="value">+0</span> or <span class="value">−0</span>
then the corresponding mathematical value is simply <span class="value">0</span>.</p>
<p>The mathematical function <span style="font-family: Times New Roman">abs(<i>x</i>)</span> produces the absolute value of
<var>x</var>, which is <span style="font-family: Times New Roman">−<i>x</i></span> if <var>x</var> is negative (less
than zero) and otherwise is <var>x</var> itself.</p>
<p>The mathematical function <span style="font-family: Times New Roman">sign(<i>x</i>)</span> produces <span
style="font-family: Times New Roman">1</span> if <var>x</var> is positive and <span style="font-family: Times New
Roman">−1</span> if <var>x</var> is negative. The sign function is not used in this standard for cases when <var>x</var>
is zero.</p>
<p>The mathematical function <span style="font-family: Times New Roman">min(<i>x</i><sub>1</sub>,</span> <span
style="font-family: Times New Roman"><i>x</i><sub>2</sub>, ..., <i>x</i><sub>n</sub>)</span> produces the mathematically
smallest of <span style="font-family: Times New Roman"><i>x</i><sub>1</sub></span> through <span style="font-family: Times New
Roman"><i>x</i><sub>n</sub></span>. The mathematical function <span style="font-family: Times New
Roman">max(<i>x</i><sub>1</sub>,</span> <span style="font-family: Times New Roman"><i>x</i><sub>2</sub>, ...,
<i>x</i><sub>n</sub>)</span> produces the mathematically largest of <span style="font-family: Times New
Roman"><i>x</i><sub>1</sub></span> through <span style="font-family: Times New Roman"><i>x</i><sub>n</sub></span>. The domain
and range of these mathematical functions include +<b>∞</b> and <b>−∞</b>.</p>
<p>The notation “<span style="font-family: Times New Roman"><i>x</i> modulo <i>y</i></span>” (<var>y</var> must be
finite and nonzero) computes a value <var>k</var> of the same sign as <var>y</var> (or zero) such that <span
style="font-family: Times New Roman">abs(<i>k</i>) < abs(<i>y</i>) and <i>x</i>−<i>k</i> = <i>q</i></span> <span
style="font-family: Times New Roman">×</span> <var>y</var> for some integer <var>q</var>.</p>
<p>The mathematical function <span style="font-family: Times New Roman">floor(<i>x</i>)</span> produces the largest integer
(closest to positive infinity) that is not larger than <var>x</var>.</p>
<div class="note">
<p><span class="nh">NOTE</span> floor(<i>x</i>) = <i>x</i>−(<i>x</i> modulo 1).</p>
</div>
</section>
<section id="sec-static-semantic-rules">
<h1><span class="secnum" id="sec-5.3"><a href="#sec-static-semantic-rules" title="link to this section">5.3</a></span> Static
Semantic Rules</h1>
<p>Context-free grammars are not sufficiently powerful to express all the rules that define whether a stream of input elements
form a valid ECMAScript <span class="nt">Script</span> or <span class="nt">Module</span> that may be evaluated. In some
situations additional rules are needed that may be expressed using either ECMAScript algorithm conventions or prose
requirements. Such rules are always associated with a production of a grammar and are called the <i>static semantics</i> of
the production.</p>
<p>Static Semantic Rules have names and typically are defined using an algorithm. Named Static Semantic Rules are associated
with grammar productions and a production that has multiple alternative definitions will typically have for each alternative a
distinct algorithm for each applicable named static semantic rule.</p>
<p>Unless otherwise specified every grammar production alternative in this specification implicitly has a definition for a
static semantic rule named <span style="font-family: Times New Roman">Contains</span> which takes an argument named
<var>symbol</var> whose value is a terminal or nonterminal of the grammar that includes the associated production. The default
definition of <span style="font-family: Times New Roman">Contains</span> is:</p>
<ol class="proc">
<li>For each terminal and nonterminal grammar symbol, <i>sym</i>, in the definition of this production do
<ol class="block">
<li>If <i>sym</i> is the same grammar symbol as <i>symbol</i>, return <b>true</b>.</li>
<li>If <i>sym</i> is a nonterminal, then
<ol class="block">
<li>Let <i>contained</i> be the result of <i>sym</i> Contains <i>symbol</i>.</li>
<li>If <i>contained</i> is <b>true</b>, return <b>true</b>.</li>
</ol>
</li>
</ol>
</li>
<li>Return <b>false</b>.</li>
</ol>
<p>The above definition is explicitly over-ridden for specific productions.</p>
<p>A special kind of static semantic rule is an Early Error Rule. Early error rules define early error conditions (see <a
href="#sec-error-handling-and-language-extensions">clause 16</a>) that are associated with specific grammar productions.
Evaluation of most early error rules are not explicitly invoked within the algorithms of this specification. A conforming
implementation must, prior to the first evaluation of a <span class="nt">Script</span>, validate all of the early error rules
of the productions used to parse that <span class="nt">Script</span>. If any of the early error rules are violated the <span
class="nt">Script</span> is invalid and cannot be evaluated.</p>
</section>
</section>
<section id="sec-ecmascript-data-types-and-values">
<div class="front">
<h1><span class="secnum" id="sec-6"><a href="#sec-ecmascript-data-types-and-values" title="link to this section">6</a></span>
ECMAScript Data Types and Values</h1>
<p>Algorithms within this specification manipulate values each of which has an associated type. The possible value types are
exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification
types.</p>
<p>Within this specification, the notation “<span style="font-family: Times New Roman">Type(<i>x</i>)</span>” is
used as shorthand for “<span style="font-family: Times New Roman">the type of <i>x</i></span>” where “<span
style="font-family: Times New Roman">type</span>” refers to the ECMAScript language and specification types defined in
this clause. When the term “empty” is used as if it was naming a value, it is equivalent to saying “no value
of any type”.</p>
</div>
<section id="sec-ecmascript-language-types">
<div class="front">
<h1><span class="secnum" id="sec-6.1"><a href="#sec-ecmascript-language-types" title="link to this section">6.1</a></span>
ECMAScript Language Types</h1>
<p>An ECMAScript language type corresponds to values that are directly manipulated by an ECMAScript programmer using the
ECMAScript language. The ECMAScript language types are Undefined, Null, Boolean, String, Symbol, Number, and Object. An
ECMAScript language value is a value that is characterized by an ECMAScript language type.</p>
</div>
<section id="sec-ecmascript-language-types-undefined-type">
<h1><span class="secnum" id="sec-6.1.1"><a href="#sec-ecmascript-language-types-undefined-type"
title="link to this section">6.1.1</a></span> The Undefined Type</h1>
<p>The Undefined type has exactly one value, called <b>undefined</b>. Any variable that has not been assigned a value has
the value <b>undefined</b>.</p>
</section>
<section id="sec-ecmascript-language-types-null-type">
<h1><span class="secnum" id="sec-6.1.2"><a href="#sec-ecmascript-language-types-null-type"
title="link to this section">6.1.2</a></span> The Null Type</h1>
<p>The Null type has exactly one value, called <b>null</b>.</p>
</section>
<section id="sec-ecmascript-language-types-boolean-type">
<h1><span class="secnum" id="sec-6.1.3"><a href="#sec-ecmascript-language-types-boolean-type"
title="link to this section">6.1.3</a></span> The Boolean Type</h1>
<p>The Boolean type represents a logical entity having two values, called <b>true</b> and <b>false</b>.</p>
</section>
<section id="sec-ecmascript-language-types-string-type">
<h1><span class="secnum" id="sec-6.1.4"><a href="#sec-ecmascript-language-types-string-type"
title="link to this section">6.1.4</a></span> The String Type</h1>
<p>The String type is the set of all finite ordered sequences of zero or more 16-bit unsigned integer values
(“elements”). The String type is generally used to represent textual data in a running ECMAScript program, in
which case each element in the String is treated as a UTF-16 code unit value. Each element is regarded as occupying a
position within the sequence. These positions are indexed with nonnegative integers. The first element (if any) is at index
0, the next element (if any) at index 1, and so on. The length of a String is the number of elements (i.e., 16-bit values)
within it. The empty String has length zero and therefore contains no elements.</p>
<p>Where ECMAScript operations interpret String values, each element is interpreted as a single UTF-16 code unit. However,
ECMAScript does not place any restrictions or requirements on the sequence of code units in a String value, so they may be
ill-formed when interpreted as UTF-16 code unit sequences. Operations that do not interpret String contents treat them as
sequences of undifferentiated 16-bit unsigned integers. The function <code><a
href="#sec-string.prototype.normalize">String.prototype.normalize</a></code> (<a href="#sec-string.prototype.normalize">see
21.1.3.12</a>) can be used to explicitly normalize a string value. <code><a
href="#sec-string.prototype.localecompare">String.prototype.localeCompare</a></code> (<a
href="#sec-string.prototype.localecompare">see 21.1.3.10</a>) internally normalizes strings values, but no other operations
implicitly normalize the strings upon which they operate. Only operations that are explicitly specified to be language or
locale sensitive produce language-sensitive results.</p>
<div class="note">
<p><span class="nh">NOTE</span> The rationale behind this design was to keep the implementation of Strings as simple and
high-performing as possible. If ECMAScript source text is in Normalized Form C, string literals are guaranteed to also be
normalized, as long as they do not contain any Unicode escape sequences.</p>
</div>
<p>Some operations interpret String contents as UTF-16 encoded Unicode code points. In that case the interpretation is:</p>
<ul>
<li>
<p>A code unit in the range <span style="font-family: Times New Roman">0</span> to <span style="font-family: Times New
Roman">0xD7FF</span> or in the range <span style="font-family: Times New Roman">0xE000</span> to <span
style="font-family: Times New Roman">0xFFFF</span> is interpreted as a code point with the same value.</p>
</li>
<li>
<p>A sequence of two code units, where the first code unit <var>c1</var> is in the range <span style="font-family: Times
New Roman">0xD800</span> to <span style="font-family: Times New Roman">0xDBFF</span> and the second code unit
<var>c2</var> is in the range <span style="font-family: Times New Roman">0xDC00</span> to <span style="font-family:
Times New Roman">0xDFFF</span>, is a surrogate pair and is interpreted as a code point with the value (<var>c1</var> -
<span style="font-family: Times New Roman">0xD800</span>) × <span style="font-family: Times New
Roman">0x400</span> + (<var>c2</var> – <span style="font-family: Times New Roman">0xDC00</span>) + <span
style="font-family: Times New Roman">0x10000</span>. (See <a href="#sec-utf16decode">10.1.2</a>)</p>
</li>
<li>
<p>A code unit that is in the range <span style="font-family: Times New Roman">0xD800</span> to <span
style="font-family: Times New Roman">0xDFFF</span>, but is not part of a surrogate pair, is interpreted as a code point
with the same value.</p>
</li>
</ul>
</section>
<section id="sec-ecmascript-language-types-symbol-type">
<div class="front">
<h1><span class="secnum" id="sec-6.1.5"><a href="#sec-ecmascript-language-types-symbol-type"
title="link to this section">6.1.5</a></span> The Symbol Type</h1>
<p>The Symbol type is the set of all non-String values that may be used as the key of an Object property (<a
href="#sec-object-type">6.1.7</a>).</p>
<p>Each possible Symbol value is unique and immutable.</p>
<p>Each Symbol value immutably holds an associated value called [[Description]] that is either <span
class="value">undefined</span> or a String value.</p>
</div>
<section id="sec-well-known-symbols">
<h1><span class="secnum" id="sec-6.1.5.1"><a href="#sec-well-known-symbols"
title="link to this section">6.1.5.1</a></span> Well-Known Symbols</h1>
<p>Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They
are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless
otherwise specified, well-known symbols values are shared by all Code Realms (<a href="#sec-code-realms">8.2</a>).</p>
<p>Within this specification a well-known symbol is referred to by using a notation of the form @@name, where
“name” is one of the values listed in <a href="#table-1">Table 1</a>.</p>
<figure>
<figcaption><span id="table-1">Table 1</span>— Well-known Symbols</figcaption>
<table class="real-table">
<tr>
<th>Specification Name</th>
<th>[[Description]]</th>
<th>Value and Purpose</th>
</tr>
<tr>
<td>@@hasInstance</td>
<td><code>"Symbol.hasInstance"</code></td>
<td>A method that determines if a constructor object recognizes an object as one of the constructor’s instances. Called by the semantics of the <code>instanceof</code> operator.</td>
</tr>
<tr>
<td>@@isConcatSpreadable</td>
<td><code>"Symbol.isConcatSpreadable"</code></td>
<td>A Boolean valued property that if true indicates that an object should be flattened to its array elements by <code><a href="#sec-array.prototype.concat">Array.prototype.concat</a></code>.</td>
</tr>
<tr>
<td>@@iterator</td>
<td><code>"Symbol.iterator"</code></td>
<td>A method that returns the default Iterator for an object. Called by the semantics of the for-of statement.</td>
</tr>
<tr>
<td>@@match</td>
<td><code>"Symbol.match"</code></td>
<td>A regular expression method that matches the regular expression against a string. Called by the <code><a href="#sec-string.prototype.match">String.prototype.match</a></code> method.</td>
</tr>
<tr>
<td>@@replace</td>
<td><code>"Symbol.replace"</code></td>
<td>A regular expression method that replaces matched substrings of a string. Called by the <code><a href="#sec-string.prototype.replace">String.prototype.replace</a></code> method.</td>
</tr>
<tr>
<td>@@search</td>
<td><code>"Symbol.search"</code></td>
<td>A regular expression method that returns the index within a string that matches the regular expression. Called by the <code><a href="#sec-string.prototype.search">String.prototype.search</a></code> method.</td>
</tr>
<tr>
<td>@@species</td>
<td><code>"Symbol.species"</code></td>
<td>A function valued property that is the constructor function that is used to create derived objects.</td>
</tr>
<tr>
<td>@@split</td>
<td><code>"Symbol.split"</code></td>
<td>A regular expression method that splits a string at the indices that match the regular expression. Called by the <code><a href="#sec-string.prototype.split">String.prototype.split</a></code> method.</td>
</tr>
<tr>
<td>@@toPrimitive</td>
<td><code>"Symbol.toPrimitive"</code></td>
<td>A method that converts an object to a corresponding primitive value. Called by the <a href="#sec-toprimitive">ToPrimitive</a> abstract operation.</td>
</tr>
<tr>
<td>@@toStringTag</td>
<td><code>"Symbol.toStringTag"</code></td>
<td>A String valued property that is used in the creation of the default string description of an object. Accessed by the built-in method <code><a href="#sec-object.prototype.tostring">Object.prototype.toString</a></code>.</td>
</tr>
<tr>
<td>@@unscopables</td>
<td><code>"Symbol.unscopables"</code></td>
<td>An object valued property whose own property names are property names that are excluded from the <code>with</code> environment bindings of the associated object.</td>
</tr>
</table>
</figure>
</section>
</section>
<section id="sec-ecmascript-language-types-number-type">
<h1><span class="secnum" id="sec-6.1.6"><a href="#sec-ecmascript-language-types-number-type"
title="link to this section">6.1.6</a></span> The Number Type</h1>
<p>The Number type has exactly <span style="font-family: Times New Roman">18437736874454810627</span> (that is, <span
style="font-family: Times New Roman">2<sup>64</sup>−2<sup>53</sup>+3</span>) values, representing the double-precision
64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the <span
style="font-family: Times New Roman">9007199254740990</span> (that is, <span style="font-family: Times New
Roman">2<sup>53</sup>−2</span>) distinct “Not-a-Number” values of the IEEE Standard are represented in
ECMAScript as a single special <b>NaN</b> value. (Note that the <b>NaN</b> value is produced by the program expression
<code>NaN</code>.) In some implementations, external code might be able to detect a difference between various Not-a-Number
values, but such behaviour is implementation-dependent; to ECMAScript code, all NaN values are indistinguishable from each
other.</p>
<div class="note">
<p><span class="nh">NOTE</span> The bit pattern that might be observed in an ArrayBuffer (<a
href="#sec-arraybuffer-objects">see 24.1</a>) after a Number value has been stored into it is not necessarily the same as
the internal representation of that Number value used by the ECMAScript implementation.</p>
</div>
<p>There are two other special values, called <b>positive Infinity</b> and <b>negative Infinity</b>. For brevity, these
values are also referred to for expository purposes by the symbols <span class="value">+∞</span> and <span
class="value">−∞</span>, respectively. (Note that these two infinite Number values are produced by the program
expressions <code>+Infinity</code> (or simply <code>Infinity</code>) and <code>-Infinity</code>.)</p>
<p>The other <span style="font-family: Times New Roman">18437736874454810624</span> (that is, <span style="font-family:
Times New Roman">2<sup>64</sup>−2<sup>53</sup></span>) values are called the finite numbers. Half of these are
positive numbers and half are negative numbers; for every finite positive Number value there is a corresponding negative
value having the same magnitude.</p>
<p>Note that there is both a <b>positive zero</b> and a <b>negative zero</b>. For brevity, these values are also referred to
for expository purposes by the symbols <span class="value">+0</span> and <span class="value">−0</span>, respectively.
(Note that these two different zero Number values are produced by the program expressions <code>+0</code> (or simply
<code>0</code>) and <code>-0</code>.)</p>
<p>The <span style="font-family: Times New Roman">18437736874454810622</span> (that is, <span style="font-family: Times New
Roman">2<sup>64</sup>−2<sup>53</sup>−2</span>) finite nonzero values are of two kinds:</p>
<p><span style="font-family: Times New Roman">18428729675200069632</span> (that is, <span style="font-family: Times New
Roman">2<sup>64</sup>−2<sup>54</sup></span>) of them are normalized, having the form</p>
<div class="math-display"><i>s</i> × <i>m</i> × 2<sup><i>e</i></sup></div>
<p>where <var>s</var> is <span style="font-family: Times New Roman">+1</span> or <span style="font-family: Times New
Roman">−1</span>, <var>m</var> is a positive integer less than <span style="font-family: Times New
Roman">2<sup>53</sup></span> but not less than <span style="font-family: Times New Roman">2<sup>52</sup></span>, and
<var>e</var> is an integer ranging from <span style="font-family: Times New Roman">−1074</span> to <span
style="font-family: Times New Roman">971</span>, inclusive.</p>
<p>The remaining <span style="font-family: Times New Roman">9007199254740990</span> (that is, <span style="font-family:
Times New Roman">2<sup>53</sup>−2</span>) values are denormalized, having the form</p>
<div class="math-display"><i>s</i> × <i>m</i> × 2<sup><i>e</i></sup></div>
<p>where <var>s</var> is <span style="font-family: Times New Roman">+1</span> or <span style="font-family: Times New
Roman">−1</span>, <var>m</var> is a positive integer less than <span style="font-family: Times New
Roman">2<sup>52</sup></span>, and <var>e</var> is <span style="font-family: Times New Roman">−1074</span>.</p>
<p>Note that all the positive and negative integers whose magnitude is no greater than <span style="font-family: Times New
Roman">2<sup>53</sup></span> are representable in the Number type (indeed, the integer <span style="font-family: Times New
Roman">0</span> has two representations, <code>+0</code> and <code>-0</code>).</p>
<p>A finite number has an <i>odd significand</i> if it is nonzero and the integer <var>m</var> used to express it (in one of
the two forms shown above) is odd. Otherwise, it has an <i>even significand</i>.</p>
<p>In this specification, the phrase “<span style="font-family: Times New Roman">the Number value for
<i>x</i></span>” where <var>x</var> represents an exact nonzero real mathematical quantity (which might even be an
irrational number such as <span style="font-family: Times New Roman">π</span>) means a Number value chosen in the
following manner. Consider the set of all finite values of the Number type, with <span class="value">−0</span> removed
and with two additional values added to it that are not representable in the Number type, namely <span style="font-family:
Times New Roman">2<sup>1024</sup></span> (which is <span style="font-family: Times New Roman">+1 ×
2<sup>53</sup></span> <span style="font-family: Times New Roman">× 2<sup>971</sup></span>) and <span
style="font-family: Times New Roman">−2<sup>1024</sup></span> (which is <span style="font-family: Times New
Roman">−1 × 2<sup>53</sup></span> <span style="font-family: Times New Roman">× 2<sup>971</sup></span>).
Choose the member of this set that is closest in value to <var>x</var>. If two values of the set are equally close, then the
one with an even significand is chosen; for this purpose, the two extra values <span style="font-family: Times New
Roman">2<sup>1024</sup></span> and <span style="font-family: Times New Roman">−2<sup>1024</sup></span> are considered
to have even significands. Finally, if <span style="font-family: Times New Roman">2<sup>1024</sup></span> was chosen,
replace it with <span class="value">+∞</span>; if <span style="font-family: Times New
Roman">−2<sup>1024</sup></span> was chosen, replace it with <span class="value">−∞</span>; if <span
class="value">+0</span> was chosen, replace it with <span class="value">−0</span> if and only if <var>x</var> is less
than zero; any other chosen value is used unchanged. The result is the Number value for <var>x</var>. (This procedure
corresponds exactly to the behaviour of the IEEE 754 “round to nearest, ties to even” mode.)</p>
<p>Some ECMAScript operators deal only with integers in specific ranges such as <span style="font-family: Times New
Roman">−2<sup>31</sup></span> through <span style="font-family: Times New Roman">2<sup>31</sup>−1</span>,
inclusive, or in the range <span style="font-family: Times New Roman">0</span> through <span style="font-family: Times New
Roman">2<sup>16</sup>−1</span>, inclusive. These operators accept any value of the Number type but first convert each
such value to an integer value in the expected range. See the descriptions of the numeric conversion operations in <a
href="#sec-type-conversion">7.1</a>.</p>
</section>
<section id="sec-object-type">
<div class="front">
<h1><span class="secnum" id="sec-6.1.7"><a href="#sec-object-type" title="link to this section">6.1.7</a></span> The
Object Type</h1>
<p>An Object is logically a collection of properties. Each property is either a data property, or an accessor
property:</p>
<ul>
<li>
<p>A <i>data property</i> associates a key value with an <a href="#sec-ecmascript-language-types">ECMAScript language
value</a> and a set of Boolean attributes.</p>
</li>
<li>
<p>An <i>accessor property</i> associates a key value with one or two accessor functions, and a set of Boolean
attributes. The accessor functions are used to store or retrieve an <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> that is associated with the property.</p>
</li>
</ul>
<p>Properties are identified using key values. A property key value is either an ECMAScript String value or a Symbol
value. All String and Symbol values, including the empty string, are valid as property keys. A <i>property name</i> is a
property key that is a String value.</p>
<p>An <i>integer index</i> is a String-valued property key that is a canonical numeric String (<a
href="#sec-canonicalnumericindexstring">see 7.1.16</a>) and whose numeric value is either <span style="font-family: Times
New Roman">+0</span> or a positive integer ≤ 2<sup>53</sup>−1. An <i>array index</i> is an integer index whose
numeric value <var>i</var> is in the range <span style="font-family: Times New Roman">+0 ≤ <i>i</i></span> <span
style="font-family: Times New Roman">< 2<sup>32</sup>−1.</span></p>
<p>Property keys are used to access properties and their values. There are two kinds of access for properties: <i>get</i>
and <i>set</i>, corresponding to value retrieval and assignment, respectively. The properties accessible via get and set
access includes both <i>own properties</i> that are a direct part of an object and <i>inherited properties</i> which are
provided by another associated object via a property inheritance relationship. Inherited properties may be either own or
inherited properties of the associated object. Each own property of an object must each have a key value that is distinct
from the key values of the other own properties of that object.</p>
<p>All objects are logically collections of properties, but there are multiple forms of objects that differ in their
semantics for accessing and manipulating their properties. O<i>rdinary objects</i> are the most common form of objects and
have the default object semantics. An <i>exotic object</i> is any form of object whose property semantics differ in any
way from the default semantics.</p>
</div>
<section id="sec-property-attributes">
<h1><span class="secnum" id="sec-6.1.7.1"><a href="#sec-property-attributes"
title="link to this section">6.1.7.1</a></span> Property Attributes</h1>
<p>Attributes are used in this specification to define and explain the state of Object properties. A data property
associates a key value with the attributes listed in <a href="#table-2">Table 2</a>.</p>
<figure>
<figcaption><span id="table-2">Table 2</span> — Attributes of a Data Property</figcaption>
<table class="real-table">
<tr>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Attribute Name</th>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Value Domain</th>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Description</th>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid black">[[Value]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Any <a href="#sec-ecmascript-language-types">ECMAScript language type</a></td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">The value retrieved by a get access of the property.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid black">[[Writable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Boolean</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If <b>false</b>, attempts by ECMAScript code to change the property’s [[Value]] attribute using [[Set]] will not succeed.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid black">[[Enumerable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Boolean</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If <b>true</b>, the property will be enumerated by a for-in enumeration (<a href="#sec-for-in-and-for-of-statements">see 13.6.4</a>). Otherwise, the property is said to be non-enumerable.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid black">[[Configurable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Boolean</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If <b>false</b>, attempts to delete the property, change the property to be an accessor property, or change its attributes (other than [[Value]], or changing [[Writable]] to <b>false</b>) will fail.</td>
</tr>
</table>
</figure>
<p>An accessor property associates a key value with the attributes listed in <a href="#table-3">Table 3</a>.</p>
<figure>
<figcaption><span id="table-3">Table 3</span> — Attributes of an Accessor Property</figcaption>
<table class="real-table">
<tr>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Attribute Name</th>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Value Domain</th>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Description</th>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000">[[Get]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Object <i>or</i> Undefined</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If the value is an Object it must be a function Object. The function’s [[Call]] internal method (<a href="#table-6">Table 6</a>) is called with an empty arguments list to retrieve the property value each time a get access of the property is performed.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Set]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Object <i>or</i> Undefined</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If the value is an Object it must be a function Object. The function’s [[Call]] internal method (<a href="#table-6">Table 6</a>) is called with an arguments list containing the assigned value as its sole argument each time a set access of the property is performed. The effect of a property's [[Set]] internal method may, but is not required to, have an effect on the value returned by subsequent calls to the property's [[Get]] internal method.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Enumerable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Boolean</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If <b>true</b>, the property is to be enumerated by a for-in enumeration (<a href="#sec-for-in-and-for-of-statements">see 13.6.4</a>). Otherwise, the property is said to be non-enumerable.</td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Configurable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">Boolean</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black">If <b>false</b>, attempts to delete the property, change the property to be a data property, or change its attributes will fail.</td>
</tr>
</table>
</figure>
<p>If the initial values of a property’s attributes are not explicitly specified by this specification, the default
value defined in <a href="#table-4">Table 4</a> is used.</p>
<figure>
<figcaption><span id="table-4">Table 4</span> — Default Attribute Values</figcaption>
<table class="real-table">
<tr>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Attribute Name</th>
<th style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">Default Value</th>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Value]]</td>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black"><b>undefined</b></td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000">[[Get]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black"><b>undefined</b></td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Set]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black"><b>undefined</b></td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Writable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black"><b>false</b></td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Enumerable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black"><b>false</b></td>
</tr>
<tr>
<td style="border-bottom: 1px solid black; border-left: 1px solid black; border-right: 1px solid #000000; border-top: 1px solid black">[[Configurable]]</td>
<td style="border-bottom: 1px solid black; border-right: 1px solid black"><b>false</b></td>
</tr>
</table>
</figure>
</section>
<section id="sec-object-internal-methods-and-internal-slots">
<h1><span class="secnum" id="sec-6.1.7.2"><a href="#sec-object-internal-methods-and-internal-slots"
title="link to this section">6.1.7.2</a></span> Object Internal Methods and Internal Slots</h1>
<p>The actual semantics of objects, in ECMAScript, are specified via algorithms called <i>internal methods</i>. Each
object in an ECMAScript engine is associated with a set of internal methods that defines its runtime behaviour. These
internal methods are not part of the ECMAScript language. They are defined by this specification purely for expository
purposes. However, each object within an implementation of ECMAScript must behave as specified by the internal methods
associated with it. The exact manner in which this is accomplished is determined by the implementation.</p>
<p>Internal method names are polymorphic. This means that different object values may perform different algorithms when a
common internal method name is invoked upon them. That actual object upon which an internal method is invoked is the
“target” of the invocation. If, at runtime, the implementation of an algorithm attempts to use an internal
method of an object that the object does not support, a <b>TypeError</b> exception is thrown.</p>
<p>Internal slots correspond to internal state that is associated with objects and used by various ECMAScript
specification algorithms. Internal slots are not object properties and they are not inherited. Depending upon the specific
internal slot specification, such state may consist of values of any <a href="#sec-ecmascript-language-types">ECMAScript
language type</a> or of specific ECMAScript specification type values. Unless explicitly specified otherwise, internal
slots are allocated as part of the process of creating an object and may not be dynamically added to an object. Unless
specified otherwise, the initial value of an internal slot is the value <span class="value">undefined</span>. Various
algorithms within this specification create objects that have internal slots. However, the ECMAScript language provides no
direct way to associate internal slots with an object.</p>
<p>Internal methods and internal slots are identified within this specification using names enclosed in double square
brackets [[ ]].</p>
<p><a href="#table-5">Table 5</a> summarizes the <i>essential internal methods</i> used by this specification that are
applicable to all objects created or manipulated by ECMAScript code. Every object must have algorithms for all of the
essential internal methods. However, all objects do not necessarily use the same algorithms for those methods.</p>
<p>The “Signature” column of <a href="#table-5">Table 5</a> and other similar tables describes the invocation
pattern for each internal method. The invocation pattern always includes a parenthesized list of descriptive parameter
names. If a parameter name is the same as an ECMAScript type name then the name describes the required type of the
parameter value. If an internal method explicitly returns a value, its parameter list is followed by the symbol
“→” and the type name of the returned value. The type names used in signatures refer to the types defined
in <a href="#sec-ecmascript-data-types-and-values">clause 6</a> augmented by the following additional names.
“<i>any</i>” means the value may be any <a href="#sec-ecmascript-language-types">ECMAScript language type</a>.
An internal method implicitly returns a <a href="#sec-completion-record-specification-type">Completion Record</a> as
described in <a href="#sec-completion-record-specification-type">6.2.2</a>. In addition to its parameters, an internal
method always has access to the object that is the target of the method invocation.</p>
<figure>
<figcaption><span id="table-5">Table 5</span> — Essential Internal Methods</figcaption>
<table class="real-table">
<tr>
<th>Internal Method</th>
<th>Signature</th>
<th>Description</th>
</tr>
<tr>
<td>[[GetPrototypeOf]]</td>
<td>() <b><i>→</i></b> Object or Null</td>
<td>Determine the object that provides inherited properties for this object. A <b>null</b> value indicates that there are no inherited properties.</td>
</tr>
<tr>
<td>[[SetPrototypeOf]]</td>
<td>(<i>Object</i> or Null) <b><i>→</i></b> Boolean</td>
<td>Associate with this object another object that provides inherited properties. Passing <b>null</b> indicates that there are no inherited properties. Returns <b>true</b> indicating that the operation was completed successfully or <b>false</b> indicating that the operation was not successful.</td>
</tr>
<tr>
<td>[[IsExtensible]]</td>
<td>( ) <b><i>→</i></b> Boolean</td>
<td>Determine whether it is permitted to add additional properties to this object.</td>
</tr>
<tr>
<td>[[PreventExtensions]]</td>
<td>( ) <b><i>→</i></b> Boolean</td>
<td>Control whether new properties may be added to this object. Returns <b>true</b> if the operation was successful or <b>false</b> if the operation was unsuccessful.</td>
</tr>
<tr>
<td>[[GetOwnProperty]]</td>
<td>(<i>propertyKey</i>) → Undefined or <a href="#sec-property-descriptor-specification-type">Property Descriptor</a></td>
<td>Return a <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> for the own property of this object whose key is <i>propertyKey</i>, or <b>undefined</b> if no such property exists.</td>
</tr>
<tr>
<td>[[HasProperty]]</td>
<td>(<i>propertyKey</i>) <b><i>→</i></b> Boolean</td>
<td>Return a Boolean value indicating whether this object already has either an own or inherited property whose key is <i>propertyKey</i>.</td>
</tr>
<tr>
<td>[[Get]]</td>
<td>(<i>propertyKey</i>, <i>Receiver</i>) <i><b>→</b> any</i></td>
<td>Return the value of the property whose key is <i>propertyKey</i> from this object. If any ECMAScript code must be executed to retrieve the property value, <i>Receiver</i> is used as the <b>this</b> value when evaluating the code.</td>
</tr>
<tr>
<td>[[Set]]</td>
<td>(<i>propertyKey</i>,<i>value</i>, <i>Receiver</i>) <br><i><b>→</b> Boolean</i></td>
<td>Set the value of this object property whose key is <i>propertyKey</i> to <i>value</i>. If any ECMAScript code must be executed to set the property value, <i>Receiver</i> is used as the <b>this</b> value when evaluating the code. Returns <b>true</b> if that the property value was set or <b>false</b> if that it could not be set.</td>
</tr>
<tr>
<td>[[Delete]]</td>
<td>(<i>propertyKey</i>) <b><i>→</i></b> Boolean</td>
<td>Remove the own property whose key is <i>propertyKey</i> from this object . Return <span class="value">false</span> if the property was not deleted and is still present. Return <span class="value">true</span> if the property was deleted or is not present.</td>
</tr>
<tr>
<td>[[DefineOwnProperty]]</td>
<td>(<i>propertyKey,PropertyDescriptor</i>)<b><i><br>→</i></b> Boolean</td>
<td>Create or alter the own property, whose key is <i>propertyKey</i>, to have the state described by <i>PropertyDescriptor</i>. Return <span class="value">true</span> if that the property was successfully created/updated or <span class="value">false</span> if the property could not be created or updated.</td>
</tr>
<tr>
<td>[[Enumerate]]</td>
<td>()<b><i>→</i></b>Object</td>
<td>Return an iterator object that produces the keys of the string-keyed enumerable properties of the object.</td>
</tr>
<tr>
<td>[[OwnPropertyKeys]]</td>
<td>()<b><i>→</i></b><a href="#sec-list-and-record-specification-type">List</a> of propertyKey</td>
<td>Return a <a href="#sec-list-and-record-specification-type">List</a> whose elements are all of the own property keys for the object.</td>
</tr>
</table>
</figure>
<p><a href="#table-6">Table 6</a> summarizes additional essential internal methods that are supported by objects that may
be called as functions. A <i>function object</i> is an object that supports the [[Call]] internal methods. A
<i>constructor</i> (also referred to as a <i>constructor function</i>) is a function object that supports the
[[Construct]] internal method.</p>
<figure>
<figcaption><span id="table-6">Table 6</span> — Additional Essential Internal Methods of Function Objects</figcaption>
<table class="real-table">
<tr>
<th>Internal Method</th>
<th>Signature</th>
<th>Description</th>
</tr>
<tr>
<td>[[Call]]</td>
<td>(<i>any</i>, a <a href="#sec-list-and-record-specification-type">List</a> of <i>any</i>)<br><span style="font-family: Times New Roman"><b><i>→</i></b></span> <i>any</i></td>
<td>Executes code associated with this object. Invoked via a function call expression. The arguments to the internal method are a <b>this</b> value and a list containing the arguments passed to the function by a call expression. Objects that implement this internal method are <i>callable</i>.</td>
</tr>
<tr>
<td>[[Construct]]</td>
<td>(a <a href="#sec-list-and-record-specification-type">List</a> of <i>any</i>, Object)<br><span style="font-family: Times New Roman"><b><i>→</i></b></span> Object</td>
<td>Creates an object. Invoked via the <code>new</code> or <code>super</code> operators. The first arguments to the internal method is a list containing the arguments of the operator. The second argument is the object to which the <code>new</code> operator was initially applied. Objects that implement this internal method are called <i>constructors</i>. A Function object is not necessarily a constructor and such non-constructor Function objects do not have a [[Construct]] internal method.</td>
</tr>
</table>
</figure>
<p>The semantics of the essential internal methods for ordinary objects and standard exotic objects are specified in <a
href="#sec-ordinary-and-exotic-objects-behaviours">clause 9</a>. If any specified use of an internal method of an exotic
object is not supported by an implementation, that usage must throw a <b>TypeError</b> exception when attempted.</p>
</section>
<section id="sec-invariants-of-the-essential-internal-methods">
<h1><span class="secnum" id="sec-6.1.7.3"><a href="#sec-invariants-of-the-essential-internal-methods"
title="link to this section">6.1.7.3</a></span> Invariants of the Essential Internal Methods</h1>
<p>The Internal Methods of Objects of an ECMAScript engine must conform to the list of invariants specified below.
Ordinary ECMAScript Objects as well as all standard exotic objects in this specification maintain these invariants.
ECMAScript Proxy objects maintain these invariants by means of runtime checks on the result of traps invoked on the
[[ProxyHandler]] object.</p>
<p>Any implementation provided exotic objects must also maintain these invariants for those objects. Violation of these
invariants may cause ECMAScript code to have unpredictable behaviour and create security issues. However, violation of
these invariants must never compromise the memory safety of an implementation.</p>
<p>An implementation must not allow these invariants to be circumvented in any manner such as by providing alternative
interfaces that implement the functionality of the essential internal methods without enforcing their invariants.</p>
<p>Definitions:</p>
<p>● The <i>target</i> of an internal method is the object upon which the internal method is called.</p>
<p>● A target is <i>non-extensible</i> if it has been observed to return false from its [[IsExtensible]]
internal method, or true from its [[PreventExtensions]] internal method.</p>
<p>● A <i>non-existent</i> property is a property that does not exist as an own property on a non-extensible
target.</p>
<p>● All references to <i><a href="#sec-samevalue">SameValue</a></i> are according to the definition of <a
href="#sec-samevalue">SameValue</a> algorithm specified in <a href="#sec-samevalue">7.2.9</a>.</p>
<p><b>[[GetPrototypeOf]] ( )</b></p>
<p>● The Type of the return value must be either Object or Null.</p>
<p>● If target is non-extensible, and [[GetPrototypeOf]] returns a value v, then any future calls to
[[GetPrototypeOf]] should return the <a href="#sec-samevalue">SameValue</a> as v.</p>
<div class="note">
<p><span class="nh">NOTE</span> An object’s prototype chain should have finite length (that is, starting from any
object, recursively applying the [[GetPrototypeOf]] internal method to its result should eventually lead to the value
null). However, this requirement is not enforceable as an object level invariant if the prototype chain includes any
exotic objects that do not use the ordinary object definition of [[GetPrototypeOf]]. Such a circular prototype chain may
result in infinite loops when accessing object properties.</p>
</div>
<p><b>[[SetPrototypeOf]] (V)</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● If target is non-extensible, [[SetPrototypeOf]] must return false, unless V is the <a
href="#sec-samevalue">SameValue</a> as the target’s observed [[GetPrototypeOf]] value.</p>
<p><b>[[PreventExtensions]] ( )</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● If [[PreventExtensions]] returns true, all future calls to [[IsExtensible]] on the target must return
false and the target is now considered non-extensible.</p>
<p><b>[[GetOwnProperty]] (P)</b></p>
<p>● The Type of the return value must be either <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> or Undefined.</p>
<p>● If the Type of the return value is <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a>, the return value must be a complete property descriptor (<a href="#sec-completepropertydescriptor">see
6.2.4.6</a>).</p>
<p>● If a property P is described as a data property with Desc.[[Value]] equal to v and Desc.[[Writable]] and
Desc.[[Configurable]] are both false, then the <a href="#sec-samevalue">SameValue</a> must be returned for the
Desc.[[Value]] attribute of the property on all future calls to [[GetOwnProperty]] ( P ).</p>
<p>● If P’s attributes other than [[Writable]] may change over time or if the property might disappear,
then P’s [[Configurable]] attribute must be true.</p>
<p>● If the [[Writable]] attribute may change from false to true, then the [[Configurable]] attribute must be
true.</p>
<p>● If the target is non-extensible and P is non-existent, then all future calls to [[GetOwnProperty]] (P)
on the target must describe P as non-existent (i.e. [[GetOwnProperty]] (P) must return undefined).</p>
<div class="note">
<p><span class="nh">NOTE</span> As a consequence of the third invariant, if a property is described as a data property
and it may return different values over time, then either or both of the Desc.[[Writable]] and Desc.[[Configurable]]
attributes must be true even if no mechanism to change the value is exposed via the other internal methods.</p>
</div>
<p><b>[[DefineOwnProperty]] (P, Desc)</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● [[DefineOwnProperty]] must return false if P has previously been observed as a non-configurable own
property of the target, unless either:</p>
<p>1.	P is a non-configurable writable own data property. A non-configurable writable data property can be changed
into a non-configurable non-writable data property.</p>
<p>2.	All attributes in Desc are the <a href="#sec-samevalue">SameValue</a> as P’s attributes.</p>
<p>● [[DefineOwnProperty]] (P, Desc) must return false if target is non-extensible and P is a non-existent own
property. That is, a non-extensible target object cannot be extended with new properties.</p>
<p><b>[[HasProperty]] ( P )</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● If P was previously observed as a non-configurable data or accessor own property of the target,
[[HasProperty]] must return true.</p>
<p><b>[[Get]] (P, Receiver)</b></p>
<p>● If P was previously observed as a non-configurable, non-writable own data property of the target with
value v, then [[Get]] must return the <a href="#sec-samevalue">SameValue</a>.</p>
<p>● If P was previously observed as a non-configurable own accessor property of the target whose [[Get]]
attribute is undefined, the [[Get]] operation must return undefined.</p>
<p><b>[[Set]] ( P, V, Receiver)</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● If P was previously observed as a non-configurable, non-writable own data property of the target, then
[[Set]] must return false unless V is the <a href="#sec-samevalue">SameValue</a> as P’s [[Value]] attribute.</p>
<p>● If P was previously observed as a non-configurable own accessor property of the target whose [[Set]]
attribute is undefined, the [[Set]] operation must return false.</p>
<p><b>[[Delete]] ( P )</b></p>
<p>● The Type of the return value must be Boolean.</p>
<p>● If P was previously observed to be a non-configurable own data or accessor property of the target,
[[Delete]] must return false.</p>
<p><b>[[Enumerate]] ( )</b></p>
<p>● The Type of the return value must be Object.</p>
<p><b>[[OwnPropertyKeys]] ( )</b></p>
<p>● The return value must be a <a href="#sec-list-and-record-specification-type">List</a>.</p>
<p>●  The Type of each element of the returned <a href="#sec-list-and-record-specification-type">List</a> is
either String or Symbol.</p>
<p>● The returned <a href="#sec-list-and-record-specification-type">List</a> must contain at least the keys of
all non-configurable own properties that have previously been observed.</p>
<p>● If the object is non-extensible, the returned <a href="#sec-list-and-record-specification-type">List</a>
must contain only the keys of all own properties of the object that are observable using [[GetOwnProperty]].</p>
<p><b>[[Construct]] ( )</b></p>
<p>● The Type of the return value must be Object.</p>
</section>
<section id="sec-well-known-intrinsic-objects">
<h1><span class="secnum" id="sec-6.1.7.4"><a href="#sec-well-known-intrinsic-objects"
title="link to this section">6.1.7.4</a></span> Well-Known Intrinsic Objects</h1>
<p>Well-known intrinsics are built-in objects that are explicitly referenced by the algorithms of this specification and
which usually have <a href="#sec-code-realms">Realm</a> specific identities. Unless otherwise specified each intrinsic
object actually corresponds to a set of similar objects, one per <a href="#sec-code-realms">Realm</a>.</p>
<p>Within this specification a reference such as %name% means the intrinsic object, associated with <a
href="#sec-execution-contexts">the current Realm</a>, corresponding to the name. Determination of <a
href="#sec-execution-contexts">the current Realm</a> and its intrinsics is described in <a
href="#sec-newglobalenvironment">8.1.2.5</a>. The well-known intrinsics are listed in <a href="#table-7">Table 7</a>.</p>
<figure>
<figcaption><span id="table-7">Table 7</span> — Well-known Intrinsic Objects</figcaption>
<table class="real-table">
<tr>
<th>Intrinsic Name</th>
<th>Global Name</th>
<th>ECMAScript Language Association</th>
</tr>
<tr>
<td>%Array%</td>
<td><code>Array</code></td>
<td>The <code>Array</code> constructor (<a href="#sec-array-constructor">22.1.1</a>)</td>
</tr>
<tr>
<td>%ArrayBuffer%</td>
<td><code>ArrayBuffer</code></td>
<td>The <code>ArrayBuffer</code> constructor (<a href="#sec-arraybuffer-constructor">24.1.2</a>)</td>
</tr>
<tr>
<td>%ArrayBufferPrototype%</td>
<td><code><a href="#sec-arraybuffer.prototype">ArrayBuffer.prototype</a></code></td>
<td>The initial value of the <code>prototype</code> data property of %ArrayBuffer%.</td>
</tr>
<tr>
<td>%ArrayIteratorPrototype%</td>
<td></td>
<td>The prototype of Array iterator objects (<a href="#sec-array-iterator-objects">22.1.5</a>)</td>
</tr>
<tr>
<td>%ArrayPrototype%</td>
<td><code>Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Array% (<a href="#sec-properties-of-the-array-prototype-object">22.1.3</a>)</td>
</tr>
<tr>
<td>%ArrayProto_values%</td>
<td><code><a href="#sec-array.prototype.values">Array.prototype.values</a></code></td>
<td>The initial value of the <code>values</code> data property of %ArrayPrototype% (<a href="#sec-array.prototype.values">22.1.3.29</a>)</td>
</tr>
<tr>
<td>%Boolean%</td>
<td><code>Boolean</code></td>
<td>The <code>Boolean</code> constructor (<a href="#sec-boolean-constructor">19.3.1</a>)</td>
</tr>
<tr>
<td>%BooleanPrototype%</td>
<td><code>Boolean.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Boolean% (<a href="#sec-properties-of-the-boolean-prototype-object">19.3.3</a>)</td>
</tr>
<tr>
<td>%DataView%</td>
<td><code>DataView</code></td>
<td>The <code>DataView</code> constructor (<a href="#sec-dataview-constructor">24.2.2</a>)</td>
</tr>
<tr>
<td>%DataViewPrototype%</td>
<td><code><a href="#sec-dataview.prototype">DataView.prototype</a></code></td>
<td>The initial value of the <code>prototype</code> data property of %DataView%</td>
</tr>
<tr>
<td>%Date%</td>
<td><code>Date</code></td>
<td>The <code>Date</code> constructor (<a href="#sec-date-constructor">20.3.2</a>)</td>
</tr>
<tr>
<td>%DatePrototype%</td>
<td><code>Date.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Date%.</td>
</tr>
<tr>
<td>%decodeURI%</td>
<td><code>decodeURI</code></td>
<td>The <code>decodeURI</code> function (<a href="#sec-decodeuri-encodeduri">18.2.6.2</a>)</td>
</tr>
<tr>
<td>%decodeURIComponent%</td>
<td><code>decodeURIComponent</code></td>
<td>The <code>decodeURIComponent</code> function (<a href="#sec-decodeuricomponent-encodeduricomponent">18.2.6.3</a>)</td>
</tr>
<tr>
<td>%encodeURI%</td>
<td><code>encodeURI</code></td>
<td>The <code>encodeURI</code> function (<a href="#sec-encodeuri-uri">18.2.6.4</a>)</td>
</tr>
<tr>
<td>%encodeURIComponent%</td>
<td><code>encodeURIComponent</code></td>
<td>The <code>encodeURIComponent</code> function (<a href="#sec-encodeuricomponent-uricomponent">18.2.6.5</a>)</td>
</tr>
<tr>
<td>%Error%</td>
<td><code>Error</code></td>
<td>The <code>Error</code> constructor (<a href="#sec-error-constructor">19.5.1</a>)</td>
</tr>
<tr>
<td>%ErrorPrototype%</td>
<td><code>Error.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Error%</td>
</tr>
<tr>
<td>%eval%</td>
<td><code>eval</code></td>
<td>The <code>eval</code> function (<a href="#sec-eval-x">18.2.1</a>)</td>
</tr>
<tr>
<td>%EvalError%</td>
<td><code>EvalError</code></td>
<td>The <code>EvalError</code> constructor (<a href="#sec-native-error-types-used-in-this-standard-evalerror">19.5.5.1</a>)</td>
</tr>
<tr>
<td>%EvalErrorPrototype%</td>
<td><code>EvalError.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %EvalError%</td>
</tr>
<tr>
<td>%Float32Array%</td>
<td><code><a href="#sec-float32array">Float32Array</a></code></td>
<td>The <code><a href="#sec-float32array">Float32Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Float32ArrayPrototype%</td>
<td><code>Float32Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Float32Array%.</td>
</tr>
<tr>
<td>%Float64Array%</td>
<td><code><a href="#sec-float64array">Float64Array</a></code></td>
<td>The <code><a href="#sec-float64array">Float64Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Float64ArrayPrototype%</td>
<td><code>Float64Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Float64Array%</td>
</tr>
<tr>
<td>%Function%</td>
<td><code>Function</code></td>
<td>The <code>Function</code> constructor (<a href="#sec-function-constructor">19.2.1</a>)</td>
</tr>
<tr>
<td>%FunctionPrototype%</td>
<td><code>Function.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Function%</td>
</tr>
<tr>
<td>%Generator%</td>
<td></td>
<td>The initial value of the <code>prototype</code> property of %GeneratorFunction%</td>
</tr>
<tr>
<td>%GeneratorFunction%</td>
<td></td>
<td>The constructor of generator objects (<a href="#sec-generatorfunction-constructor">25.2.1</a>)</td>
</tr>
<tr>
<td>%GeneratorPrototype%</td>
<td></td>
<td>The initial value of the <code>prototype</code> property of %Generator%</td>
</tr>
<tr>
<td>%Int8Array%</td>
<td><code><a href="#sec-int8array">Int8Array</a></code></td>
<td>The <code><a href="#sec-int8array">Int8Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Int8ArrayPrototype%</td>
<td><code>Int8Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Int8Array%</td>
</tr>
<tr>
<td>%Int16Array%</td>
<td><code><a href="#sec-int16array">Int16Array</a></code></td>
<td>The <code><a href="#sec-int16array">Int16Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Int16ArrayPrototype%</td>
<td><code>Int16Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Int16Array%</td>
</tr>
<tr>
<td>%Int32Array%</td>
<td><code><a href="#sec-int32array">Int32Array</a></code></td>
<td>The <code><a href="#sec-int32array">Int32Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Int32ArrayPrototype%</td>
<td><code>Int32Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Int32Array%</td>
</tr>
<tr>
<td>%isFinite%</td>
<td><code>isFinite</code></td>
<td>The <code>isFinite</code> function (<a href="#sec-isfinite-number">18.2.2</a>)</td>
</tr>
<tr>
<td>%isNaN%</td>
<td><code>isNaN</code></td>
<td>The <code>isNaN</code> function (<a href="#sec-isnan-number">18.2.3</a>)</td>
</tr>
<tr>
<td>%IteratorPrototype%</td>
<td></td>
<td>An object that all standard built-in iterator objects indirectly inherit from</td>
</tr>
<tr>
<td>%JSON%</td>
<td><code>JSON</code></td>
<td>The <code>JSON</code> object (<a href="#sec-json-object">24.3</a>)</td>
</tr>
<tr>
<td>%Map%</td>
<td><code>Map</code></td>
<td>The <code>Map</code> constructor (<a href="#sec-map-constructor">23.1.1</a>)</td>
</tr>
<tr>
<td>%MapIteratorPrototype%</td>
<td></td>
<td>The prototype of Map iterator objects (<a href="#sec-map-iterator-objects">23.1.5</a>)</td>
</tr>
<tr>
<td>%MapPrototype%</td>
<td><code>Map.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Map%</td>
</tr>
<tr>
<td>%Math%</td>
<td><code>Math</code></td>
<td>The <code>Math</code> object (<a href="#sec-math-object">20.2</a>)</td>
</tr>
<tr>
<td>%Number%</td>
<td><code>Number</code></td>
<td>The <code>Number</code> constructor (<a href="#sec-number-constructor">20.1.1</a>)</td>
</tr>
<tr>
<td>%NumberPrototype%</td>
<td><code>Number.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %Number%</td>
</tr>
<tr>
<td>%Object%</td>
<td><code>Object</code></td>
<td>The <code>Object</code> constructor (<a href="#sec-object-constructor">19.1.1</a>)</td>
</tr>
<tr>
<td>%ObjectPrototype%</td>
<td><code>Object.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Object%. (<a href="#sec-properties-of-the-object-prototype-object">19.1.3</a>)</td>
</tr>
<tr>
<td>%ObjProto_toString%</td>
<td><code>Object.prototype.<br>toString</code></td>
<td>The initial value of the <code>toString</code> data property of %ObjectPrototype% (<a href="#sec-object.prototype.tostring">19.1.3.6</a>)</td>
</tr>
<tr>
<td>%parseFloat%</td>
<td><code>parseFloat</code></td>
<td>The <code>parseFloat</code> function (<a href="#sec-parsefloat-string">18.2.4</a>)</td>
</tr>
<tr>
<td>%parseInt%</td>
<td><code>parseInt</code></td>
<td>The <code>parseInt</code> function (<a href="#sec-parseint-string-radix">18.2.5</a>)</td>
</tr>
<tr>
<td>%Promise%</td>
<td><code>Promise</code></td>
<td>The <code>Promise</code> constructor (<a href="#sec-promise-constructor">25.4.3</a>)</td>
</tr>
<tr>
<td>%PromisePrototype%</td>
<td><code>Promise.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Promise%</td>
</tr>
<tr>
<td>%Proxy%</td>
<td><code>Proxy</code></td>
<td>The <code>Proxy</code> constructor (<a href="#sec-proxy-constructor">26.2.1</a>)</td>
</tr>
<tr>
<td>%RangeError%</td>
<td><code>RangeError</code></td>
<td>The <code>RangeError</code> constructor (<a href="#sec-native-error-types-used-in-this-standard-rangeerror">19.5.5.2</a>)</td>
</tr>
<tr>
<td>%RangeErrorPrototype%</td>
<td><code>RangeError.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %RangeError%</td>
</tr>
<tr>
<td>%ReferenceError%</td>
<td><code>ReferenceError</code></td>
<td>The <code>ReferenceError</code> constructor (<a href="#sec-native-error-types-used-in-this-standard-referenceerror">19.5.5.3</a>)</td>
</tr>
<tr>
<td>%ReferenceErrorPrototype%</td>
<td><code>ReferenceError.<br>prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %ReferenceError%</td>
</tr>
<tr>
<td>%Reflect%</td>
<td><code>Reflect</code></td>
<td>The <code>Reflect</code> object (<a href="#sec-reflect-object">26.1</a>)</td>
</tr>
<tr>
<td>%RegExp%</td>
<td><code>RegExp</code></td>
<td>The <code>RegExp</code> constructor (<a href="#sec-regexp-constructor">21.2.3</a>)</td>
</tr>
<tr>
<td>%RegExpPrototype%</td>
<td><code><a href="#sec-regexp.prototype">RegExp.prototype</a></code></td>
<td>The initial value of the <code>prototype</code> data property of %RegExp%</td>
</tr>
<tr>
<td>%Set%</td>
<td><code>Set</code></td>
<td>The <code>Set</code> constructor (<a href="#sec-set-constructor">23.2.1</a>)</td>
</tr>
<tr>
<td>%SetIteratorPrototype%</td>
<td></td>
<td>The prototype of Set iterator objects (<a href="#sec-set-iterator-objects">23.2.5</a>)</td>
</tr>
<tr>
<td>%SetPrototype%</td>
<td><code>Set.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Set%</td>
</tr>
<tr>
<td>%String%</td>
<td><code>String</code></td>
<td>The <code>String</code> constructor (<a href="#sec-string-constructor">21.1.1</a>)</td>
</tr>
<tr>
<td>%StringIteratorPrototype%</td>
<td></td>
<td>The prototype of String iterator objects (<a href="#sec-string-iterator-objects">21.1.5</a>)</td>
</tr>
<tr>
<td>%StringPrototype%</td>
<td><code>String.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %String%</td>
</tr>
<tr>
<td>%Symbol%</td>
<td><code>Symbol</code></td>
<td>The <code>Symbol</code> constructor (<a href="#sec-symbol-constructor">19.4.1</a>)</td>
</tr>
<tr>
<td>%SymbolPrototype%</td>
<td><code>Symbol.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Symbol%. (<a href="#sec-properties-of-the-symbol-prototype-object">19.4.3</a>)</td>
</tr>
<tr>
<td>%SyntaxError%</td>
<td><code>SyntaxError</code></td>
<td>The <code>SyntaxError</code> constructor (<a href="#sec-native-error-types-used-in-this-standard-syntaxerror">19.5.5.4</a>)</td>
</tr>
<tr>
<td>%SyntaxErrorPrototype%</td>
<td><code>SyntaxError.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %SyntaxError%</td>
</tr>
<tr>
<td><a href="#sec-%throwtypeerror%">%ThrowTypeError%</a></td>
<td></td>
<td>A function object that unconditionally throws a new instance of %TypeError%</td>
</tr>
<tr>
<td>%TypedArray%</td>
<td></td>
<td>The super class of all typed Array constructors (<a href="#sec-%typedarray%-intrinsic-object">22.2.1</a>)</td>
</tr>
<tr>
<td>%TypedArrayPrototype%</td>
<td></td>
<td>The initial value of the <code>prototype</code> property of %TypedArray%</td>
</tr>
<tr>
<td>%TypeError%</td>
<td><code>TypeError</code></td>
<td>The <code>TypeError</code> constructor (<a href="#sec-native-error-types-used-in-this-standard-typeerror">19.5.5.5</a>)</td>
</tr>
<tr>
<td>%TypeErrorPrototype%</td>
<td><code>TypeError.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %TypeError%</td>
</tr>
<tr>
<td>%Uint8Array%</td>
<td><code><a href="#sec-uint8array">Uint8Array</a></code></td>
<td>The <code><a href="#sec-uint8array">Uint8Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Uint8ArrayPrototype%</td>
<td><code>Uint8Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Uint8Array%</td>
</tr>
<tr>
<td>%Uint8ClampedArray%</td>
<td><code><a href="#sec-uint8clampedarray">Uint8ClampedArray</a></code></td>
<td>The <code><a href="#sec-uint8clampedarray">Uint8ClampedArray</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Uint8ClampedArrayPrototype%</td>
<td><code><a href="#sec-uint8clampedarray">Uint8ClampedArray</a>.<br>prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Uint8ClampedArray%</td>
</tr>
<tr>
<td>%Uint16Array%</td>
<td><code><a href="#sec-uint16array">Uint16Array</a></code></td>
<td>The <code><a href="#sec-uint16array">Uint16Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Uint16ArrayPrototype%</td>
<td><code>Uint16Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Uint16Array%</td>
</tr>
<tr>
<td>%Uint32Array%</td>
<td><code><a href="#sec-uint32array">Uint32Array</a></code></td>
<td>The <code><a href="#sec-uint32array">Uint32Array</a></code> constructor (<a href="#sec-typedarray-objects">22.2</a>)</td>
</tr>
<tr>
<td>%Uint32ArrayPrototype%</td>
<td><code>Uint32Array.prototype</code></td>
<td>The initial value of the <code>prototype</code> data property of %Uint32Array%</td>
</tr>
<tr>
<td>%URIError%</td>
<td><code><a href="#sec-constructor-properties-of-the-global-object-urierror">URIError</a></code></td>
<td>The <code><a href="#sec-constructor-properties-of-the-global-object-urierror">URIError</a></code> constructor (<a href="#sec-native-error-types-used-in-this-standard-urierror">19.5.5.6</a>)</td>
</tr>
<tr>
<td>%URIErrorPrototype%</td>
<td><code>URIError.prototype</code></td>
<td>The initial value of the <code>prototype</code> property of %URIError%</td>
</tr>
<tr>
<td>%WeakMap%</td>
<td><code>WeakMap</code></td>
<td>The <code>WeakMap</code> constructor (<a href="#sec-weakmap-constructor">23.3.1</a>)</td>
</tr>
<tr>
<td>%WeakMapPrototype%</td>
<td><code><a href="#sec-weakmap.prototype">WeakMap.prototype</a></code></td>
<td>The initial value of the <code>prototype</code> data property of %WeakMap%</td>
</tr>
<tr>
<td>%WeakSet%</td>
<td><code>WeakSet</code></td>
<td>The <code>WeakSet</code> constructor (<a href="#sec-weakset-constructor">23.4.1</a>)</td>
</tr>
<tr>
<td>%WeakSetPrototype%</td>
<td><code><a href="#sec-weakset.prototype">WeakSet.prototype</a></code></td>
<td>The initial value of the <code>prototype</code> data property of %WeakSet%</td>
</tr>
</table>
</figure>
</section>
</section>
</section>
<section id="sec-ecmascript-specification-types">
<div class="front">
<h1><span class="secnum" id="sec-6.2"><a href="#sec-ecmascript-specification-types"
title="link to this section">6.2</a></span> ECMAScript Specification Types</h1>
<p>A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript
language constructs and ECMAScript language types. The specification types are <a
href="#sec-reference-specification-type">Reference</a>, <a href="#sec-list-and-record-specification-type">List</a>, <a
href="#sec-completion-record-specification-type">Completion</a>, <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a>, <a href="#sec-lexical-environments">Lexical
Environment</a>, <a href="#sec-environment-records">Environment Record</a>, and <a href="#sec-data-blocks">Data Block</a>.
Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an
ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression
evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.</p>
</div>
<section id="sec-list-and-record-specification-type">
<h1><span class="secnum" id="sec-6.2.1"><a href="#sec-list-and-record-specification-type"
title="link to this section">6.2.1</a></span> The List and Record Specification Type</h1>
<p>The List type is used to explain the evaluation of argument lists (<a href="#sec-argument-lists">see 12.3.6</a>) in
<code>new</code> expressions, in function calls, and in other algorithms where a simple ordered list of values is needed.
Values of the List type are simply ordered sequences of list elements containing the individual values. These sequences may
be of any length. The elements of a list may be randomly accessed using 0-origin indices. For notational convenience an
array-like syntax can be used to access List elements. For example, <i>arguments</i>[2] is shorthand for saying the
3<sup>rd</sup> element of the List <i>arguments</i>.</p>
<p>For notational convenience within this specification, a literal syntax can be used to express a new List value. For
example, «1, 2» defines a List value that has two elements each of which is initialized to a specific value. A
new empty List can be expressed as «».</p>
<p>The Record type is used to describe data aggregations within the algorithms of this specification. A Record type value
consists of one or more named fields. The value of each field is either an ECMAScript value or an abstract value represented
by a name associated with the Record type. Field names are always enclosed in double brackets, for example [[value]].</p>
<p>For notational convenience within this specification, an object literal-like syntax can be used to express a Record
value. For example, {[[field1]]: 42, [[field2]]: <b>false</b>, [[field3]]: <b>empty</b>} defines a Record value that has
three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not
explicitly listed are considered to be absent.</p>
<p>In specification text and algorithms, dot notation may be used to refer to a specific field of a Record value. For
example, if R is the record shown in the previous paragraph then R.[[field2]] is shorthand for “the field of R named
[[field2]]”.</p>
<p>Schema for commonly used Record field combinations may be named, and that name may be used as a prefix to a literal
Record value to identify the specific kind of aggregations that is being described. For example:
PropertyDescriptor{[[Value]]: 42, [[Writable]]: <b>false</b>, [[Configurable]]: <b>true</b>}.</p>
</section>
<section id="sec-completion-record-specification-type">
<div class="front">
<h1><span class="secnum" id="sec-6.2.2"><a href="#sec-completion-record-specification-type"
title="link to this section">6.2.2</a></span> The Completion Record Specification Type</h1>
<p>The Completion type is a Record used to explain the runtime propagation of values and control flow such as the
behaviour of statements (<code>break</code>, <code>continue</code>, <code>return</code> and <code>throw</code>) that
perform nonlocal transfers of control.</p>
<p>Values of the Completion type are Record values whose fields are defined as by <a href="#table-8">Table 8</a>.</p>
<figure>
<figcaption><span id="table-8">Table 8</span> — Completion Record Fields</figcaption>
<table class="real-table">
<tr>
<th>Field</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[type]]</td>
<td>One of <b>normal</b>, <b>break</b>, <b>continue</b>, <b>return</b>, or <b>throw</b></td>
<td>The type of completion that occurred.</td>
</tr>
<tr>
<td>[[value]]</td>
<td>any <a href="#sec-ecmascript-language-types">ECMAScript language value</a> or <b>empty</b></td>
<td>The value that was produced.</td>
</tr>
<tr>
<td>[[target]]</td>
<td>any ECMAScript string or <b>empty</b></td>
<td>The target label for directed control transfers.</td>
</tr>
</table>
</figure>
<p>The term “abrupt completion” refers to any completion with a <span style="font-family: Times New
Roman">[[type]]</span> value other than <b>normal</b>.</p>
</div>
<section id="sec-normalcompletion">
<h1><span class="secnum" id="sec-6.2.2.1"><a href="#sec-normalcompletion" title="link to this section">6.2.2.1</a></span>
NormalCompletion</h1>
<p>The abstract operation NormalCompletion with a single <i>argument</i>, such as:</p>
<ol class="proc">
<li>Return NormalCompletion(<i>argument</i>).</li>
</ol>
<p>Is a shorthand that is defined as follows:</p>
<ol class="proc">
<li>Return <a href="#sec-completion-record-specification-type">Completion</a>{[[type]]: <span style="font-family:
sans-serif">normal</span>, [[value]]: <i>argument</i>, [[target]]:<span style="font-family:
sans-serif">empty</span>}.</li>
</ol>
</section>
<section id="sec-implicit-completion-values">
<h1><span class="secnum" id="sec-6.2.2.2"><a href="#sec-implicit-completion-values"
title="link to this section">6.2.2.2</a></span> Implicit Completion Values</h1>
<p>The algorithms of this specification often implicitly return <a
href="#sec-completion-record-specification-type">Completion</a> Records whose [[type]] is <b>normal</b>. Unless it is
otherwise obvious from the context, an algorithm statement that returns a value that is not a <a
href="#sec-completion-record-specification-type">Completion Record</a>, such as:</p>
<ol class="proc">
<li>Return <code>"Infinity"</code>.</li>
</ol>
<p>means the same thing as:</p>
<ol class="proc">
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<code>"Infinity"</code>).</li>
</ol>
<p>However, if the value expression of a “<span style="font-family: Times New Roman">return</span>” statement
is a <a href="#sec-completion-record-specification-type">Completion Record</a> construction literal, the resulting <a
href="#sec-completion-record-specification-type">Completion Record</a> is returned. If the value expression is a call to
an abstract operation, the “<span style="font-family: Times New Roman">return</span>” statement simply returns
the <a href="#sec-completion-record-specification-type">Completion Record</a> produced by the abstract operation.</p>
<p>The abstract operation <span style="font-family: Times New Roman"><a
href="#sec-completion-record-specification-type">Completion</a>(<i>completionRecord</i>)</span> is used to emphasize that
a previously computed <a href="#sec-completion-record-specification-type">Completion Record</a> is being returned. The <a
href="#sec-completion-record-specification-type">Completion</a> abstract operation takes a single argument,
<var>completionRecord</var>, and performs the following steps: such as</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>completionRecord</i> is a <a
href="#sec-completion-record-specification-type">Completion Record</a>.</li>
<li>Return <i>completionRecord</i> as the <a href="#sec-completion-record-specification-type">Completion Record</a> of
this abstract operation.</li>
</ol>
<p>A “<span style="font-family: Times New Roman">return</span>” statement without a value in an algorithm step
means the same thing as:</p>
<ol class="proc">
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
<p>Any reference to a <a href="#sec-completion-record-specification-type">Completion Record</a> value that is in a context
that does not explicitly require a complete <a href="#sec-completion-record-specification-type">Completion Record</a>
value is equivalent to an explicit reference to the [[value]] field of the <a
href="#sec-completion-record-specification-type">Completion Record</a> value unless the <a
href="#sec-completion-record-specification-type">Completion Record</a> is an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</p>
</section>
<section id="sec-throw-an-exception">
<h1><span class="secnum" id="sec-6.2.2.3"><a href="#sec-throw-an-exception"
title="link to this section">6.2.2.3</a></span> Throw an Exception</h1>
<p>Algorithms steps that say to throw an exception, such as</p>
<ol class="proc">
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
<p>mean the same things as:</p>
<ol class="proc">
<li>Return <a href="#sec-completion-record-specification-type">Completion</a>{[[type]]: <span style="font-family:
sans-serif">throw</span>, [[value]]: a newly created <b>TypeError</b> object, [[target]]:<span style="font-family:
sans-serif">empty</span>}.</li>
</ol>
</section>
<section id="sec-returnifabrupt">
<h1><span class="secnum" id="sec-6.2.2.4"><a href="#sec-returnifabrupt" title="link to this section">6.2.2.4</a></span>
ReturnIfAbrupt</h1>
<p>Algorithms steps that say</p>
<ol class="proc">
<li>ReturnIfAbrupt(<i>argument</i>).</li>
</ol>
<p>mean the same thing as:</p>
<ol class="proc">
<li>If <i>argument</i> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return
<i>argument</i>.</li>
<li>Else if <i>argument</i> is a <a href="#sec-completion-record-specification-type">Completion Record</a>, let
<i>argument</i> be <i>argument</i>.[[value]].</li>
</ol>
</section>
</section>
<section id="sec-reference-specification-type">
<div class="front">
<h1><span class="secnum" id="sec-6.2.3"><a href="#sec-reference-specification-type"
title="link to this section">6.2.3</a></span> The Reference Specification Type</h1>
<div class="note">
<p><span class="nh">NOTE</span> The Reference type is used to explain the behaviour of such operators as
<code>delete</code>, <code>typeof</code>, the assignment operators, the <code>super</code> keyword and other language
features. For example, the left-hand operand of an assignment is expected to produce a reference.</p>
</div>
<p>A <b>Reference</b> is a resolved name or property binding. A Reference consists of three components, the
<var>base</var> value, the <var>referenced name</var> and the Boolean valued <var>strict reference</var> flag. The
<var>base</var> value is either <b>undefined</b>, an Object, a Boolean, a String, a Symbol, a Number, or an <a
href="#sec-environment-records">Environment Record</a> (<a href="#sec-environment-records">8.1.1</a>). A <var>base</var>
value of <b>undefined</b> indicates that the Reference could not be resolved to a binding. The <var>referenced name</var>
is a String or Symbol value.</p>
<p>A Super Reference is a Reference that is used to represents a name binding that was expressed using the super keyword.
A Super Reference has an additional <var>thisValue</var> component and its <var>base</var> value will never be an <a
href="#sec-environment-records">Environment Record</a>.</p>
<p>The following abstract operations are used in this specification to access the components of references:</p>
<ul>
<li>
<p>GetBase(V). Returns the <i>base</i> value component of the reference V.</p>
</li>
<li>
<p>GetReferencedName(V). Returns the <i>referenced name</i> component of the reference V.</p>
</li>
<li>
<p>IsStrictReference(V). Returns the <i>strict reference</i> flag component of the reference V.</p>
</li>
<li>
<p>HasPrimitiveBase(V). Returns <b>true</b> if <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>base</i>)
is Boolean, String, Symbol, or Number.</p>
</li>
<li>
<p>IsPropertyReference(V). Returns <b>true</b> if either the <i>base</i> value is an object or HasPrimitiveBase(V) is
<b>true</b>; otherwise returns <b>false</b>.</p>
</li>
<li>
<p>IsUnresolvableReference(V). Returns <b>true</b> if the <i>base</i> value is <b>undefined</b> and <b>false</b>
otherwise.</p>
</li>
<li>
<p>IsSuperReference(V). Returns <b>true</b> if this reference has a <i>thisValue</i> component.</p>
</li>
</ul>
<p>The following abstract operations are used in this specification to operate on references:</p>
</div>
<section id="sec-getvalue">
<h1><span class="secnum" id="sec-6.2.3.1"><a href="#sec-getvalue" title="link to this section">6.2.3.1</a></span> GetValue
(V)</h1>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>V</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is not <a
href="#sec-reference-specification-type">Reference</a>, return <i>V</i>.</li>
<li>Let <i>base</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>V</i>).</li>
<li>If <a href="#sec-reference-specification-type">IsUnresolvableReference</a>(<i>V</i>), throw a <b>ReferenceError</b>
exception.</li>
<li>If <a href="#sec-reference-specification-type">IsPropertyReference</a>(<i>V</i>), then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">HasPrimitiveBase</a>(<i>V</i>) is <b>true</b>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: In this case, <i>base</i> will never be <b>null</b> or
<b>undefined</b>.</li>
<li>Let <i>base</i> be <a href="#sec-toobject">ToObject</a>(<i>base</i>).</li>
</ol>
</li>
<li>Return <i>base.</i>[[Get]](<a href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>), <a
href="#sec-getthisvalue">GetThisValue</a>(<i>V</i>)).</li>
</ol>
</li>
<li>Else <i>base</i> must be an <a href="#sec-environment-records">Environment Record</a>,
<ol class="block">
<li>Return <i>base.</i>GetBindingValue(<a href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>),
<a href="#sec-reference-specification-type">IsStrictReference</a>(<i>V</i>)) (<a
href="#sec-environment-records">see 8.1.1</a>).</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The object that may be created in step 5.a.ii is not accessible outside of the above
abstract operation and the ordinary object [[Get]] internal method. An implementation might choose to avoid the actual
creation of the object.</p>
</div>
</section>
<section id="sec-putvalue">
<h1><span class="secnum" id="sec-6.2.3.2"><a href="#sec-putvalue" title="link to this section">6.2.3.2</a></span> PutValue
(V, W)</h1>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>V</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>W</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is not <a
href="#sec-reference-specification-type">Reference</a>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>base</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>V</i>).</li>
<li>If <a href="#sec-reference-specification-type">IsUnresolvableReference</a>(<i>V</i>), then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">IsStrictReference</a>(<i>V</i>) is <b>true</b>, then
<ol class="block">
<li>Throw <b>ReferenceError</b> exception.</li>
</ol>
</li>
<li>Let <i>globalObj</i> be <a href="#sec-getglobalobject">GetGlobalObject</a>().</li>
<li>Return <a href="#sec-set-o-p-v-throw">Set</a>(<i>globalObj</i>,<a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>), <i>W</i>, <b>false</b>).</li>
</ol>
</li>
<li>Else if <a href="#sec-reference-specification-type">IsPropertyReference</a>(<i>V</i>), then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">HasPrimitiveBase</a>(<i>V</i>) is <b>true</b>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: In this case, <i>base</i> will never be <b>null</b> or
<b>undefined</b>.</li>
<li>Set <i>base</i> to <a href="#sec-toobject">ToObject</a>(<i>base</i>).</li>
</ol>
</li>
<li>Let <i>succeeded</i> be <i>base.</i>[[Set]](<a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>), <i>W</i>, <a
href="#sec-getthisvalue">GetThisValue</a>(<i>V</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>succeeded</i>).</li>
<li>If <i>succeeded</i> is <b>false</b> and <a
href="#sec-reference-specification-type">IsStrictReference</a>(<i>V</i>) is <b>true</b>, throw a
<b>TypeError</b> exception.</li>
<li>Return.</li>
</ol>
</li>
<li>Else <i>base</i> must be an <a href="#sec-environment-records">Environment Record</a>.
<ol class="block">
<li>Return <i>base.</i>SetMutableBinding(<a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>), <i>W</i>, <a
href="#sec-reference-specification-type">IsStrictReference</a>(<i>V</i>)) (<a
href="#sec-environment-records">see 8.1.1</a>).</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The object that may be created in step 6.a.ii is not accessible outside of the above
algorithm and the ordinary object [[Set]] internal method. An implementation might choose to avoid the actual creation
of that object.</p>
</div>
</section>
<section id="sec-getthisvalue">
<h1><span class="secnum" id="sec-6.2.3.3"><a href="#sec-getthisvalue" title="link to this section">6.2.3.3</a></span>
GetThisValue (V)</h1>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-reference-specification-type">IsPropertyReference</a>(<i>V</i>) is <b>true</b>.</li>
<li>If <a href="#sec-reference-specification-type">IsSuperReference</a>(<i>V</i>), then
<ol class="block">
<li>Return the value of the <i>thisValue</i> component of the reference <i>V</i>.</li>
</ol>
</li>
<li>Return <a href="#sec-reference-specification-type">GetBase</a>(<i>V</i>).</li>
</ol>
</section>
<section id="sec-initializereferencedbinding">
<h1><span class="secnum" id="sec-6.2.3.4"><a href="#sec-initializereferencedbinding"
title="link to this section">6.2.3.4</a></span> InitializeReferencedBinding (V, W)</h1>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>V</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>W</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>)
is <a href="#sec-reference-specification-type">Reference</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-reference-specification-type">IsUnresolvableReference</a>(<i>V</i>) is <b>false</b>.</li>
<li>Let <i>base</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>V</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>base</i> is an <a href="#sec-environment-records">Environment
Record</a>.</li>
<li>Return <i>base.</i>InitializeBinding(<a href="#sec-reference-specification-type">GetReferencedName</a>(<i>V</i>),
<i>W</i>).</li>
</ol>
</section>
</section>
<section id="sec-property-descriptor-specification-type">
<div class="front">
<h1><span class="secnum" id="sec-6.2.4"><a href="#sec-property-descriptor-specification-type"
title="link to this section">6.2.4</a></span> The Property Descriptor Specification Type</h1>
<p>The Property Descriptor type is used to explain the manipulation and reification of Object property attributes. Values
of the Property Descriptor type are Records. Each field’s name is an attribute name and its value is a corresponding
attribute value as specified in <a href="#sec-property-attributes">6.1.7.1</a>. In addition, any field may be present or
absent. The schema name used within this specification to tag literal descriptions of Property Descriptor records is
“PropertyDescriptor”.</p>
<p>Property Descriptor values may be further classified as data Property Descriptors and accessor Property Descriptors
based upon the existence or use of certain fields. A data Property Descriptor is one that includes any fields named either
[[Value]] or [[Writable]]. An accessor Property Descriptor is one that includes any fields named either [[Get]] or
[[Set]]. Any Property Descriptor may have fields named [[Enumerable]] and [[Configurable]]. A Property Descriptor value
may not be both a data Property Descriptor and an accessor Property Descriptor; however, it may be neither. A generic
Property Descriptor is a Property Descriptor value that is neither a data Property Descriptor nor an accessor Property
Descriptor. A fully populated Property Descriptor is one that is either an accessor Property Descriptor or a data Property
Descriptor and that has all of the fields that correspond to the property attributes defined in either <a
href="#table-2">Table 2</a> or <a href="#table-3">Table 3</a>.</p>
<p>The following abstract operations are used in this specification to operate upon Property Descriptor values:</p>
</div>
<section id="sec-isaccessordescriptor">
<h1><span class="secnum" id="sec-6.2.4.1"><a href="#sec-isaccessordescriptor"
title="link to this section">6.2.4.1</a></span> IsAccessorDescriptor ( Desc )</h1>
<p>When the abstract operation IsAccessorDescriptor is called with <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span>, the following
steps are taken:</p>
<ol class="proc">
<li>If <i>Desc</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>If both <i>Desc</i>.[[Get]] and <i>Desc</i>.[[Set]] are absent, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-isdatadescriptor">
<h1><span class="secnum" id="sec-6.2.4.2"><a href="#sec-isdatadescriptor" title="link to this section">6.2.4.2</a></span>
IsDataDescriptor ( Desc )</h1>
<p>When the abstract operation IsDataDescriptor is called with <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span>, the following
steps are taken:</p>
<ol class="proc">
<li>If <i>Desc</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>If both <i>Desc</i>.[[Value]] and <i>Desc</i>.[[Writable]] are absent, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-isgenericdescriptor">
<h1><span class="secnum" id="sec-6.2.4.3"><a href="#sec-isgenericdescriptor"
title="link to this section">6.2.4.3</a></span> IsGenericDescriptor ( Desc )</h1>
<p>When the abstract operation IsGenericDescriptor is called with <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span>, the following
steps are taken:</p>
<ol class="proc">
<li>If <i>Desc</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>Desc</i>) and <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>Desc</i>) are both <b>false</b>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-frompropertydescriptor">
<h1><span class="secnum" id="sec-6.2.4.4"><a href="#sec-frompropertydescriptor"
title="link to this section">6.2.4.4</a></span> FromPropertyDescriptor ( Desc )</h1>
<p>When the abstract operation FromPropertyDescriptor is called with <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span>, the following
steps are taken:</p>
<ol class="proc">
<li>If <i>Desc</i> is <b>undefined</b>, return <b>undefined</b>.</li>
<li>Let <i>obj</i> be <a href="#sec-objectcreate">ObjectCreate</a>(<span style="font-family:
sans-serif">%ObjectPrototype%</span>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>obj</i> is an extensible ordinary object with no own
properties.</li>
<li>If <i>Desc</i> has a [[Value]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>,
<code>"value"</code>, <i>Desc</i>.[[Value]]).</li>
</ol>
</li>
<li>If <i>Desc</i> has a [[Writable]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>,
<code>"writable"</code>, <i>Desc</i>.[[Writable]]).</li>
</ol>
</li>
<li>If <i>Desc</i> has a [[Get]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>,
<code>"get",</code> <i>Desc</i>.[[Get]]).</li>
</ol>
</li>
<li>If <i>Desc</i> has a [[Set]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>,
<code>"set"</code>, <i>Desc</i>.[[Set]])</li>
</ol>
</li>
<li>If <i>Desc</i> has an [[Enumerable]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>,
<code>"enumerable"</code>, <i>Desc</i>.[[Enumerable]]).</li>
</ol>
</li>
<li>If <i>Desc</i> has a [[Configurable]] field, then
<ol class="block">
<li><a href="#sec-call">Call</a> <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i> ,
<code>"configurable"</code>, <i>Desc</i>.[[Configurable]]).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: all of the above <a
href="#sec-createdataproperty">CreateDataProperty</a> operations return <b>true</b>.</li>
<li>Return <i>obj</i>.</li>
</ol>
</section>
<section id="sec-topropertydescriptor">
<h1><span class="secnum" id="sec-6.2.4.5"><a href="#sec-topropertydescriptor"
title="link to this section">6.2.4.5</a></span> ToPropertyDescriptor ( Obj )</h1>
<p>When the abstract operation ToPropertyDescriptor is called with object <span class="nt">Obj</span>, the following steps
are taken:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>Obj</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>Obj</i>) is not Object throw a <b>TypeError</b>
exception.</li>
<li>Let <i>desc</i> be a new <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> that
initially has no fields.</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"enumerable"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>enum</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-get-o-p">Get</a>(<i>Obj</i>,
<code>"enumerable"</code>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>enum</i>).</li>
<li>Set the [[Enumerable]] field of <i>desc</i> to <i>enum</i>.</li>
</ol>
</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"configurable"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>conf</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-get-o-p">Get</a>(<i>Obj</i>,
<code>"configurable"</code>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>conf</i>).</li>
<li>Set the [[Configurable]] field of <i>desc</i> to <i>conf</i>.</li>
</ol>
</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"value"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>value</i> be <a href="#sec-get-o-p">Get</a>(<i>Obj</i>, <code>"value"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>value</i>).</li>
<li>Set the [[Value]] field of <i>desc</i> to <i>value</i>.</li>
</ol>
</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"writable"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>writable</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-get-o-p">Get</a>(<i>Obj</i>,
<code>"writable"</code>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>writable</i>).</li>
<li>Set the [[Writable]] field of <i>desc</i> to <i>writable</i>.</li>
</ol>
</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"get"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>getter</i> be <a href="#sec-get-o-p">Get</a>(<i>Obj</i>, <code>"get"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>getter</i>).</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>getter</i>) is <b>false</b> and <i>getter</i> is not
<b>undefined</b>, throw a <b>TypeError</b> exception.</li>
<li>Set the [[Get]] field of <i>desc</i> to <i>getter</i>.</li>
</ol>
</li>
<li>If <a href="#sec-hasproperty">HasProperty</a>(<i>Obj</i>, <code>"set"</code>) is <b>true</b>, then
<ol class="block">
<li>Let <i>setter</i> be <a href="#sec-get-o-p">Get</a>(<i>Obj</i>, <code>"set"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>setter</i>).</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>setter</i>) is <b>false</b> and <i>setter</i> is not
<b>undefined</b>, throw a <b>TypeError</b> exception.</li>
<li>Set the [[Set]] field of <i>desc</i> to <i>setter</i>.</li>
</ol>
</li>
<li>If either <i>desc</i>.[[Get]] or <i>desc</i>.[[Set]] are present, then
<ol class="block">
<li>If either <i>desc</i>.[[Value]] or <i>desc</i>.[[Writable]] are present, throw a <b>TypeError</b>
exception.</li>
</ol>
</li>
<li>Return <i>desc</i>.</li>
</ol>
</section>
<section id="sec-completepropertydescriptor">
<h1><span class="secnum" id="sec-6.2.4.6"><a href="#sec-completepropertydescriptor"
title="link to this section">6.2.4.6</a></span> CompletePropertyDescriptor ( Desc )</h1>
<p>When the abstract operation CompletePropertyDescriptor is called with <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span> the following
steps are taken:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>Desc</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>Desc</i> is a <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a></li>
<li>Let <i>like</i> be Record{[[Value]]: <b>undefined</b>, [[Writable]]: <b>false</b>, [[Get]]: <b>undefined</b>,
[[Set]]: <b>undefined</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]: <b>false</b>}.</li>
<li>If either <a href="#sec-isgenericdescriptor">IsGenericDescriptor</a>(<i>Desc</i>) or <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>Desc</i>) is <b>true</b>, then
<ol class="block">
<li>If <i>Desc</i> does not have a [[Value]] field, set <i>Desc</i>.[[Value]] to <i>like</i>.[[Value]].</li>
<li>If <i>Desc</i> does not have a [[Writable]] field, set <i>Desc</i>.[[Writable]] to
<i>like</i>.[[Writable]].</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>If <i>Desc</i> does not have a [[Get]] field, set <i>Desc</i>.[[Get]] to <i>like</i>.[[Get]].</li>
<li>If <i>Desc</i> does not have a [[Set]] field, set <i>Desc</i>.[[Set]] to <i>like</i>.[[Set]].</li>
</ol>
</li>
<li>If <i>Desc</i> does not have an [[Enumerable]] field, set <i>Desc</i>.[[Enumerable]] to
<i>like</i>.[[Enumerable]].</li>
<li>If <i>Desc</i> does not have a [[Configurable]] field, set <i>Desc</i>.[[Configurable]] to
<i>like</i>.[[Configurable]].</li>
<li>Return <i>Desc</i>.</li>
</ol>
</section>
</section>
<section id="sec-lexical-environment-and-environment-record-specification-types">
<h1><span class="secnum" id="sec-6.2.5"><a href="#sec-lexical-environment-and-environment-record-specification-types"
title="link to this section">6.2.5</a></span> The Lexical Environment and Environment Record Specification Types</h1>
<p>The <a href="#sec-lexical-environments">Lexical Environment</a> and <a href="#sec-environment-records">Environment
Record</a> types are used to explain the behaviour of name resolution in nested functions and blocks. These types and the
operations upon them are defined in <a href="#sec-lexical-environments">8.1</a>.</p>
</section>
<section id="sec-data-blocks">
<div class="front">
<h1><span class="secnum" id="sec-6.2.6"><a href="#sec-data-blocks" title="link to this section">6.2.6</a></span> Data
Blocks</h1>
<p>The Data Block specification type is used to describe a distinct and mutable sequence of byte-sized (8 bit) numeric
values. A Data Block value is created with a fixed number of bytes that each have the initial value 0.</p>
<p>For notational convenience within this specification, an array-like syntax can be used to express to the individual
bytes of a Data Block value. This notation presents a Data Block value as a 0-origined integer indexed sequence of bytes.
For example, if <var>db</var> is a 5 byte Data Block value then <var>db</var>[2] can be used to express access to its
3<sup>rd</sup> byte.</p>
<p>The following abstract operations are used in this specification to operate upon Data Block values:</p>
</div>
<section id="sec-createbytedatablock">
<h1><span class="secnum" id="sec-6.2.6.1"><a href="#sec-createbytedatablock"
title="link to this section">6.2.6.1</a></span> CreateByteDataBlock(size)</h1>
<p>When the abstract operation CreateByteDataBlock is called with integer argument <var>size</var>, the following steps
are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>size</i>≥0.</li>
<li>Let <i>db</i> be a new <a href="#sec-data-blocks">Data Block</a> value consisting of <i>size</i> bytes. If it is
impossible to create such a <a href="#sec-data-blocks">Data Block</a>, throw a <b>RangeError</b> exception.</li>
<li>Set all of the bytes of <i>db</i> to 0.</li>
<li>Return <i>db</i>.</li>
</ol>
</section>
<section id="sec-copydatablockbytes">
<h1><span class="secnum" id="sec-6.2.6.2"><a href="#sec-copydatablockbytes"
title="link to this section">6.2.6.2</a></span> CopyDataBlockBytes(toBlock, toIndex, fromBlock, fromIndex, count)</h1>
<p>When the abstract operation CopyDataBlockBytes is called the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>fromBlock</i> and <i>toBlock</i> are distinct <a
href="#sec-data-blocks">Data Block</a> values.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>fromIndex</i>, <i>toIndex</i>, and <i>count</i> are positive
integer values.</li>
<li>Let <i>fromSize</i> be the number of bytes in <i>fromBlock</i>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>fromIndex</i>+<i>count</i> ≤ <i>fromSize</i>.</li>
<li>Let <i>toSize</i> be the number of bytes in <i>toBlock</i>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>toIndex</i>+<i>count</i> ≤ <i>toSize</i>.</li>
<li>Repeat, while <i>count</i>>0
<ol class="block">
<li>Set <i>toBlock</i>[<i>toIndex</i>] to the value of <i>fromBlock</i>[<i>fromIndex</i>].</li>
<li>Increment <i>toIndex</i> and <i>fromIndex</i> each by 1.</li>
<li>Decrement <i>count</i> by 1.</li>
</ol>
</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family: sans-serif">empty</span>)</li>
</ol>
</section>
</section>
</section>
</section>
<section id="sec-abstract-operations">
<div class="front">
<h1><span class="secnum" id="sec-7"><a href="#sec-abstract-operations" title="link to this section">7</a></span> Abstract
Operations</h1>
<p>These operations are not a part of the ECMAScript language; they are defined here to solely to aid the specification of the
semantics of the ECMAScript language. Other, more specialized abstract operations are defined throughout this
specification.</p>
</div>
<section id="sec-type-conversion">
<div class="front">
<h1><span class="secnum" id="sec-7.1"><a href="#sec-type-conversion" title="link to this section">7.1</a></span> Type
Conversion</h1>
<p>The ECMAScript language implicitly performs automatic type conversion as needed. To clarify the semantics of certain
constructs it is useful to define a set of conversion abstract operations. The conversion abstract operations are
polymorphic; they can accept a value of any <a href="#sec-ecmascript-language-types">ECMAScript language type</a> or of a <a
href="#sec-completion-record-specification-type">Completion Record</a> value. But no other specification types are used with
these operations.</p>
</div>
<section id="sec-toprimitive">
<h1><span class="secnum" id="sec-7.1.1"><a href="#sec-toprimitive" title="link to this section">7.1.1</a></span> ToPrimitive
( input [, PreferredType] )</h1>
<p>The abstract operation ToPrimitive takes an <var>input</var> argument and an optional argument <span
class="nt">PreferredType</span>. The abstract operation ToPrimitive converts its <var>input</var> argument to a non-Object
type. If an object is capable of converting to more than one primitive type, it may use the optional hint <span
class="nt">PreferredType</span> to favour that type. Conversion occurs according to <a href="#table-9">Table 9</a>:</p>
<figure>
<figcaption><span id="table-9">Table 9</span> — ToPrimitive Conversions</figcaption>
<table class="real-table">
<tr>
<th>Input Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <var>input</var> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <var>input</var>. Otherwise return ToPrimitive(<var>input</var>.[[value]]) also passing the optional hint <span class="nt">PreferredType</span>.</td>
</tr>
<tr>
<td>Undefined</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>Null</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>Boolean</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>Number</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>String</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Return <var>input</var>.</td>
</tr>
<tr>
<td>Object</td>
<td>Perform the steps following this table.</td>
</tr>
</table>
</figure>
<p>When <span style="font-family: Times New Roman"><a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>input</i>)</span> is Object, the following steps are taken:</p>
<ol class="proc">
<li>If <i>PreferredType</i> was not passed, let <i>hint</i> be <code>"default"</code>.</li>
<li>Else if <i>PreferredType</i> is hint String, let <i>hint</i> be <code>"string"</code>.</li>
<li>Else <i>PreferredType</i> is hint Number, let <i>hint</i> be <code>"number"</code>.</li>
<li>Let <i>exoticToPrim</i> be <a href="#sec-getmethod">GetMethod</a>(<i>input</i>, @@toPrimitive).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>exoticToPrim</i>).</li>
<li>If <i>exoticToPrim</i> is not <b>undefined</b>, then
<ol class="block">
<li>Let <i>result</i> be <a href="#sec-call">Call</a>(<i>exoticToPrim</i>, <i>input,</i>
«<i>hint</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>result</i>) is not Object, return
<i>result</i>.</li>
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
</li>
<li>If <i>hint</i> is <code>"default"</code>, let <i>hint</i> be <code>"number"</code>.</li>
<li>Return OrdinaryToPrimitive(<i>input,hint</i>).</li>
</ol>
<p>When the abstract operation OrdinaryToPrimitive is called with arguments <var>O</var> and <var>hint</var>, the following
steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>hint</i>)
is String and its value is either <code>"string"</code> or <code>"number"</code>.</li>
<li>If <i>hint</i> is <code>"string"</code>, then
<ol class="block">
<li>Let <i>methodNames</i> be «<code>"toString"</code>, <code>"valueOf"</code>».</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>methodNames</i> be «<code>"valueOf"</code>, <code>"toString"</code>».</li>
</ol>
</li>
<li>For each <i>name</i> in <i>methodNames</i> in <a href="#sec-list-and-record-specification-type">List</a> order, do
<ol class="block">
<li>Let <i>method</i> be <a href="#sec-get-o-p">Get</a>(<i>O</i>, <i>name</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>method</i>).</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>method</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>result</i> be <a href="#sec-call">Call</a>(<i>method</i>, <i>O</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>result</i>) is not Object, return
<i>result</i>.</li>
</ol>
</li>
</ol>
</li>
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> When ToPrimitive is called with no hint, then it generally behaves as if the hint were
Number. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this
specification only Date objects (<a href="#sec-date.prototype-@@toprimitive">see 20.3.4.45</a>) and Symbol objects (<a
href="#sec-symbol.prototype-@@toprimitive">see 19.4.3.4</a>) over-ride the default ToPrimitive behaviour. Date objects
treat no hint as if the hint were String.</p>
</div>
</section>
<section id="sec-toboolean">
<h1><span class="secnum" id="sec-7.1.2"><a href="#sec-toboolean" title="link to this section">7.1.2</a></span> ToBoolean (
argument )</h1>
<p>The abstract operation ToBoolean converts <var>argument</var> to a value of type Boolean according to <a
href="#table-10">Table 10</a>:</p>
<figure>
<figcaption><span id="table-10">Table 10</span> — ToBoolean Conversions</figcaption>
<table class="real-table">
<tr>
<th>Argument Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <var>argument</var> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <var>argument</var>. Otherwise return ToBoolean(<var>argument</var>.[[value]]).</td>
</tr>
<tr>
<td>Undefined</td>
<td>Return <b>false</b>.</td>
</tr>
<tr>
<td>Null</td>
<td>Return <b>false</b>.</td>
</tr>
<tr>
<td>Boolean</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>Number</td>
<td>Return <b>false</b> if <var>argument</var> is <b>+0</b>, <b>−0</b>, or <b>NaN</b>; otherwise return <b>true</b>.</td>
</tr>
<tr>
<td>String</td>
<td>Return <b>false</b> if <var>argument</var> is the empty String (its length is zero); otherwise return <b>true</b>.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Return <b>true</b>.</td>
</tr>
<tr>
<td>Object</td>
<td>Return <b>true</b>.</td>
</tr>
</table>
</figure>
</section>
<section id="sec-tonumber">
<div class="front">
<h1><span class="secnum" id="sec-7.1.3"><a href="#sec-tonumber" title="link to this section">7.1.3</a></span> ToNumber (
argument )</h1>
<p>The abstract operation ToNumber converts <var>argument</var> to a value of type Number according to <a
href="#table-11">Table 11</a>:</p>
<figure>
<figcaption><span id="table-11">Table 11</span> — ToNumber Conversions</figcaption>
<table class="real-table">
<tr>
<th>Argument Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <var>argument</var> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <var>argument</var>. Otherwise return ToNumber(<var>argument</var>.[[value]]).</td>
</tr>
<tr>
<td>Undefined</td>
<td>Return <b>NaN</b>.</td>
</tr>
<tr>
<td>Null</td>
<td>Return <b>+0</b>.</td>
</tr>
<tr>
<td>Boolean</td>
<td>Return <b>1</b> if <var>argument</var> is <b>true</b>. Return <b>+0</b> if <var>argument</var> is <b>false</b>.</td>
</tr>
<tr>
<td>Number</td>
<td>Return <var>argument</var> (no conversion).</td>
</tr>
<tr>
<td>String</td>
<td>See grammar and conversion algorithm below.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Object</td>
<td>
<p>Apply the following steps:</p>
<ol class="proc">
<li>Let <i>primValue</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>argument</i>, hint Number).</li>
<li>Return ToNumber(<i>primValue</i>).</li>
</ol>
</td>
</tr>
</table>
</figure>
</div>
<section id="sec-tonumber-applied-to-the-string-type">
<div class="front">
<h1><span class="secnum" id="sec-7.1.3.1"><a href="#sec-tonumber-applied-to-the-string-type"
title="link to this section">7.1.3.1</a></span> ToNumber Applied to the String Type</h1>
<p><a href="#sec-tonumber">ToNumber</a> applied to Strings applies the following grammar to the input String interpreted
as a sequence of UTF-16 encoded code points (<a href="#sec-ecmascript-language-types-string-type">6.1.4</a>). If the
grammar cannot interpret the String as an expansion of <span class="nt">StringNumericLiteral</span>, then the result of
<a href="#sec-tonumber">ToNumber</a> is <b>NaN</b>.</p>
<div class="note">
<p><span class="nh">NOTE</span> The terminal symbols of this grammar are all composed of Unicode BMP code points so
the result will be <b>NaN</b> if the string contains the UTF-16 encoding of any supplementary code points or any
unpaired surrogate code points</p>
</div>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">StringNumericLiteral</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><span class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub> <span class="nt">StrNumericLiteral</span> <span class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StrWhiteSpace</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">StrWhiteSpaceChar</span> <span class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StrWhiteSpaceChar</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">WhiteSpace</span></div>
<div class="rhs"><span class="nt">LineTerminator</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StrNumericLiteral</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">StrDecimalLiteral</span></div>
<div class="rhs"><span class="nt">BinaryIntegerLiteral</span></div>
<div class="rhs"><span class="nt">OctalIntegerLiteral</span></div>
<div class="rhs"><span class="nt">HexIntegerLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StrDecimalLiteral</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">StrUnsignedDecimalLiteral</span></div>
<div class="rhs"><code class="t">+</code> <span class="nt">StrUnsignedDecimalLiteral</span></div>
<div class="rhs"><code class="t">-</code> <span class="nt">StrUnsignedDecimalLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">Infinity</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span> <code class="t">.</code> <span class="nt">DecimalDigits</span><sub class="g-opt">opt</sub> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><code class="t">.</code> <span class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><span class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigits</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">DecimalDigit</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span> <span class="nt">DecimalDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigit</span> <span class="geq">:::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ExponentPart</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">ExponentIndicator</span> <span class="nt">SignedInteger</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ExponentIndicator</span> <span class="geq">:::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">e</code> <code class="t">E</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SignedInteger</span> <span class="geq">:::</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span></div>
<div class="rhs"><code class="t">+</code> <span class="nt">DecimalDigits</span></div>
<div class="rhs"><code class="t">-</code> <span class="nt">DecimalDigits</span></div>
</div>
<p>All grammar symbols not explicitly defined above have the definitions used in the Lexical Grammar for numeric
literals (<a href="#sec-literals-numeric-literals">11.8.3</a>)</p>
<div class="note">
<p><span class="nh">NOTE</span> Some differences should be noted between the syntax of a <i>StringNumericLiteral</i>
and a <i>NumericLiteral</i> (<a href="#sec-literals-numeric-literals">see 11.8.3</a>):</p>
<ul>
<li>
<p>A <i>StringNumericLiteral</i> may include leading and/or trailing white space and/or line terminators.</p>
</li>
<li>
<p>A <i>StringNumericLiteral</i> that is decimal may have any number of leading <code>0</code> digits.</p>
</li>
<li>
<p>A <i>StringNumericLiteral</i> that is decimal may include a <code>+</code> or <code>-</code> to indicate its
sign.</p>
</li>
<li>
<p>A <i>StringNumericLiteral</i> that is empty or contains only white space is converted to <b>+0</b>.</p>
</li>
<li>
<p><code>Infinity</code> <code>and –Infinity</code> are recognized as a <i>StringNumericLiteral</i> but not
as a <i>NumericLiteral</i>.</p>
</li>
</ul>
</div>
</div>
<section id="sec-runtime-semantics-mv-s">
<h1><span class="secnum" id="sec-7.1.3.1.1"><a href="#sec-runtime-semantics-mv-s"
title="link to this section">7.1.3.1.1</a></span> Runtime Semantics: MV’s</h1>
<p>The conversion of a String to a Number value is similar overall to the determination of the Number value for a
numeric literal (<a href="#sec-literals-numeric-literals">see 11.8.3</a>), but some of the details are different, so the
process for converting a String numeric literal to a value of Number type is given here. This value is determined in two
steps: first, a mathematical value (MV) is derived from the String numeric literal; second, this mathematical value is
rounded as described below. The MV on any grammar symbol, not provided below, is the MV for that symbol defined in <a
href="#sec-static-semantics-mv-s">11.8.3.1</a>.</p>
<ul>
<li>
<p>The MV of <span class="prod"><span class="nt">StringNumericLiteral</span> <span class="geq">:::</span> <span
class="grhsannot">[empty]</span></span> is 0.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StringNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">StrWhiteSpace</span></span> is 0.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StringNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub> <span class="nt">StrNumericLiteral</span> <span
class="nt">StrWhiteSpace</span><sub class="g-opt">opt</sub></span> is the MV of <span
class="nt">StrNumericLiteral</span>, no matter whether white space is present or not.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">StrDecimalLiteral</span></span> is the MV of <span class="nt">StrDecimalLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">BinaryIntegerLiteral</span></span> is the MV of <span class="nt">BinaryIntegerLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">OctalIntegerLiteral</span></span> is the MV of <span class="nt">OctalIntegerLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrNumericLiteral</span> <span class="geq">:::</span> <span
class="nt">HexIntegerLiteral</span></span> is the MV of <span class="nt">HexIntegerLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">StrUnsignedDecimalLiteral</span></span> is the MV of <span
class="nt">StrUnsignedDecimalLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrDecimalLiteral</span> <span class="geq">:::</span> <code
class="t">+</code> <span class="nt">StrUnsignedDecimalLiteral</span></span> is the MV of <span
class="nt">StrUnsignedDecimalLiteral</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrDecimalLiteral</span> <span class="geq">:::</span> <code
class="t">-</code> <span class="nt">StrUnsignedDecimalLiteral</span></span> is the negative of the MV of <span
class="nt">StrUnsignedDecimalLiteral</span>. (Note that if the MV of <span
class="nt">StrUnsignedDecimalLiteral</span> is 0, the negative of this MV is also 0. The rounding rule described
below handles the conversion of this signless mathematical zero to a floating-point <b>+0</b> or <b>−0</b> as
appropriate.)</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">Infinity</span></span> is <span style="font-family: Times New Roman">10<sup>10000</sup></span> (a value
so large that it will round to <b>+∞</b>).</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span> <code class="t">.</code></span> is the MV of <span
class="nt">DecimalDigits</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span> <code class="t">.</code> <span class="nt">DecimalDigits</span></span> is the MV of
the first <span class="nt">DecimalDigits</span> plus (the MV of the second <span class="nt">DecimalDigits</span>
times <span style="font-family: Times New Roman">10<sup>−<i>n</i></sup></span>), where <var>n</var> is the
number of code points in the second <span class="nt">DecimalDigits</span>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span> <code class="t">.</code> <span class="nt">ExponentPart</span></span> is the MV of
<i>DecimalDigits</i> times 10<sup><i>e</i></sup>, where <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span> <code class="t">.</code> <span class="nt">DecimalDigits</span> <span
class="nt">ExponentPart</span></span> is (the MV of the first <i>DecimalDigits</i> plus (the MV of the second
<i>DecimalDigits</i> times 10<sup>−<i>n</i></sup>)) times 10<sup><i>e</i></sup>, where <i>n</i> is the number
of code points in the second <i>DecimalDigits</i> and <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <code
class="t">.</code> <span class="nt">DecimalDigits</span></span> is the MV of <i>DecimalDigits</i> times
10<sup>−<i>n</i></sup>, where <i>n</i> is the number of code points in <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <code
class="t">.</code> <span class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span></span> is the MV of
<i>DecimalDigits</i> times 10<sup><i>e</i>−<i>n</i></sup>, where <i>n</i> is the number of code points in
<i>DecimalDigits</i> and <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span></span> is the MV of <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">StrUnsignedDecimalLiteral</span> <span class="geq">:::</span> <span
class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span></span> is the MV of <i>DecimalDigits</i> times
10<sup><i>e</i></sup>, where <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
</ul>
<p>Once the exact MV for a String numeric literal has been determined, it is then rounded to a value of the Number type.
If the MV is 0, then the rounded value is +0 unless the first non white space code point in the String numeric literal
is ‘<code>-</code>’, in which case the rounded value is −0. Otherwise, the rounded value must be the
Number value for the MV (in the sense defined in <a href="#sec-ecmascript-language-types-number-type">6.1.6</a>), unless
the literal includes a <span class="nt">StrUnsignedDecimalLiteral</span> and the literal has more than 20 significant
digits, in which case the Number value may be either the Number value for the MV of a literal produced by replacing each
significant digit after the 20th with a 0 digit or the Number value for the MV of a literal produced by replacing each
significant digit after the 20th with a 0 digit and then incrementing the literal at the 20th digit position. A digit is
significant if it is not part of an <span class="nt">ExponentPart</span> and</p>
<ul>
<li>it is not <code>0</code>; or</li>
<li>there is a nonzero digit to its left and there is a nonzero digit, not in the <span
class="nt">ExponentPart</span>, to its right.</li>
</ul>
</section>
</section>
</section>
<section id="sec-tointeger">
<h1><span class="secnum" id="sec-7.1.4"><a href="#sec-tointeger" title="link to this section">7.1.4</a></span> ToInteger (
argument )</h1>
<p>The abstract operation ToInteger converts <var>argument</var> to an integral numeric value. This abstract operation
functions as follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, return <b>+0</b>.</li>
<li>If <i>number</i> is <b>+0</b>, <b>−0</b>, <b>+∞,</b> or <b>−∞</b>, return <i>number</i>.</li>
<li>Return the number value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
</ol>
</section>
<section id="sec-toint32">
<h1><span class="secnum" id="sec-7.1.5"><a href="#sec-toint32" title="link to this section">7.1.5</a></span> ToInt32 (
argument )</h1>
<p>The abstract operation ToInt32 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>32</sup></span> integer values in the range <span style="font-family: Times New
Roman">−2<sup>31</sup></span> through <span style="font-family: Times New Roman">2<sup>31</sup>−1</span>,
inclusive. This abstract operation functions as follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+∞</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int32bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>32</sup>.</li>
<li>If <i>int32bit</i> ≥ 2<sup>31</sup>, return <i>int32bit</i> − 2<sup>32</sup>, otherwise return
<i>int32bit</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Given the above definition of ToInt32:</p>
<ul>
<li>
<p>The ToInt32 abstract operation is idempotent: if applied to a result that it produced, the second application
leaves that value unchanged.</p>
</li>
<li>
<p><i>ToInt32(<a href="#sec-touint32">ToUint32</a>(x))</i> is equal to ToInt32(<i>x</i>) for all values of <i>x</i>.
(It is to preserve this latter property that +<b>∞</b> and −<b>∞</b> are mapped to <b>+0</b>.)</p>
</li>
<li>
<p>ToInt32 maps <b>−0</b> to <b>+0</b>.</p>
</li>
</ul>
</div>
</section>
<section id="sec-touint32">
<h1><span class="secnum" id="sec-7.1.6"><a href="#sec-touint32" title="link to this section">7.1.6</a></span> ToUint32 (
argument )</h1>
<p>The abstract operation ToUint32 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>32</sup></span> integer values in the range <span style="font-family: Times New Roman">0</span> through <span
style="font-family: Times New Roman">2<sup>32</sup>−1</span>, inclusive. This abstract operation functions as
follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+∞</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int32bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>32</sup>.</li>
<li>Return <i>int32bit</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Given the above definition of ToUint32:</p>
<ul>
<li>
<p>Step 6 is the only difference between ToUint32 and <a href="#sec-toint32">ToInt32</a>.</p>
</li>
<li>
<p>The ToUint32 abstract operation is idempotent: if applied to a result that it produced, the second application
leaves that value unchanged.</p>
</li>
<li>
<p>ToUint32(<a href="#sec-toint32">ToInt32</a>(<i>x</i>)) is equal to ToUint32(<i>x</i>) for all values of <i>x</i>.
(It is to preserve this latter property that <b>+∞</b> and <b>−∞</b> are mapped to <b>+0</b>.)</p>
</li>
<li>
<p>ToUint32 maps <b>−0</b> to <b>+0</b>.</p>
</li>
</ul>
</div>
</section>
<section id="sec-toint16">
<h1><span class="secnum" id="sec-7.1.7"><a href="#sec-toint16" title="link to this section">7.1.7</a></span> ToInt16 (
argument )</h1>
<p>The abstract operation ToInt16 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>16</sup></span> integer values in the range <span style="font-family: Times New Roman">−32768</span>
through <span style="font-family: Times New Roman">32767</span>, inclusive. This abstract operation functions as
follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+∞</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int16bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>16</sup>.</li>
<li>If <i>int16bit</i> ≥ 2<sup>15</sup>, return <i>int16bit</i> − 2<sup>16</sup>, otherwise return
<i>int16bit</i>.</li>
</ol>
</section>
<section id="sec-touint16">
<h1><span class="secnum" id="sec-7.1.8"><a href="#sec-touint16" title="link to this section">7.1.8</a></span> ToUint16 (
argument )</h1>
<p>The abstract operation ToUint16 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>16</sup></span> integer values in the range <span style="font-family: Times New Roman">0</span> through <span
style="font-family: Times New Roman">2<sup>16</sup>−1</span>, inclusive. This abstract operation functions as
follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+∞</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int16bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>16</sup>.</li>
<li>Return <i>int16bit</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Given the above definition of ToUint16:</p>
<ul>
<li>The substitution of 2<sup>16</sup> for 2<sup>32</sup> in step 5 is the only difference between <a
href="#sec-touint32">ToUint32</a> and ToUint16.</li>
<li>ToUint16 maps <b>−0</b> to <span style="font-family: sans-serif"><b>+0</b></span>.</li>
</ul>
</div>
</section>
<section id="sec-toint8">
<h1><span class="secnum" id="sec-7.1.9"><a href="#sec-toint8" title="link to this section">7.1.9</a></span> ToInt8 (
argument )</h1>
<p>The abstract operation ToInt8 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>8</sup></span> integer values in the range <span style="font-family: Times New Roman">−128</span> through
<span style="font-family: Times New Roman">127</span>, inclusive. This abstract operation functions as follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+∞</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int8bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>8</sup>.</li>
<li>If <i>int8bit</i> ≥ 2<sup>7</sup>, return <i>int8bit</i> − 2<sup>8</sup>, otherwise return
<i>int8bit</i>.</li>
</ol>
</section>
<section id="sec-touint8">
<h1><span class="secnum" id="sec-7.1.10"><a href="#sec-touint8" title="link to this section">7.1.10</a></span> ToUint8 (
argument )</h1>
<p>The abstract operation ToUint8 converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>8</sup></span> integer values in the range <span style="font-family: Times New Roman">0</span> through <span
style="font-family: Times New Roman">255</span>, inclusive. This abstract operation functions as follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, <b>+0</b>, <b>−0</b>, <b>+&ininfin;</b>, or <b>−∞</b>, return
<b>+0</b>.</li>
<li>Let <i>int</i> be the mathematical value that is the same sign as <i>number</i> and whose magnitude is <a
href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>number</i>)).</li>
<li>Let <i>int8bit</i> be <i>int</i> <a href="#sec-algorithm-conventions">modulo</a> 2<sup>8</sup>.</li>
<li>Return <i>int8bit</i>.</li>
</ol>
</section>
<section id="sec-touint8clamp">
<h1><span class="secnum" id="sec-7.1.11"><a href="#sec-touint8clamp" title="link to this section">7.1.11</a></span>
ToUint8Clamp ( argument )</h1>
<p>The abstract operation ToUint8Clamp converts <var>argument</var> to one of <span style="font-family: Times New
Roman">2<sup>8</sup></span> integer values in the range <span style="font-family: Times New Roman">0</span> through <span
style="font-family: Times New Roman">255</span>, inclusive. This abstract operation functions as follows:</p>
<ol class="proc">
<li>Let <i>number</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>number</i>).</li>
<li>If <i>number</i> is <b>NaN</b>, return <b>+0</b>.</li>
<li>If <i>number</i> ≤ 0, return <b>+0</b>.</li>
<li>If <i>number</i> ≥ 255, return 255.</li>
<li>Let <i>f</i> be <a href="#sec-algorithm-conventions">floor</a>(<i>number</i>).</li>
<li>If <i>f</i> <i>+</i> 0.5 < <i>number</i>, return <i>f</i> + 1.</li>
<li>If <i>number</i> < <i>f +</i> 0.5, return <i>f</i>.</li>
<li>If <i>f</i> is odd, return <i>f</i> + 1.</li>
<li>Return <i>f</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Note that unlike the other ECMAScript integer conversion abstract operation, ToUint8Clamp
rounds rather than truncates non-integer values and does not convert +<b>∞</b> to 0. ToUint8Clamp does “round
half to even” tie-breaking. This differs from <code><a href="#sec-math.round">Math.round</a></code> which does
“round half up” tie-breaking.</p>
</div>
</section>
<section id="sec-tostring">
<div class="front">
<h1><span class="secnum" id="sec-7.1.12"><a href="#sec-tostring" title="link to this section">7.1.12</a></span> ToString (
argument )</h1>
<p>The abstract operation ToString converts <var>argument</var> to a value of type String according to <a
href="#table-12">Table 12</a>:</p>
<figure>
<figcaption><span id="table-12">Table 12</span> — ToString Conversions</figcaption>
<table class="real-table">
<tr>
<th>Argument Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <var>argument</var> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <var>argument</var>. Otherwise return ToString(<var>argument</var>.[[value]]).</td>
</tr>
<tr>
<td>Undefined</td>
<td>Return <code>"undefined"</code>.</td>
</tr>
<tr>
<td>Null</td>
<td>Return <code>"null"</code>.</td>
</tr>
<tr>
<td>Boolean</td>
<td>
<p>If <var>argument</var> is <b>true</b>, return <code>"true"</code>.</p>
<p>If <var>argument</var> is <b>false</b>, return <b><code>"false"</code>.</b></p>
</td>
</tr>
<tr>
<td>Number</td>
<td>See <a href="#sec-tostring-applied-to-the-number-type">7.1.12.1</a>.</td>
</tr>
<tr>
<td>String</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Object</td>
<td>
<p>Apply the following steps:</p>
<p>1. Let <i>primValue</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>argument</i>, hint String).</p>
<p>2. Return ToString(<i>primValue</i>).</p>
</td>
</tr>
</table>
</figure>
</div>
<section id="sec-tostring-applied-to-the-number-type">
<h1><span class="secnum" id="sec-7.1.12.1"><a href="#sec-tostring-applied-to-the-number-type"
title="link to this section">7.1.12.1</a></span> ToString Applied to the Number Type</h1>
<p>The abstract operation <a href="#sec-tostring">ToString</a> converts a Number <var>m</var> to String format as
follows:</p>
<ol class="proc">
<li>If <i>m</i> is <b>NaN</b>, return the String <code>"NaN"</code>.</li>
<li>If <i>m</i> is <b>+0</b> or <b>−0</b>, return the String <code>"0"</code>.</li>
<li>If <i>m</i> is less than zero, return the String concatenation of the String <code>"-"</code> and <a
href="#sec-tostring">ToString</a>(−<i>m</i>).</li>
<li>If <i>m</i> is +∞, return the String <code>"Infinity"</code>.</li>
<li>Otherwise, let <i>n</i>, <i>k</i>, and <i>s</i> be integers such that <i>k</i> ≥ 1, 10<sup><i>k</i>−1</sup>
≤ <i>s</i> < 10<sup><i>k</i></sup>, the Number value for <i>s</i> × 10<sup><i>n−k</i></sup> is
<i>m</i>, and <i>k</i> is as small as possible. Note that <i>k</i> is the number of digits in the decimal
representation of <i>s</i>, that <i>s</i> is not divisible by 10, and that the least significant digit of <i>s</i>
is not necessarily uniquely determined by these criteria.</li>
<li>If <i>k</i> ≤ <i>n</i> ≤ 21, return the String consisting of the code units of the <i>k</i> digits of the
decimal representation of <i>s</i> (in order, with no leading zeroes), followed by <i>n−k</i> occurrences of
the code unit 0x0030 (DIGIT ZERO).</li>
<li>If 0 < <i>n</i> ≤ 21, return the String consisting of the code units of the most significant <i>n</i> digits
of the decimal representation of <i>s</i>, followed by the code unit 0x002E (FULL STOP), followed by the code units
of the remaining <i>k−n</i> digits of the decimal representation of <i>s</i>.</li>
<li>If −6 < <i>n</i> ≤ 0, return the String consisting of the code unit 0x0030 (DIGIT ZERO), followed by the
code unit 0x002E (FULL STOP), followed by −<i>n</i> occurrences of the code unit 0x0030 (DIGIT ZERO), followed
by the code units of the <i>k</i> digits of the decimal representation of <i>s</i>.</li>
<li>Otherwise, if <i>k</i> = 1, return the String consisting of the code unit of the single digit of <i>s</i>, followed
by code unit 0x0065 (LATIN SMALL LETTER E), followed by the code unit 0x002B (PLUS SIGN) or the code unit 0x002D
(HYPHEN-MINUS) according to whether <i>n</i>−1 is positive or negative, followed by the code units of the
decimal representation of the integer <a href="#sec-algorithm-conventions">abs</a>(<i>n</i>−1) (with no
leading zeroes).</li>
<li>Return the String consisting of the code units of the most significant digit of the decimal representation of
<i>s</i>, followed by code unit 0x002E (FULL STOP), followed by the code units of the remaining <i>k</i>−1
digits of the decimal representation of <i>s</i>, followed by code unit 0x0065 (LATIN SMALL LETTER E), followed by
code unit 0x002B (PLUS SIGN) or the code unit 0x002D (HYPHEN-MINUS) according to whether <i>n</i>−1 is
positive or negative, followed by the code units of the decimal representation of the integer <a
href="#sec-algorithm-conventions">abs</a>(<i>n</i>−1) (with no leading zeroes).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> The following observations may be useful as guidelines for implementations, but are
not part of the normative requirements of this Standard:</p>
<ul>
<li>
<p>If x is any Number value other than <b>−0</b>, then <a href="#sec-tonumber">ToNumber</a>(<a
href="#sec-tostring">ToString</a>(x)) is exactly the same Number value as x.</p>
</li>
<li>
<p>The least significant digit of s is not always uniquely determined by the requirements listed in step 5.</p>
</li>
</ul>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> For implementations that provide more accurate conversions than required by the rules
above, it is recommended that the following alternative version of step 5 be used as a guideline:</p>
<p>Otherwise, let <i>n</i>, <i>k</i>, and <i>s</i> be integers such that <i>k</i> ≥ 1, 10<sup><i>k</i>−1</sup>
≤ <i>s</i> < 10<sup><i>k</i></sup>, the Number value for <i>s</i> × 10<sup><i>n</i>−<i>k</i></sup> is
<i>m</i>, and <i>k</i> is as small as possible. If there are multiple possibilities for <i>s</i>, choose the value of
<i>s</i> for which <i>s</i> × 10<sup><i>n</i>−<i>k</i></sup> is closest in value to <i>m</i>. If there are
two such possible values of <i>s</i>, choose the one that is even. Note that <i>k</i> is the number of digits in the
decimal representation of <i>s</i> and that <i>s</i> is not divisible by 10.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 3</span> Implementers of ECMAScript may find useful the paper and code written by David M. Gay
for binary-to-decimal conversion of floating-point numbers:</p>
<p>Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10.
AT&T Bell Laboratories (Murray Hill, New Jersey). November 30, 1990. Available as<br><span style="font-family:
sans-serif"><a
href="http://cm.bell-labs.com/cm/cs/doc/90/4-10.ps.gz">http://cm.bell-labs.com/cm/cs/doc/90/4-10.ps.gz</a></span>.
Associated code available as<br><span style="font-family: sans-serif"><a
href="http://netlib.sandia.gov/fp/dtoa.c">http://netlib.sandia.gov/fp/dtoa.c</a></span> and as<br><span
style="font-family: sans-serif"><a
href="http://netlib.sandia.gov/fp/g_fmt.c">http://netlib.sandia.gov/fp/g_fmt.c</a></span> and may also be found at the
various <code>netlib</code> mirror sites.</p>
</div>
</section>
</section>
<section id="sec-toobject">
<h1><span class="secnum" id="sec-7.1.13"><a href="#sec-toobject" title="link to this section">7.1.13</a></span> ToObject (
argument )</h1>
<p>The abstract operation ToObject converts <var>argument</var> to a value of type Object according to <a
href="#table-13">Table 13</a>:</p>
<figure>
<figcaption><span id="table-13">Table 13</span> — ToObject Conversions</figcaption>
<table class="real-table">
<tr>
<th>Argument Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <i>argument</i> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <i>argument</i>. Otherwise return ToObject(<i>argument</i>.[[value]]).</td>
</tr>
<tr>
<td>Undefined</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Null</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Boolean</td>
<td>Return a new Boolean object whose [[BooleanData]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is set to the value of <i>argument</i>. See <a href="#sec-boolean-objects">19.3</a> for a description of Boolean objects.</td>
</tr>
<tr>
<td>Number</td>
<td>Return a new Number object whose [[NumberData]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is set to the value of <i>argument</i>. See <a href="#sec-number-objects">20.1</a> for a description of Number objects.</td>
</tr>
<tr>
<td>String</td>
<td>Return a new String object whose [[StringData]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is set to the value of <i>argument</i>. See <a href="#sec-string-objects">21.1</a> for a description of String objects.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Return a new Symbol object whose [[SymbolData]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is set to the value of <i>argument</i>. See <a href="#sec-symbol-objects">19.4</a> for a description of Symbol objects.</td>
</tr>
<tr>
<td>Object</td>
<td>Return <i>argument</i>.</td>
</tr>
</table>
</figure>
</section>
<section id="sec-topropertykey">
<h1><span class="secnum" id="sec-7.1.14"><a href="#sec-topropertykey" title="link to this section">7.1.14</a></span>
ToPropertyKey ( argument )</h1>
<p>The abstract operation ToPropertyKey converts <var>argument</var> to a value that can be used as a <a
href="#sec-object-type">property key</a> by performing the following steps:</p>
<ol class="proc">
<li>Let <i>key</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>argument</i>, hint String).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>key</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>key</i>) is Symbol, then
<ol class="block">
<li>Return <i>key</i>.</li>
</ol>
</li>
<li>Return <a href="#sec-tostring">ToString</a>(<i>key</i>).</li>
</ol>
</section>
<section id="sec-tolength">
<h1><span class="secnum" id="sec-7.1.15"><a href="#sec-tolength" title="link to this section">7.1.15</a></span> ToLength (
argument )</h1>
<p>The abstract operation ToLength converts <var>argument</var> to an integer suitable for use as the length of an
array-like object. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argument</i>).</li>
<li>Let <i>len</i> be <a href="#sec-tointeger">ToInteger</a>(<i>argument</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>len</i>).</li>
<li>If <i>len</i> ≤ +0, return +0.</li>
<li>If <i>len</i> is <b>+∞</b>, return 2<sup>53</sup>-1.</li>
<li>Return min(<i>len</i>, 2<sup>53</sup>-1).</li>
</ol>
</section>
<section id="sec-canonicalnumericindexstring">
<h1><span class="secnum" id="sec-7.1.16"><a href="#sec-canonicalnumericindexstring"
title="link to this section">7.1.16</a></span> CanonicalNumericIndexString ( argument )</h1>
<p>The abstract operation CanonicalNumericIndexString returns <var>argument</var> converted to a numeric value if it is a
String representation of a Number that would be produced by <a href="#sec-tostring">ToString</a>, or the string
<code>"-0"</code>. Otherwise, it returns <span class="value">undefined.</span> This abstract operation functions as
follows:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is String.</li>
<li>If <i>argument</i> is <code>"-0"</code>, return −0.</li>
<li>Let <i>n</i> be <a href="#sec-tonumber">ToNumber</a>(<i>argument</i>).</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<a href="#sec-tostring">ToString</a>(<i>n</i>), <i>argument</i>) is
<b>false</b>, return <b>undefined</b>.</li>
<li>Return <i>n</i>.</li>
</ol>
<p>A <i>canonical numeric string</i> is any String value for which the CanonicalNumericIndexString abstract operation does
not return <span class="value">undefined</span>.</p>
</section>
</section>
<section id="sec-testing-and-comparison-operations">
<div class="front">
<h1><span class="secnum" id="sec-7.2"><a href="#sec-testing-and-comparison-operations"
title="link to this section">7.2</a></span> Testing and Comparison Operations</h1>
</div>
<section id="sec-requireobjectcoercible">
<h1><span class="secnum" id="sec-7.2.1"><a href="#sec-requireobjectcoercible" title="link to this section">7.2.1</a></span>
RequireObjectCoercible ( argument )</h1>
<p>The abstract operation RequireObjectCoercible throws an error if <var>argument</var> is a value that cannot be converted
to an Object using <a href="#sec-toobject">ToObject</a>. It is defined by <a href="#table-14">Table 14</a>:</p>
<figure>
<figcaption><span id="table-14">Table 14</span> — RequireObjectCoercible Results</figcaption>
<table class="real-table">
<tr>
<th>Argument Type</th>
<th>Result</th>
</tr>
<tr>
<td><a href="#sec-completion-record-specification-type">Completion Record</a></td>
<td>If <var>argument</var> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, return <var>argument</var>. Otherwise return RequireObjectCoercible(<var>argument</var>.[[value]]).</td>
</tr>
<tr>
<td>Undefined</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Null</td>
<td>Throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>Boolean</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>Number</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>String</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>Symbol</td>
<td>Return <var>argument</var>.</td>
</tr>
<tr>
<td>Object</td>
<td>Return <var>argument</var>.</td>
</tr>
</table>
</figure>
</section>
<section id="sec-isarray">
<h1><span class="secnum" id="sec-7.2.2"><a href="#sec-isarray" title="link to this section">7.2.2</a></span> IsArray (
argument )</h1>
<p>The abstract operation IsArray takes one argument <var>argument</var>, and performs the following steps:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is not Object, return <b>false</b>.</li>
<li>If <i>argument</i> is an <a href="#sec-array-exotic-objects">Array exotic object</a>, return <b>true</b>.</li>
<li>If <i>argument</i> is a Proxy exotic object, then
<ol class="block">
<li>If the value of the [[ProxyHandler]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>
of <i>argument</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>argument</i>.</li>
<li>Return IsArray(<i>target</i>).</li>
</ol>
</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-iscallable">
<h1><span class="secnum" id="sec-7.2.3"><a href="#sec-iscallable" title="link to this section">7.2.3</a></span> IsCallable (
argument )</h1>
<p>The abstract operation IsCallable determines if <var>argument</var>, which must be an <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> or a <a
href="#sec-completion-record-specification-type">Completion Record</a>, is a callable function with a [[Call]] internal
method.</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argument</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is not Object, return <b>false</b>.</li>
<li>If <i>argument</i> has a [[Call]] internal method, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-isconstructor">
<h1><span class="secnum" id="sec-7.2.4"><a href="#sec-isconstructor" title="link to this section">7.2.4</a></span>
IsConstructor ( argument )</h1>
<p>The abstract operation IsConstructor determines if <var>argument</var>, which must be an <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> or a <a
href="#sec-completion-record-specification-type">Completion Record</a>, is a function object with a [[Construct]] internal
method.</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argument</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is not Object, return <b>false</b>.</li>
<li>If <i>argument</i> has a [[Construct]] internal method, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-isextensible-o">
<h1><span class="secnum" id="sec-7.2.5"><a href="#sec-isextensible-o" title="link to this section">7.2.5</a></span>
IsExtensible (O)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">IsExtensible</span> is used to determine whether
additional properties can be added to the object that is <var>O</var>. A Boolean value is returned. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li>Return <i>O</i>.[[IsExtensible]]().</li>
</ol>
</section>
<section id="sec-isinteger">
<h1><span class="secnum" id="sec-7.2.6"><a href="#sec-isinteger" title="link to this section">7.2.6</a></span> IsInteger (
argument )</h1>
<p>The abstract operation IsInteger determines if <var>argument</var> is a finite integer numeric value.</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argument</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is not Number, return <b>false</b>.</li>
<li>If <i>argument</i> is <b>NaN</b>, <b>+∞</b>, or <b>−∞</b>, return <b>false</b>.</li>
<li>If <a href="#sec-algorithm-conventions">floor</a>(<a href="#sec-algorithm-conventions">abs</a>(<i>argument</i>)) ≠
<a href="#sec-algorithm-conventions">abs</a>(<i>argument</i>), return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-ispropertykey">
<h1><span class="secnum" id="sec-7.2.7"><a href="#sec-ispropertykey" title="link to this section">7.2.7</a></span>
IsPropertyKey ( argument )</h1>
<p>The abstract operation IsPropertyKey determines if <var>argument</var>, which must be an <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> or a <a
href="#sec-completion-record-specification-type">Completion Record</a>, is a value that may be used as a <a
href="#sec-object-type">property key</a>.</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argument</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is String, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is Symbol, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-isregexp">
<h1><span class="secnum" id="sec-7.2.8"><a href="#sec-isregexp" title="link to this section">7.2.8</a></span> IsRegExp (
argument )</h1>
<p>The abstract operation IsRegExp with argument <var>argument</var> performs the following steps:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>argument</i>) is not Object, return <b>false</b>.</li>
<li>Let <i>isRegExp</i> be <a href="#sec-get-o-p">Get</a>(<i>argument</i>, @@match).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>isRegExp</i>).</li>
<li>If <i>isRegExp</i> is not <b>undefined</b>, return <a href="#sec-toboolean">ToBoolean</a>(<i>isRegExp</i>).</li>
<li>If <i>argument</i> has a [[RegExpMatcher]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-samevalue">
<h1><span class="secnum" id="sec-7.2.9"><a href="#sec-samevalue" title="link to this section">7.2.9</a></span> SameValue(x,
y)</h1>
<p>The internal comparison abstract operation SameValue(<var>x</var>, <var>y</var>), where <var>x</var> and <var>y</var> are
<a href="#sec-ecmascript-language-types">ECMAScript language values</a>, produces <b>true</b> or <b>false</b>. Such a
comparison is performed as follows:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>x</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is different from <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>), return <b>false</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Undefined, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Null, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Number, then
<ol class="block">
<li>If <i>x</i> is NaN and <i>y</i> is NaN, return <b>true</b>.</li>
<li>If <i>x</i> is +0 and <i>y</i> is -0, return <b>false</b>.</li>
<li>If <i>x</i> is -0 and <i>y</i> is +0, return <b>false</b>.</li>
<li>If <i>x</i> is the same Number value as <i>y</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is String, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are exactly the same sequence of code units (same length and same code units at
corresponding indices) return <b>true</b>; otherwise, return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Boolean, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are both <b>true</b> or both <b>false</b>, return <b>true</b>; otherwise, return
<b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Symbol, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are both the same Symbol value, return <b>true</b>; otherwise, return <b>false</b>.</li>
</ol>
</li>
<li>Return <b>true</b> if <i>x</i> and <i>y</i> are the same Object value. Otherwise, return <b>false</b>.</li>
</ol>
</section>
<section id="sec-samevaluezero">
<h1><span class="secnum" id="sec-7.2.10"><a href="#sec-samevaluezero" title="link to this section">7.2.10</a></span>
SameValueZero(x, y)</h1>
<p>The internal comparison abstract operation SameValueZero(<var>x</var>, <var>y</var>), where <var>x</var> and <var>y</var>
are <a href="#sec-ecmascript-language-types">ECMAScript language values</a>, produces <b>true</b> or <b>false</b>. Such a
comparison is performed as follows:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>x</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is different from <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>), return <b>false</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Undefined, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Null, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Number, then
<ol class="block">
<li>If <i>x</i> is NaN and <i>y</i> is NaN, return <b>true</b>.</li>
<li>If <i>x</i> is +0 and <i>y</i> is -0, return <b>true</b>.</li>
<li>If <i>x</i> is -0 and <i>y</i> is +0, return <b>true</b>.</li>
<li>If <i>x</i> is the same Number value as <i>y</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is String, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are exactly the same sequence of code units (same length and same code units at
corresponding indices) return <b>true</b>; otherwise, return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Boolean, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are both <b>true</b> or both <b>false</b>, return <b>true</b>; otherwise, return
<b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Symbol, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are both the same Symbol value, return <b>true</b>; otherwise, return <b>false</b>.</li>
</ol>
</li>
<li>Return <b>true</b> if <i>x</i> and <i>y</i> are the same Object value. Otherwise, return <b>false</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> SameValueZero differs from SameValue only in its treatment of +0 and -0.</p>
</div>
</section>
<section id="sec-abstract-relational-comparison">
<h1><span class="secnum" id="sec-7.2.11"><a href="#sec-abstract-relational-comparison"
title="link to this section">7.2.11</a></span> Abstract Relational Comparison</h1>
<p>The comparison <var>x</var> < <var>y</var>, where <var>x</var> and <var>y</var> are values, produces <b>true</b>,
<b>false</b>, or <b>undefined</b> (which indicates that at least one operand is <b>NaN</b>). In addition to <var>x</var> and
<var>y</var> the algorithm takes a Boolean flag named <span class="nt">LeftFirst</span> as a parameter. The flag is used to
control the order in which operations with potentially visible side-effects are performed upon <var>x</var> and
<var>y</var>. It is necessary because ECMAScript specifies left to right evaluation of expressions. The default value of
<span class="nt">LeftFirst</span> is <b>true</b> and indicates that the <var>x</var> parameter corresponds to an expression
that occurs to the left of the <var>y</var> parameter’s corresponding expression. If <span class="nt">LeftFirst</span>
is <b>false</b>, the reverse is the case and operations must be performed upon <var>y</var> before <var>x</var>. Such a
comparison is performed as follows:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>x</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>y</i>).</li>
<li>If the <i>LeftFirst</i> flag is <b>true</b>, then
<ol class="block">
<li>Let <i>px</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>x</i>, hint Number).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>px</i>).</li>
<li>Let <i>py</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>y</i>, hint Number).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>py</i>).</li>
</ol>
</li>
<li>Else the order of evaluation needs to be reversed to preserve left to right evaluation
<ol class="block">
<li>Let <i>py</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>y</i>, hint Number).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>py</i>).</li>
<li>Let <i>px</i> be <a href="#sec-toprimitive">ToPrimitive</a>(<i>x</i>, hint Number).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>px</i>).</li>
</ol>
</li>
<li>If both <i>px</i> and <i>py</i> are Strings, then
<ol class="block">
<li>If <i>py</i> is a prefix of <i>px</i>, return <b>false</b>. (A String value <i>p</i> is a prefix of String value
<i>q</i> if <i>q</i> can be the result of concatenating <i>p</i> and some other String <i>r</i>. Note that any
String is a prefix of itself, because <i>r</i> may be the empty String.)</li>
<li>If <i>px</i> is a prefix of <i>py</i>, return <b>true</b>.</li>
<li>Let <i>k</i> be the smallest nonnegative integer such that the code unit at index <i>k</i> within <i>px</i> is
different from the code unit at index <i>k</i> within <i>py</i>. (There must be such a <i>k</i>, for neither
String is a prefix of the other.)</li>
<li>Let <i>m</i> be the integer that is the code unit value at index <i>k</i> within <i>px</i>.</li>
<li>Let <i>n</i> be the integer that is the code unit value at index <i>k</i> within <i>py</i>.</li>
<li>If <i>m</i> < <i>n</i>, return <b>true</b>. Otherwise, return <b>false</b>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>nx</i> be <a href="#sec-tonumber">ToNumber</a>(<i>px</i>). Because <i>px</i> and <i>py</i> are primitive
values evaluation order is not important.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>nx</i>).</li>
<li>Let <i>ny</i> be <a href="#sec-tonumber">ToNumber</a>(<i>py</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>ny</i>).</li>
<li>If <i>nx</i> is <b>NaN</b>, return <b>undefined</b>.</li>
<li>If <i>ny</i> is <b>NaN</b>, return <b>undefined</b>.</li>
<li>If <i>nx</i> and <i>ny</i> are the same Number value, return <b>false</b>.</li>
<li>If <i>nx</i> is <b>+0</b> and <i>ny</i> is <b>−0</b>, return <b>false</b>.</li>
<li>If <i>nx</i> is <b>−0</b> and <i>ny</i> is <b>+0</b>, return <b>false</b>.</li>
<li>If <i>nx</i> is <b>+∞</b>, return <b>false</b>.</li>
<li>If <i>ny</i> is <b>+∞</b>, return <b>true</b>.</li>
<li>If <i>ny</i> is <b>−∞</b>, return <b>false</b>.</li>
<li>If <i>nx</i> is <b>−∞</b>, return <b>true</b>.</li>
<li>If the mathematical value of <i>nx</i> is less than the mathematical value of <i>ny</i> —note that these
mathematical values are both finite and not both zero—return <b>true</b>. Otherwise, return
<b>false</b>.</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> Step 5 differs from step 11 in the algorithm for the addition operator <code>+</code>
(<a href="#sec-addition-operator-plus">12.7.3</a>) in using “and” instead of “or”.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> The comparison of Strings uses a simple lexicographic ordering on sequences of code unit
values. There is no attempt to use the more complex, semantically oriented definitions of character or string equality and
collating order defined in the Unicode specification. Therefore String values that are canonically equal according to the
Unicode standard could test as unequal. In effect this algorithm assumes that both Strings are already in normalized form.
Also, note that for strings containing supplementary characters, lexicographic ordering on sequences of UTF-16 code unit
values differs from that on sequences of code point values.</p>
</div>
</section>
<section id="sec-abstract-equality-comparison">
<h1><span class="secnum" id="sec-7.2.12"><a href="#sec-abstract-equality-comparison"
title="link to this section">7.2.12</a></span> Abstract Equality Comparison</h1>
<p>The comparison <var>x</var> == <var>y</var>, where <var>x</var> and <var>y</var> are values, produces <b>true</b> or
<b>false</b>. Such a comparison is performed as follows:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>x</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is the same as <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>), then
<ol class="block">
<li>Return the result of performing Strict Equality Comparison <i>x</i> === <i>y</i>.</li>
</ol>
</li>
<li>If <i>x</i> is <b>null</b> and <i>y</i> is <b>undefined</b>, return <b>true</b>.</li>
<li>If <i>x</i> is <b>undefined</b> and <i>y</i> is <b>null</b>, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Number and <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>) is String,<br>return the result of the comparison
<i>x</i> == <a href="#sec-tonumber">ToNumber</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is String and <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>) is Number,<br>return the result of the comparison <a
href="#sec-tonumber">ToNumber</a>(<i>x</i>) == <i>y</i>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Boolean, return the result of the comparison
<a href="#sec-tonumber">ToNumber</a>(<i>x</i>) == <i>y</i>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>) is Boolean, return the result of the comparison
<i>x</i> == <a href="#sec-tonumber">ToNumber</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is either String, Number, or Symbol and <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>) is Object, then<br>return the result of the comparison
<i>x</i> == <a href="#sec-toprimitive">ToPrimitive</a>(<i>y</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Object and <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>) is either String, Number, or Symbol, then<br>return
the result of the comparison <a href="#sec-toprimitive">ToPrimitive</a>(<i>x</i>) == <i>y</i>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-strict-equality-comparison">
<h1><span class="secnum" id="sec-7.2.13"><a href="#sec-strict-equality-comparison"
title="link to this section">7.2.13</a></span> Strict Equality Comparison</h1>
<p>The comparison <var>x</var> === <var>y</var>, where <var>x</var> and <var>y</var> are values, produces <b>true</b> or
<b>false</b>. Such a comparison is performed as follows:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is different from <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>y</i>), return <b>false</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Undefined, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Null, return <b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Number, then
<ol class="block">
<li>If <i>x</i> is <b>NaN</b>, return <b>false</b>.</li>
<li>If <i>y</i> is <b>NaN</b>, return <b>false</b>.</li>
<li>If <i>x</i> is the same Number value as <i>y</i>, return <b>true</b>.</li>
<li>If <i>x</i> is <b>+0</b> and <i>y</i> is <b>−0</b>, return <b>true</b>.</li>
<li>If <i>x</i> is <b>−0</b> and <i>y</i> is <b>+0</b>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is String, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are exactly the same sequence of code units (same length and same code units at
corresponding indices), return <b>true</b>.</li>
<li>Else, return <b>false</b>.</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>x</i>) is Boolean, then
<ol class="block">
<li>If <i>x</i> and <i>y</i> are both <b>true</b> or both <b>false</b>, return <b>true</b>.</li>
<li>Else, return <b>false</b>.</li>
</ol>
</li>
<li>If <i>x</i> and <i>y</i> are the same Symbol value, return <b>true</b>.</li>
<li>If <i>x</i> and <i>y</i> are the same Object value, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> This algorithm differs from <a href="#sec-samevalue">the SameValue Algorithm</a> (<a
href="#sec-samevalue">7.2.9</a>) in its treatment of signed zeroes and NaNs.</p>
</div>
</section>
</section>
<section id="sec-operations-on-objects">
<div class="front">
<h1><span class="secnum" id="sec-7.3"><a href="#sec-operations-on-objects" title="link to this section">7.3</a></span>
Operations on Objects</h1>
</div>
<section id="sec-get-o-p">
<h1><span class="secnum" id="sec-7.3.1"><a href="#sec-get-o-p" title="link to this section">7.3.1</a></span> Get (O, P)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">Get</span> is used to retrieve the value of a specific
property of an object. The operation is called with arguments <var>O</var> and <var>P</var> where <var>O</var> is the
object and <var>P</var> is the <a href="#sec-object-type">property key</a>. This abstract operation performs the following
steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Return <i>O</i>.[[Get]](<i>P</i>, <i>O</i>).</li>
</ol>
</section>
<section id="sec-getv">
<h1><span class="secnum" id="sec-7.3.2"><a href="#sec-getv" title="link to this section">7.3.2</a></span> GetV (V, P)</h1>
<p>The abstract operation GetV is used to retrieve the value of a specific property of an <a
href="#sec-ecmascript-language-types">ECMAScript language value</a>. If the value is not an object, the property lookup is
performed using a wrapper object appropriate for the type of the value. The operation is called with arguments <var>V</var>
and <var>P</var> where <var>V</var> is the value and <var>P</var> is the <a href="#sec-object-type">property key</a>. This
abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>O</i> be <a href="#sec-toobject">ToObject</a>(<i>V</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>O</i>).</li>
<li>Return <i>O</i>.[[Get]](<i>P</i>, <i>V</i>).</li>
</ol>
</section>
<section id="sec-set-o-p-v-throw">
<h1><span class="secnum" id="sec-7.3.3"><a href="#sec-set-o-p-v-throw" title="link to this section">7.3.3</a></span> Set (O,
P, V, Throw)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">Set</span> is used to set the value of a specific
property of an object. The operation is called with arguments <var>O</var>, <var>P</var>, <var>V</var>, and <span
class="nt">Throw</span> where <var>O</var> is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>,
<var>V</var> is the new value for the property and <span class="nt">Throw</span> is a Boolean flag. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>Throw</i>) is Boolean.</li>
<li>Let <i>success</i> be <i>O</i>.[[Set]](<i>P</i>, <i>V</i>, <i>O</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>success</i>).</li>
<li>If <i>success</i> is <b>false</b> and <i>Throw</i> is <b>true</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>success</i>.</li>
</ol>
</section>
<section id="sec-createdataproperty">
<h1><span class="secnum" id="sec-7.3.4"><a href="#sec-createdataproperty" title="link to this section">7.3.4</a></span>
CreateDataProperty (O, P, V)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateDataProperty</span> is used to create a new own
property of an object. The operation is called with arguments <var>O</var>, <var>P</var>, and <var>V</var> where
<var>O</var> is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>, and <var>V</var> is the value
for the property. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>newDesc</i> be the PropertyDescriptor{[[Value]]: <i>V</i>, [[Writable]]: <b>true</b>, [[Enumerable]]:
<b>true</b>, [[Configurable]]: <b>true</b>}.</li>
<li>Return <i>O</i>.[[DefineOwnProperty]](<i>P</i>, <i>newDesc</i>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> This abstract operation creates a property whose attributes are set to the same defaults
used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist.
If it does exist and is not configurable or if <i>O</i> is not extensible, [[DefineOwnProperty]] will return
<b>false</b>.</p>
</div>
</section>
<section id="sec-createmethodproperty">
<h1><span class="secnum" id="sec-7.3.5"><a href="#sec-createmethodproperty" title="link to this section">7.3.5</a></span>
CreateMethodProperty (O, P, V)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateMethodProperty</span> is used to create a new own
property of an object. The operation is called with arguments <var>O</var>, <var>P</var>, and <var>V</var> where
<var>O</var> is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>, and <var>V</var> is the value
for the property. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>newDesc</i> be the PropertyDescriptor{[[Value]]: <i>V</i>, [[Writable]]: <b>true</b>, [[Enumerable]]:
<b>false</b>, [[Configurable]]: <b>true</b>}.</li>
<li>Return <i>O</i>.[[DefineOwnProperty]](<i>P</i>, <i>newDesc</i>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> This abstract operation creates a property whose attributes are set to the same defaults
used for built-in methods and methods defined using class declaration syntax. Normally, the property will not already
exist. If it does exist and is not configurable or if <i>O</i> is not extensible, [[DefineOwnProperty]] will return
<b>false</b>.</p>
</div>
</section>
<section id="sec-createdatapropertyorthrow">
<h1><span class="secnum" id="sec-7.3.6"><a href="#sec-createdatapropertyorthrow"
title="link to this section">7.3.6</a></span> CreateDataPropertyOrThrow (O, P, V)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateDataPropertyOrThrow</span> is used to create a
new own property of an object. It throws a <span class="value">TypeError</span> exception if the requested property update
cannot be performed. The operation is called with arguments <var>O</var>, <var>P</var>, and <var>V</var> where <var>O</var>
is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>, and <var>V</var> is the value for the
property. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>success</i> be <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>O</i>, <i>P</i>, <i>V</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>success</i>).</li>
<li>If <i>success</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>success</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> This abstract operation creates a property whose attributes are set to the same defaults
used for properties created by the ECMAScript language assignment operator. Normally, the property will not already exist.
If it does exist and is not configurable or if <i>O</i> is not extensible, [[DefineOwnProperty]] will return <b>false</b>
<span style="font-family: sans-serif">causing this operation to throw a</span> <b>TypeError</b> <span style="font-family:
sans-serif">exception</span>.</p>
</div>
</section>
<section id="sec-definepropertyorthrow">
<h1><span class="secnum" id="sec-7.3.7"><a href="#sec-definepropertyorthrow" title="link to this section">7.3.7</a></span>
DefinePropertyOrThrow (O, P, desc)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">DefinePropertyOrThrow</span> is used to call the
[[DefineOwnProperty]] internal method of an object in a manner that will throw a <b>TypeError</b> exception if the requested
property update cannot be performed. The operation is called with arguments <var>O</var>, <var>P</var>, and <var>desc</var>
where <var>O</var> is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>, and <var>desc</var> is
the <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> for the property. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>success</i> be <i>O</i>.[[DefineOwnProperty]](<i>P</i>, <i>desc</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>success</i>).</li>
<li>If <i>success</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>success</i>.</li>
</ol>
</section>
<section id="sec-deletepropertyorthrow">
<h1><span class="secnum" id="sec-7.3.8"><a href="#sec-deletepropertyorthrow" title="link to this section">7.3.8</a></span>
DeletePropertyOrThrow (O, P)</h1>
<p>The abstract operation DeletePropertyOrThrow is used to remove a specific own property of an object. It throws an
exception if the property is not configurable. The operation is called with arguments <var>O</var> and <var>P</var> where
<var>O</var> is the object and <var>P</var> is the <a href="#sec-object-type">property key</a>. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>success</i> be <i>O</i>.[[Delete]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>success</i>).</li>
<li>If <i>success</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>success</i>.</li>
</ol>
</section>
<section id="sec-getmethod">
<h1><span class="secnum" id="sec-7.3.9"><a href="#sec-getmethod" title="link to this section">7.3.9</a></span> GetMethod (O,
P)</h1>
<p>The abstract operation GetMethod is used to get the value of a specific property of an object when the value of the
property is expected to be a function. The operation is called with arguments <var>O</var> and <var>P</var> where
<var>O</var> is the object, <var>P</var> is the <a href="#sec-object-type">property key</a>. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>func</i> be <a href="#sec-getv">GetV</a>(<i>O</i>, <i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>func</i>).</li>
<li>If <i>func</i> is either <b>undefined</b> or <b>null</b>, return <b>undefined</b>.</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>func</i>) is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>func</i>.</li>
</ol>
</section>
<section id="sec-hasproperty">
<h1><span class="secnum" id="sec-7.3.10"><a href="#sec-hasproperty" title="link to this section">7.3.10</a></span>
HasProperty (O, P)</h1>
<p>The abstract operation HasProperty is used to determine whether an object has a property with the specified <a
href="#sec-object-type">property key</a>. The property may be either an own or inherited. A Boolean value is returned. The
operation is called with arguments <var>O</var> and <var>P</var> where <var>O</var> is the object and <var>P</var> is the
<a href="#sec-object-type">property key</a>. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Return <i>O</i>.[[HasProperty]](<i>P</i>).</li>
</ol>
</section>
<section id="sec-hasownproperty">
<h1><span class="secnum" id="sec-7.3.11"><a href="#sec-hasownproperty" title="link to this section">7.3.11</a></span>
HasOwnProperty (O, P)</h1>
<p>The abstract operation HasOwnProperty is used to determine whether an object has an own property with the specified <a
href="#sec-object-type">property key</a>. A Boolean value is returned. The operation is called with arguments <var>O</var>
and <var>P</var> where <var>O</var> is the object and <var>P</var> is the <a href="#sec-object-type">property key</a>. This
abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>desc</i> be <i>O</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>desc</i>).</li>
<li>If <i>desc</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-call">
<h1><span class="secnum" id="sec-7.3.12"><a href="#sec-call" title="link to this section">7.3.12</a></span> Call(F, V,
[argumentsList])</h1>
<p>The abstract operation Call is used to call the [[Call]] internal method of a function object. The operation is called
with arguments <var>F</var>, <var>V</var> , and optionally <var>argumentsList</var> where <var>F</var> is the function
object, <var>V</var> is an <a href="#sec-ecmascript-language-types">ECMAScript language value</a> that is the <b>this</b>
value of the [[Call]], and <var>argumentsList</var> is the value passed to the corresponding argument of the internal
method. If <var>argumentsList</var> is not present, an empty <a href="#sec-list-and-record-specification-type">List</a> is
used as its value. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>F</i>).</li>
<li>If <i>argumentsList</i> was not passed, let <i>argumentsList</i> be a new empty <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>F</i>) is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>F</i>.[[Call]](<i>V</i>, <i>argumentsList</i>).</li>
</ol>
</section>
<section id="sec-invoke">
<h1><span class="secnum" id="sec-7.3.13"><a href="#sec-invoke" title="link to this section">7.3.13</a></span> Invoke(O,P,
[argumentsList])</h1>
<p>The abstract operation <span style="font-family: Times New Roman">Invoke</span> is used to call a method property of an
object. The operation is called with arguments <var>O</var>, <var>P</var> , and optionally <var>argumentsList</var> where
<var>O</var> serves as both the lookup point for the property and the <b>this</b> value of the call, <var>P</var> is the <a
href="#sec-object-type">property key</a>, and <var>argumentsList</var> is the list of arguments values passed to the method.
If <var>argumentsList</var> is not present, an empty <a href="#sec-list-and-record-specification-type">List</a> is used as
its value. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>P</i> is a valid <a href="#sec-object-type">property key</a>.</li>
<li>If <i>argumentsList</i> was not passed, let <i>argumentsList</i> be a new empty <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>func</i> be <a href="#sec-getv">GetV</a>(<i>O</i>, <i>P</i>).</li>
<li>Return <a href="#sec-call">Call</a>(<i>func</i>, <i>O</i>, <i>argumentsList</i>).</li>
</ol>
</section>
<section id="sec-construct">
<h1><span class="secnum" id="sec-7.3.14"><a href="#sec-construct" title="link to this section">7.3.14</a></span> Construct
(F, [argumentsList], [newTarget])</h1>
<p>The abstract operation Construct is used to call the [[Construct]] internal method of a function object. The operation is
called with arguments <var>F</var>, and optionally <span style="font-family: Times New Roman"><i>argumentsList</i>, and
<i>newTarget</i></span> where <var>F</var> is the function object. <var>argumentsList</var> and <var>newTarget</var> are the
values to be passed as the corresponding arguments of the internal method. If <var>argumentsList</var> is not present, an
empty <a href="#sec-list-and-record-specification-type">List</a> is used as its value. If <var>newTarget</var> is not
present, <var>F</var> is used as its value. This abstract operation performs the following steps:</p>
<ol class="proc">
<li>If <i>newTarget</i> was not passed, let <i>newTarget</i> be <i>F</i>.</li>
<li>If <i>argumentsList</i> was not passed, let <i>argumentsList</i> be a new empty <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-isconstructor">IsConstructor</a> (<i>F</i>) is
<b>true</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-isconstructor">IsConstructor</a> (<i>newTarget</i>) is
<b>true</b>.</li>
<li>Return <i>F</i>.[[Construct]](<i>argumentsList</i>, <i>newTarget</i>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> If <i>newTarget</i> is not passed, this operation is equivalent to: <code>new
F(...argumentsList)</code></p>
</div>
</section>
<section id="sec-setintegritylevel">
<h1><span class="secnum" id="sec-7.3.15"><a href="#sec-setintegritylevel" title="link to this section">7.3.15</a></span>
SetIntegrityLevel (O, level)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">SetIntegrityLevel</span> is used to fix the set of own
properties of an object. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>level</i> is either <code>"sealed"</code> or
<code>"frozen"</code>.</li>
<li>Let <i>status</i> be <i>O</i>.[[PreventExtensions]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>If <i>status</i> is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>keys</i> be <i>O</i>.[[OwnPropertyKeys]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>keys</i>).</li>
<li>If <i>level</i> is <code>"sealed"</code>, then
<ol class="block">
<li>Repeat for each element <i>k</i> of <i>keys</i>,
<ol class="block">
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>O</i>, <i>k</i>,
PropertyDescriptor{ [[Configurable]]: <b>false</b>}).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
</ol>
</li>
</ol>
</li>
<li>Else <i>level</i> is <code>"frozen"</code>,
<ol class="block">
<li>Repeat for each element <i>k</i> of <i>keys</i>,
<ol class="block">
<li>Let <i>currentDesc</i> be <i>O</i>.[[GetOwnProperty]](<i>k</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>currentDesc</i>).</li>
<li>If <i>currentDesc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>currentDesc</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>desc</i> be the PropertyDescriptor{[[Configurable]]: <b>false</b>}.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>desc</i> be the PropertyDescriptor { [[Configurable]]: <b>false</b>, [[Writable]]: <b>false</b>
}.</li>
</ol>
</li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>O</i>, <i>k</i>,
<i>desc</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-testintegritylevel">
<h1><span class="secnum" id="sec-7.3.16"><a href="#sec-testintegritylevel" title="link to this section">7.3.16</a></span>
TestIntegrityLevel (O, level)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">TestIntegrityLevel</span> is used to determine if the
set of own properties of an object are fixed. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>level</i> is either <code>"sealed"</code> or
<code>"frozen"</code>.</li>
<li>Let <i>status</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>O</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>If <i>status</i> is <b>true</b>, return <b>false</b></li>
<li>NOTE If the object is extensible, none of its properties are examined.</li>
<li>Let <i>keys</i> be <i>O</i>.[[OwnPropertyKeys]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>keys</i>).</li>
<li>Repeat for each element <i>k</i> of <i>keys</i>,
<ol class="block">
<li>Let <i>currentDesc</i> be <i>O</i>.[[GetOwnProperty]](<i>k</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>currentDesc</i>).</li>
<li>If <i>currentDesc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <i>currentDesc</i>.[[Configurable]] is <b>true</b>, return <b>false</b>.</li>
<li>If <i>level</i> is <code>"frozen"</code> and <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>currentDesc</i>) is <b>true</b>, then
<ol class="block">
<li>If <i>currentDesc</i>.[[Writable]] is <b>true</b>, return <b>false</b>.</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-createarrayfromlist">
<h1><span class="secnum" id="sec-7.3.17"><a href="#sec-createarrayfromlist" title="link to this section">7.3.17</a></span>
CreateArrayFromList (elements)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateArrayFromList</span> is used to create an Array
object whose elements are provided by a <a href="#sec-list-and-record-specification-type">List</a>. This abstract operation
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>elements</i> is a <a
href="#sec-list-and-record-specification-type">List</a> whose elements are all <a
href="#sec-ecmascript-language-types">ECMAScript language values</a>.</li>
<li>Let <i>array</i> be <a href="#sec-arraycreate">ArrayCreate</a>(0) (<a href="#sec-arraycreate">see 9.4.2.2</a>).</li>
<li>Let <i>n</i> be 0.</li>
<li>For each element <i>e</i> of <i>elements</i>
<ol class="block">
<li>Let <i>status</i> be <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>array</i>, <a
href="#sec-tostring">ToString</a>(<i>n</i>), <i>e</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is <b>true</b>.</li>
<li>Increment <i>n</i> by 1.</li>
</ol>
</li>
<li>Return <i>array</i>.</li>
</ol>
</section>
<section id="sec-createlistfromarraylike">
<h1><span class="secnum" id="sec-7.3.18"><a href="#sec-createlistfromarraylike"
title="link to this section">7.3.18</a></span> CreateListFromArrayLike (obj [, elementTypes] )</h1>
<p>The abstract operation CreateListFromArrayLike is used to create a List value whose elements are provided by the indexed
properties of an array-like object, <var>obj</var>. The optional argument <var>elementTypes</var> is a <a
href="#sec-list-and-record-specification-type">List</a> containing the names of ECMAScript Language Types that are allowed
for element values of the <a href="#sec-list-and-record-specification-type">List</a> that is created. This abstract
operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>obj</i>).</li>
<li>If <i>elementTypes</i> was not passed, let <i>elementTypes</i> be (Undefined, Null, Boolean, String, Symbol, Number,
Object).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>obj</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Let <i>len</i> be <a href="#sec-tolength">ToLength</a>(<a href="#sec-get-o-p">Get</a>(<i>obj</i>,
<code>"length"</code>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>len</i>).</li>
<li>Let <i>list</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>index</i> be 0.</li>
<li>Repeat while <i>index</i> < <i>len</i>
<ol class="block">
<li>Let <i>indexName</i> be <a href="#sec-tostring">ToString</a>(<i>index</i>).</li>
<li>Let <i>next</i> be <a href="#sec-get-o-p">Get</a>(<i>obj</i>, <i>indexName</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>next</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>next</i>) is not an element of <i>elementTypes</i>,
throw a <b>TypeError</b> exception.</li>
<li>Append <i>next</i> as the last element of <i>list</i>.</li>
<li>Set <i>index</i> to <i>index</i> + 1.</li>
</ol>
</li>
<li>Return <i>list</i>.</li>
</ol>
</section>
<section id="sec-ordinaryhasinstance">
<h1><span class="secnum" id="sec-7.3.19"><a href="#sec-ordinaryhasinstance" title="link to this section">7.3.19</a></span>
OrdinaryHasInstance (C, O)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">OrdinaryHasInstance</span> implements the default
algorithm for determining if an object <var>O</var> inherits from the instance object inheritance path provided by
constructor <var>C</var>. This abstract operation performs the following steps:</p>
<ol class="proc">
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>C</i>) is <b>false</b>, return <b>false</b>.</li>
<li>If <i>C</i> has a <a href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>, then
<ol class="block">
<li>Let <i>BC</i> be the value of <i>C’s</i> <a
href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Return <a href="#sec-instanceofoperator">InstanceofOperator</a>(<i>O</i>,<i>BC</i>) (<a
href="#sec-instanceofoperator">see 12.9.4</a>).</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is not Object, return <b>false</b>.</li>
<li>Let <i>P</i> be <a href="#sec-get-o-p">Get</a>(<i>C</i>, <code>"prototype"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>P</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Repeat
<ol class="block">
<li>Let <i>O</i> be <i>O</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>O</i>).</li>
<li>If <i>O</i> is <code>null</code>, return <b>false</b>.</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>P</i>, <i>O</i>) is <b>true</b>, return <b>true</b>.</li>
</ol>
</li>
</ol>
</section>
<section id="sec-speciesconstructor">
<h1><span class="secnum" id="sec-7.3.20"><a href="#sec-speciesconstructor" title="link to this section">7.3.20</a></span>
SpeciesConstructor ( O, defaultConstructor )</h1>
<p>The abstract operation SpeciesConstructor is used to retrieve the constructor that should be used to create new objects
that are derived from the argument object <var>O</var>. The <var>defaultConstructor</var> argument is the constructor to use
if a constructor @@species property cannot be found starting from <var>O</var>. This abstract operation performs the
following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>) is
Object.</li>
<li>Let <i>C</i> be <a href="#sec-get-o-p">Get</a>(<i>O</i>, <code>"constructor"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>C</i>).</li>
<li>If <i>C</i> is <b>undefined</b>, return <i>defaultConstructor</i>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>C</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Let <i>S</i> be <a href="#sec-get-o-p">Get</a>(<i>C</i>, @@species).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>S</i>).</li>
<li>If <i>S</i> is either <b>undefined</b> or <b>null</b>, return <i>defaultConstructor</i>.</li>
<li>If <a href="#sec-isconstructor">IsConstructor</a>(<i>S</i>) is <b>true</b>, return <i>S.</i></li>
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
</section>
<section id="sec-enumerableownnames">
<h1><span class="secnum" id="sec-7.3.21"><a href="#sec-enumerableownnames" title="link to this section">7.3.21</a></span>
EnumerableOwnNames (O)</h1>
<p>When the abstract operation EnumerableOwnNames is called with Object <var>O</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>O</i>)
is Object.</li>
<li>Let <i>ownKeys</i> be <i>O</i>.[[OwnPropertyKeys]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>ownKeys</i>).</li>
<li>Let <i>names</i> be a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Repeat, for each element <i>key</i> of <i>ownKeys</i> in <a href="#sec-list-and-record-specification-type">List</a>
order
<ol class="block">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>key</i>) is String, then
<ol class="block">
<li>Let <i>desc</i> be <i>O</i>.[[GetOwnProperty]](<i>key</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>desc</i>).</li>
<li>If <i>desc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <i>desc.</i>[[Enumerable]] is <b>true</b>, append <i>key</i> to <i>names</i>.</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Order the elements of <i>names</i> so they are in the same relative order as would be produced by the Iterator that
would be returned if the [[Enumerate]] internal method was invoked on <i>O</i>.</li>
<li>Return <i>names</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The order of elements is returned list is the same as the enumeration order that used by a
for-in statement.</p>
</div>
</section>
<section id="sec-getfunctionrealm">
<h1><span class="secnum" id="sec-7.3.22"><a href="#sec-getfunctionrealm" title="link to this section">7.3.22</a></span>
GetFunctionRealm ( obj )</h1>
<p>The abstract operation GetFunctionRealm with argument <var>obj</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>obj</i> is a callable object.</li>
<li>If <i>obj</i> has a [[Realm]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>, then
<ol class="block">
<li>Return <i>obj</i>’s [[Realm]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a>.</li>
</ol>
</li>
<li>If <i>obj</i> is a <a href="#sec-bound-function-exotic-objects">Bound Function</a> exotic object, then
<ol class="block">
<li>Let <i>target</i> be <i>obj</i>’s <a href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a>
<a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Return GetFunctionRealm(<i>target</i>).</li>
</ol>
</li>
<li>If <i>obj</i> is a Proxy exotic object, then
<ol class="block">
<li>If the value of the [[ProxyHandler]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>
of <i>obj</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>proxyTarget</i> be the value of <i>obj</i>’s [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Return GetFunctionRealm(<i>proxyTarget</i>).</li>
</ol>
</li>
<li>Return <a href="#sec-execution-contexts">the running execution context</a>’s <a
href="#sec-code-realms">Realm</a>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Step 5 will only be reached if <i>target</i> is a non-standard exotic function object that
does not have a [[Realm]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</p>
</div>
</section>
</section>
<section id="sec-operations-on-iterator-objects">
<div class="front">
<h1><span class="secnum" id="sec-7.4"><a href="#sec-operations-on-iterator-objects"
title="link to this section">7.4</a></span> Operations on Iterator Objects</h1>
<p>See Common Iteration Interfaces (<a href="#sec-iteration">25.1</a>).</p>
</div>
<section id="sec-getiterator">
<h1><span class="secnum" id="sec-7.4.1"><a href="#sec-getiterator" title="link to this section">7.4.1</a></span> GetIterator
( obj, method )</h1>
<p>The abstract operation GetIterator with argument <span style="font-family: Times New Roman"><i>obj</i> and</span>
optional argument <var>method</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>obj</i>).</li>
<li>If <i>method</i> was not passed, then
<ol class="block">
<li>Let <i>method</i> be <a href="#sec-getmethod">GetMethod</a>(<i>obj</i>, @@iterator).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>method</i>).</li>
</ol>
</li>
<li>Let <i>iterator</i> be <a href="#sec-call">Call</a>(<i>method</i>,<i>obj</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>iterator</i>)<i>.</i></li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>iterator</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>iterator</i>.</li>
</ol>
</section>
<section id="sec-iteratornext">
<h1><span class="secnum" id="sec-7.4.2"><a href="#sec-iteratornext" title="link to this section">7.4.2</a></span>
IteratorNext ( iterator, value )</h1>
<p>The abstract operation IteratorNext with argument <var>iterator</var> and optional argument <var>value</var> performs the
following steps:</p>
<ol class="proc">
<li>If <i>value</i> was not passed, then
<ol class="block">
<li>Let <i>result</i> be <a href="#sec-invoke">Invoke</a>(<i>iterator</i>, <code>"next"</code>, «‍
»).</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>result</i> be <a href="#sec-invoke">Invoke</a>(<i>iterator</i>, <code>"next"</code>,
«‍<i>value</i>»).</li>
</ol>
</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>result</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>result</i>.</li>
</ol>
</section>
<section id="sec-iteratorcomplete">
<h1><span class="secnum" id="sec-7.4.3"><a href="#sec-iteratorcomplete" title="link to this section">7.4.3</a></span>
IteratorComplete ( iterResult )</h1>
<p>The abstract operation IteratorComplete with argument <var>iterResult</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>iterResult</i>) is Object.</li>
<li>Return <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-get-o-p">Get</a>(<i>iterResult</i>,
<code>"done"</code>)).</li>
</ol>
</section>
<section id="sec-iteratorvalue">
<h1><span class="secnum" id="sec-7.4.4"><a href="#sec-iteratorvalue" title="link to this section">7.4.4</a></span>
IteratorValue ( iterResult )</h1>
<p>The abstract operation IteratorValue with argument <var>iterResult</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>iterResult</i>) is Object.</li>
<li>Return <a href="#sec-get-o-p">Get</a>(<i>iterResult</i>, <code>"value"</code>).</li>
</ol>
</section>
<section id="sec-iteratorstep">
<h1><span class="secnum" id="sec-7.4.5"><a href="#sec-iteratorstep" title="link to this section">7.4.5</a></span>
IteratorStep ( iterator )</h1>
<p>The abstract operation IteratorStep with argument <var>iterator</var> requests the next value from <var>iterator</var>
and returns either <span class="value">false</span> indicating that the iterator has reached its end or the IteratorResult
object if a next value is available. IteratorStep performs the following steps:</p>
<ol class="proc">
<li>Let <i>result</i> be <a href="#sec-iteratornext">IteratorNext</a>(<i>iterator</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>Let <i>done</i> be <a href="#sec-iteratorcomplete">IteratorComplete</a>(<i>result</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>done</i>).</li>
<li>If <i>done</i> is <b>true</b>, return <b>false</b>.</li>
<li>Return <i>result</i>.</li>
</ol>
</section>
<section id="sec-iteratorclose">
<h1><span class="secnum" id="sec-7.4.6"><a href="#sec-iteratorclose" title="link to this section">7.4.6</a></span>
IteratorClose( iterator, completion )</h1>
<p>The abstract operation IteratorClose with arguments <var>iterator</var> and <var>completion</var> is used to notify an
iterator that it should perform any actions it would normally perform when it has reached its completed state:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>iterator</i>) is Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>completion</i> is a <a
href="#sec-completion-record-specification-type">Completion Record</a>.</li>
<li>Let <i>return</i> be <a href="#sec-getmethod">GetMethod</a>(<i>iterator</i>, <code>"return"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>return</i>).</li>
<li>If <i>return</i> is <b>undefined</b>, return <a
href="#sec-completion-record-specification-type">Completion</a>(<i>completion</i>).</li>
<li>Let <i>innerResult</i> be <a href="#sec-call">Call</a>(<i>return</i>, <i>iterator</i>, «‍ »).</li>
<li>If <i>completion</i>.[[type]] is <span style="font-family: sans-serif">throw</span>, return <a
href="#sec-completion-record-specification-type">Completion</a>(<i>completion</i>).</li>
<li>If <i>innerResult</i>.[[type]] is <span style="font-family: sans-serif">throw</span>, return <a
href="#sec-completion-record-specification-type">Completion</a>(<i>innerResult</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>innerResult</i>.[[value]]) is not Object<i>,</i> throw
a <b>TypeError</b> exception.</li>
<li>Return <a href="#sec-completion-record-specification-type">Completion</a>(<i>completion</i>).</li>
</ol>
</section>
<section id="sec-createiterresultobject">
<h1><span class="secnum" id="sec-7.4.7"><a href="#sec-createiterresultobject" title="link to this section">7.4.7</a></span>
CreateIterResultObject ( value, done )</h1>
<p>The abstract operation CreateIterResultObject with arguments <var>value</var> and <var>done</var> creates an object that
supports the IteratorResult interface by performing the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>done</i>)
is Boolean.</li>
<li>Let <i>obj</i> be <a href="#sec-objectcreate">ObjectCreate</a>(<span style="font-family:
sans-serif">%ObjectPrototype%</span>).</li>
<li>Perform <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>, <code>"value"</code>, <i>value</i>).</li>
<li>Perform <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>, <code>"done"</code>, <i>done</i>).</li>
<li>Return <i>obj</i>.</li>
</ol>
</section>
<section id="sec-createlistiterator">
<div class="front">
<h1><span class="secnum" id="sec-7.4.8"><a href="#sec-createlistiterator" title="link to this section">7.4.8</a></span>
CreateListIterator ( list )</h1>
<p>The abstract operation CreateListIterator with argument <var>list</var> creates an Iterator (<a
href="#sec-iterator-interface">25.1.1.2</a>) object whose next method returns the successive elements of <var>list</var>.
It performs the following steps:</p>
<ol class="proc">
<li>Let <i>iterator</i> be <a href="#sec-objectcreate">ObjectCreate</a>(%IteratorPrototype%, «[[IteratorNext]],
[[IteratedList]], [[ListIteratorNextIndex]]»).</li>
<li>Set <i>iterator’s</i> [[IteratedList]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> to <i>list</i>.</li>
<li>Set <i>iterator’s</i> [[ListIteratorNextIndex]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to 0.</li>
<li>Let <i>next</i> be a new built-in function object as defined in ListIterator <code>next</code> (<a
href="#sec-listiterator-next">7.4.8.1</a>).</li>
<li>Set <i>iterator’s</i> [[IteratorNext]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> to <i>next</i>.</li>
<li>Perform <a href="#sec-createmethodproperty">CreateMethodProperty</a>(<i>iterator</i>, <code>"next"</code>,
<i>next</i>).</li>
<li>Return <i>iterator</i>.</li>
</ol>
</div>
<section id="sec-listiterator-next">
<h1><span class="secnum" id="sec-7.4.8.1"><a href="#sec-listiterator-next" title="link to this section">7.4.8.1</a></span>
ListIterator next( )</h1>
<p>The ListIterator <code>next</code> method is a standard built-in function object (<a
href="#sec-ecmascript-standard-built-in-objects">clause 17</a>) that performs the following steps:</p>
<ol class="proc">
<li>Let <i>O</i> be the <b>this</b> value.</li>
<li>Let <i>f</i> be the active function object.</li>
<li>If <i>O</i> does not have a [[IteratorNext]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>next</i> be the value of the [[IteratorNext]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>f</i>, <i>next</i>) is <b>false</b>, throw a <b>TypeError</b>
exception.</li>
<li>If <i>O</i> does not have a [[IteratedList]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>list</i> be the value of the [[IteratedList]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>index</i> be the value of the [[ListIteratorNextIndex]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>len</i> be the number of elements of <i>list</i>.</li>
<li>If <i>index</i> ≥ <i>len</i>, then
<ol class="block">
<li>Return <a href="#sec-createiterresultobject">CreateIterResultObject</a>(<b>undefined</b>, <b>true</b>).</li>
</ol>
</li>
<li>Set the value of the [[ListIteratorNextIndex]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> of <i>O</i> to <i>index</i>+1.</li>
<li>Return <a href="#sec-createiterresultobject">CreateIterResultObject</a>(<i>list</i>[<i>index</i>],
<b>false</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> A ListIterator <code>next</code> method will throw an exception if applied to any object
other than the one with which it was originally associated.</p>
</div>
</section>
</section>
</section>
</section>
<section id="sec-executable-code-and-execution-contexts">
<div class="front">
<h1><span class="secnum" id="sec-8"><a href="#sec-executable-code-and-execution-contexts"
title="link to this section">8</a></span> Executable Code and Execution Contexts</h1>
</div>
<section id="sec-lexical-environments">
<div class="front">
<h1><span class="secnum" id="sec-8.1"><a href="#sec-lexical-environments" title="link to this section">8.1</a></span>
Lexical Environments</h1>
<p>A <i>Lexical Environment</i> is a specification type used to define the association of <span
class="nt">Identifiers</span> to specific variables and functions based upon the lexical nesting structure of ECMAScript
code. A Lexical Environment consists of an <a href="#sec-environment-records">Environment Record</a> and a possibly null
reference to an <i>outer</i> Lexical Environment. Usually a Lexical Environment is associated with some specific syntactic
structure of ECMAScript code such as a <span class="nt">FunctionDeclaration</span>, a <span
class="nt">BlockStatement</span>, or a <span class="nt">Catch</span> clause of a <span class="nt">TryStatement</span> and a
new Lexical Environment is created each time such code is evaluated.</p>
<p>An <a href="#sec-environment-records">Environment Record</a> records the identifier bindings that are created within the
scope of its associated Lexical Environment. It is referred to as the Lexical Environment’s EnvironmentRecord</p>
<p>The outer environment reference is used to model the logical nesting of Lexical Environment values. The outer reference
of a (inner) Lexical Environment is a reference to the Lexical Environment that logically surrounds the inner Lexical
Environment. An outer Lexical Environment may, of course, have its own outer Lexical Environment. A Lexical Environment may
serve as the outer environment for multiple inner Lexical Environments. For example, if a <span
class="nt">FunctionDeclaration</span> contains two nested <span class="nt">FunctionDeclarations</span> then the Lexical
Environments of each of the nested functions will have as their outer Lexical Environment the Lexical Environment of the
current evaluation of the surrounding function.</p>
<p>A <i>global environment</i> is a Lexical Environment which does not have an outer environment. The global
environment’s outer environment reference is <b>null</b>. A global environment’s <a
href="#sec-environment-records">Environment Record</a> may be prepopulated with identifier bindings and includes an
associated <i>global object</i> whose properties provide some of <a href="#sec-global-environment-records">the global
environment</a>’s identifier bindings. This global object is the value of a global environment’s
<code>this</code> binding. As ECMAScript code is executed, additional properties may be added to the global object and the
initial properties may be modified.</p>
<p>A <i>module environment</i> is a Lexical Environment that contains the bindings for the top level declarations of a <span
class="nt">Module</span>. It also contains the bindings that are explicitly imported by the <span class="nt">Module</span>.
The outer environment of a module environment is a global environment.</p>
<p>A <i>function environment</i> is a Lexical Environment that corresponds to the invocation of an <a
href="#sec-ecmascript-function-objects">ECMAScript function object</a>. A function environment may establish a new
<code>this</code> binding. A function environment also captures the state necessary to support <code>super</code> method
invocations.</p>
<p>Lexical Environments and <a href="#sec-environment-records">Environment Record</a> values are purely specification
mechanisms and need not correspond to any specific artefact of an ECMAScript implementation. It is impossible for an
ECMAScript program to directly access or manipulate such values.</p>
</div>
<section id="sec-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1"><a href="#sec-environment-records" title="link to this section">8.1.1</a></span>
Environment Records</h1>
<p>There are two primary kinds of Environment Record values used in this specification: <i>declarative Environment
Records</i> and <i>object Environment Records</i>. Declarative Environment Records are used to define the effect of
ECMAScript language syntactic elements such as <span class="nt">FunctionDeclarations</span>, <span
class="nt">VariableDeclarations</span>, and <span class="nt">Catch</span> clauses that directly associate identifier
bindings with <a href="#sec-ecmascript-language-types">ECMAScript language values</a>. Object Environment Records are used
to define the effect of ECMAScript elements such as <span class="nt">WithStatement</span> that associate identifier
bindings with the properties of some object. <a href="#sec-global-environment-records">Global Environment Records</a> and
function Environment Records are specializations that are used for specifically for <span class="nt">Script</span> global
declarations and for top-level declarations within functions.</p>
<p>For specification purposes Environment Record values are values of the Record specification type and can be thought of
as existing in a simple object-oriented hierarchy where Environment Record is an abstract class with three concrete
subclasses, declarative Environment Record, object Environment Record, and global Environment Record. <a
href="#sec-function-environment-records">Function Environment Records</a> and module Environment Records are subclasses of
declarative Environment Record. The abstract class includes the abstract specification methods defined in <a
href="#table-15">Table 15</a>. These abstract methods have distinct concrete algorithms for each of the concrete
subclasses.</p>
<figure>
<figcaption><span id="table-15">Table 15</span> — Abstract Methods of Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Method</th>
<th>Purpose</th>
</tr>
<tr>
<td>HasBinding(N)</td>
<td>Determine if an Environment Record has a binding for the String value <var>N</var>. Return <b>true</b> if it does and <b>false</b> if it does not</td>
</tr>
<tr>
<td>CreateMutableBinding(N, D)</td>
<td>Create a new but uninitialized mutable binding in an Environment Record. The String value <var>N</var> is the text of the bound name. If the optional Boolean argument <var>D</var> is <b>true</b> the binding is may be subsequently deleted.</td>
</tr>
<tr>
<td>CreateImmutableBinding(N, S)</td>
<td>Create a new but uninitialized immutable binding in an Environment Record. The String value N is the text of the bound name. If <var>S</var> is <b>true</b> then attempts to access the value of the binding before it is initialized or set it after it has been initialized will always throw an exception, regardless of the strict mode setting of operations that reference that binding. <var>S</var> is an optional parameter that defaults to <b>false</b>.</td>
</tr>
<tr>
<td>InitializeBinding(N,V)</td>
<td>Set the value of an already existing but uninitialized binding in an Environment Record. The String value N is the text of the bound name. V is the value for the binding and is a value of any <a href="#sec-ecmascript-language-types">ECMAScript language type</a>.</td>
</tr>
<tr>
<td>SetMutableBinding(N,V, S)</td>
<td>Set the value of an already existing mutable binding in an Environment Record. The String value <var>N</var> is the text of the bound name. <var>V</var> is the value for the binding and may be a value of any <a href="#sec-ecmascript-language-types">ECMAScript language type</a>. <var>S</var> is a Boolean flag. If <var>S</var> is <b>true</b> and the binding cannot be set throw a <b>TypeError</b> exception.</td>
</tr>
<tr>
<td>GetBindingValue(N,S)</td>
<td>Returns the value of an already existing binding from an Environment Record. The String value <var>N</var> is the text of the bound name. <var>S</var> is used to identify references originating in <a href="#sec-strict-mode-code">strict mode code</a> or that otherwise require strict mode reference semantics. If <var>S</var> is <b>true</b> and the binding does not exist throw a <b>ReferenceError</b> exception. If the binding exists but is uninitialized a <b>ReferenceError</b> is thrown, regardless of the value of <i><span style="font-family: Times New Roman">S</span>.</i></td>
</tr>
<tr>
<td>DeleteBinding(N)</td>
<td>Delete a binding from an Environment Record. The String value <var>N</var> is the text of the bound name. If a binding for <var>N</var> exists, remove the binding and return <b>true</b>. If the binding exists but cannot be removed return <b>false</b>. If the binding does not exist return <b>true</b>.</td>
</tr>
<tr>
<td>HasThisBinding()</td>
<td>Determine if an Environment Record establishes a <code>this</code> binding. Return <b>true</b> if it does and <b>false</b> if it does not.</td>
</tr>
<tr>
<td>HasSuperBinding()</td>
<td>Determine if an Environment Record establishes a <code>super</code> method binding. Return <b>true</b> if it does and <b>false</b> if it does not.</td>
</tr>
<tr>
<td>WithBaseObject ()</td>
<td>If this Environment Record is associated with a <code>with</code> statement, return the with object. Otherwise, return <span class="value">undefined</span>.</td>
</tr>
</table>
</figure>
</div>
<section id="sec-declarative-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1.1"><a href="#sec-declarative-environment-records"
title="link to this section">8.1.1.1</a></span> Declarative Environment Records</h1>
<p>Each declarative <a href="#sec-environment-records">Environment Record</a> is associated with an ECMAScript program
scope containing variable, constant, let, class, module, import, and/or function declarations. A declarative <a
href="#sec-environment-records">Environment Record</a> binds the set of identifiers defined by the declarations
contained within its scope.</p>
<p>The behaviour of the concrete specification methods for declarative environment records is defined by the following
algorithms.</p>
</div>
<section id="sec-declarative-environment-records-hasbinding-n">
<h1><span class="secnum" id="sec-8.1.1.1.1"><a href="#sec-declarative-environment-records-hasbinding-n"
title="link to this section">8.1.1.1.1</a></span> HasBinding(N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasBinding for declarative Environment
Records simply determines if the argument identifier is one of the identifiers bound by the record:</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li>If <i>envRec</i> has a binding for the name that is the value of <i>N</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-declarative-environment-records-createmutablebinding-n-d">
<h1><span class="secnum" id="sec-8.1.1.1.2"><a href="#sec-declarative-environment-records-createmutablebinding-n-d"
title="link to this section">8.1.1.1.2</a></span> CreateMutableBinding (N, D)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateMutableBinding for declarative
Environment Records creates a new mutable binding for the name <var>N</var> that is uninitialized. A binding must not
already exist in this <a href="#sec-environment-records">Environment Record</a> for <var>N</var>. If Boolean argument
<var>D</var> is provided and has the value <b>true</b> the new binding is marked as being subject to deletion.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> does not already have a binding for <i>N</i>.</li>
<li>Create a mutable binding in <i>envRec</i> for <i>N</i> and record that it is uninitialized. If <i>D</i> is
<b>true</b> record that the newly created binding may be deleted by a subsequent DeleteBinding call.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</section>
<section id="sec-declarative-environment-records-createimmutablebinding-n-s">
<h1><span class="secnum" id="sec-8.1.1.1.3"><a href="#sec-declarative-environment-records-createimmutablebinding-n-s"
title="link to this section">8.1.1.1.3</a></span> CreateImmutableBinding (N, S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateImmutableBinding for declarative
Environment Records creates a new immutable binding for the name <var>N</var> that is uninitialized. A binding must not
already exist in this <a href="#sec-environment-records">Environment Record</a> for <var>N</var>. If Boolean argument
<var>S</var> is provided and has the value <b>true</b> the new binding is marked as a strict binding.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> does not already have a binding for <i>N</i>.</li>
<li>Create an immutable binding in <i>envRec</i> for <i>N</i> and record that it is uninitialized. If <i>S</i> is
<b>true</b> record that the newly created binding is a strict binding.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</section>
<section id="sec-declarative-environment-records-initializebinding-n-v">
<h1><span class="secnum" id="sec-8.1.1.1.4"><a href="#sec-declarative-environment-records-initializebinding-n-v"
title="link to this section">8.1.1.1.4</a></span> InitializeBinding (N,V)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method InitializeBinding for declarative
Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
the argument <var>N</var> to the value of argument <var>V</var>. An uninitialized binding for <var>N</var> must already
exist.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> must have an uninitialized binding for
<i>N</i>.</li>
<li>Set the bound value for <i>N</i> in <i>envRec</i> to <i>V</i>.</li>
<li>Record that the binding for <i>N</i> in <i>envRec</i> has been initialized.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</section>
<section id="sec-declarative-environment-records-setmutablebinding-n-v-s">
<h1><span class="secnum" id="sec-8.1.1.1.5"><a href="#sec-declarative-environment-records-setmutablebinding-n-v-s"
title="link to this section">8.1.1.1.5</a></span> SetMutableBinding (N,V,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method SetMutableBinding for declarative
Environment Records attempts to change the bound value of the current binding of the identifier whose name is the value
of the argument <var>N</var> to the value of argument <var>V</var>. A binding for <var>N</var> normally already exist,
but in rare cases it may not. If the binding is an immutable binding, a <b>TypeError</b> is thrown if <span
style="font-family: Times New Roman">S</span> is <span class="value">true</span>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li>If <i>envRec</i> does not have a binding for <i>N</i>, then
<ol class="block">
<li>If <i>S</i> is <b>true</b> throw a <b>ReferenceError</b> exception.</li>
<li>Perform <i>envRec</i>.CreateMutableBinding(<i>N</i>, <b>true</b>).</li>
<li>Perform <i>envRec</i>.InitializeBinding(<i>N</i>, <i>V</i>).</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</li>
<li>If the binding for <i>N</i> in <i>envRec</i> is a strict binding, let <i>S</i> be <b>true</b>.</li>
<li>If the binding for <i>N</i> in <i>envRec</i> has not yet been initialized throw a <b>ReferenceError</b>
exception.</li>
<li>Else if the binding for <i>N</i> in <i>envRec</i> is a mutable binding, change its bound value to <i>V</i>.</li>
<li>Else this must be an attempt to change the value of an immutable binding so if <i>S</i> is <b>true</b> throw a
<b>TypeError</b> exception.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> An example of ECMAScript code that results in a missing binding at step 2 is:</p>
<pre>function f(){eval("var x; x = (delete x, 0);")}</pre>
</div>
</section>
<section id="sec-declarative-environment-records-getbindingvalue-n-s">
<h1><span class="secnum" id="sec-8.1.1.1.6"><a href="#sec-declarative-environment-records-getbindingvalue-n-s"
title="link to this section">8.1.1.1.6</a></span> GetBindingValue(N,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method GetBindingValue for declarative
Environment Records simply returns the value of its bound identifier whose name is the value of the argument
<var>N</var>. If the binding exists but is uninitialized a <b>ReferenceError</b> is thrown, regardless of the value of
<i><span style="font-family: Times New Roman">S</span>.</i></p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> has a binding for <i>N</i>.</li>
<li>If the binding for <i>N</i> in <i>envRec</i> is an uninitialized binding, throw a <b>ReferenceError</b>
exception.</li>
<li>Return the value currently bound to <i>N</i> in <i>envRec</i>.</li>
</ol>
</section>
<section id="sec-declarative-environment-records-deletebinding-n">
<h1><span class="secnum" id="sec-8.1.1.1.7"><a href="#sec-declarative-environment-records-deletebinding-n"
title="link to this section">8.1.1.1.7</a></span> DeleteBinding (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method DeleteBinding for declarative
Environment Records can only delete bindings that have been explicitly designated as being subject to deletion.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the declarative <a href="#sec-environment-records">Environment Record</a> for which the
method was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> has a binding for the name that is the value of
<i>N</i>.</li>
<li>If the binding for <i>N</i> in <i>envRec</i> cannot be deleted, return <b>false</b>.</li>
<li>Remove the binding for <i>N</i> from <i>envRec</i>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-declarative-environment-records-hasthisbinding">
<h1><span class="secnum" id="sec-8.1.1.1.8"><a href="#sec-declarative-environment-records-hasthisbinding"
title="link to this section">8.1.1.1.8</a></span> HasThisBinding ()</h1>
<p>Regular declarative Environment Records do not provide a <code>this</code> binding.</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-declarative-environment-records-hassuperbinding">
<h1><span class="secnum" id="sec-8.1.1.1.9"><a href="#sec-declarative-environment-records-hassuperbinding"
title="link to this section">8.1.1.1.9</a></span> HasSuperBinding ()</h1>
<p>Regular declarative Environment Records do not provide a <code>super</code> binding.</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-declarative-environment-records-withbaseobject">
<h1><span class="secnum" id="sec-8.1.1.1.10"><a href="#sec-declarative-environment-records-withbaseobject"
title="link to this section">8.1.1.1.10</a></span> WithBaseObject()</h1>
<p>Declarative Environment Records always return <b>undefined</b> as their WithBaseObject.</p>
<ol class="proc">
<li>Return <b>undefined</b>.</li>
</ol>
</section>
</section>
<section id="sec-object-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1.2"><a href="#sec-object-environment-records"
title="link to this section">8.1.1.2</a></span> Object Environment Records</h1>
<p>Each object <a href="#sec-environment-records">Environment Record</a> is associated with an object called its
<i>binding object</i>. An object <a href="#sec-environment-records">Environment Record</a> binds the set of string
identifier names that directly correspond to the property names of its binding object. Property keys that are not
strings in the form of an <span class="nt">IdentifierName</span> are not included in the set of bound identifiers. Both
own and inherited properties are included in the set regardless of the setting of their [[Enumerable]] attribute.
Because properties can be dynamically added and deleted from objects, the set of identifiers bound by an object <a
href="#sec-environment-records">Environment Record</a> may potentially change as a side-effect of any operation that
adds or deletes properties. Any bindings that are created as a result of such a side-effect are considered to be a
mutable binding even if the Writable attribute of the corresponding property has the value <b>false</b>. Immutable
bindings do not exist for object Environment Records.</p>
<p>Object Environment Records created for <code>with</code> statements (<a href="#sec-with-statement">13.10</a>) can
provide their binding object as an implicit <b>this</b> value for use in function calls. The capability is controlled by
a <var>withEnvironment</var> Boolean value that is associated with each object <a
href="#sec-environment-records">Environment Record</a>. By default, the value of <var>withEnvironment</var> is
<b>false</b> for any object <a href="#sec-environment-records">Environment Record</a>.</p>
<p>The behaviour of the concrete specification methods for object environment records is defined by the following
algorithms.</p>
</div>
<section id="sec-object-environment-records-hasbinding-n">
<h1><span class="secnum" id="sec-8.1.1.2.1"><a href="#sec-object-environment-records-hasbinding-n"
title="link to this section">8.1.1.2.1</a></span> HasBinding(N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasBinding for object Environment
Records determines if its associated binding object has a property whose name is the value of the argument
<var>N</var>:</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>bindings</i> be the binding object for <i>envRec</i>.</li>
<li>Let <i>foundBinding</i> be <a href="#sec-hasproperty">HasProperty</a>(<i>bindings</i>, <i>N</i>)</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>foundBinding</i>).</li>
<li>If <i>foundBinding</i> is <b>false</b>, return <b>false</b>.</li>
<li>If the <i>withEnvironment</i> flag of <i>envRec</i> is <b>false</b>, return <b>true</b>.</li>
<li>Let <i>unscopables</i> be <a href="#sec-get-o-p">Get</a>(<i>bindings</i>, @@unscopables).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>unscopables</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>unscopables</i>) is Object, then
<ol class="block">
<li>Let <i>blocked</i> be <a href="#sec-toboolean">ToBoolean</a>(<a
href="#sec-get-o-p">Get</a>(<i>unscopables</i>, <i>N</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>blocked</i>).</li>
<li>If <i>blocked</i> is <b>true</b>, return <b>false</b>.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-object-environment-records-createmutablebinding-n-d">
<h1><span class="secnum" id="sec-8.1.1.2.2"><a href="#sec-object-environment-records-createmutablebinding-n-d"
title="link to this section">8.1.1.2.2</a></span> CreateMutableBinding (N, D)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateMutableBinding for object
Environment Records creates in an Environment Record’s associated binding object a property whose name is the
String value and initializes it to the value <b>undefined</b>. If Boolean argument <var>D</var> is provided and has the
value <b>true</b> the new property’s [[Configurable]] attribute is set to <b>true</b>, otherwise it is set to
<b>false</b>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>bindings</i> be the binding object for <i>envRec</i>.</li>
<li>If <i>D</i> is <b>true</b> then let <i>configValue</i> be <b>true</b> otherwise let <i>configValue</i> be
<b>false</b>.</li>
<li>Return <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>bindings</i>, <i>N</i>,
PropertyDescriptor{[[Value]]:<b>undefined</b>, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>true</b> ,
[[Configurable]]: <i>configValue</i>}).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Normally <i>envRec</i> will not have a binding for <i>N</i> but if it does, the
semantics of <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a> may result in an existing binding being
replaced or shadowed or cause an <a href="#sec-completion-record-specification-type">abrupt completion</a> to be
returned.</p>
</div>
</section>
<section id="sec-object-environment-records-createimmutablebinding-n-s">
<h1><span class="secnum" id="sec-8.1.1.2.3"><a href="#sec-object-environment-records-createimmutablebinding-n-s"
title="link to this section">8.1.1.2.3</a></span> CreateImmutableBinding (N, S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateImmutableBinding is never used
within this specification in association with Object Environment Records.</p>
</section>
<section id="sec-object-environment-records-initializebinding-n-v">
<h1><span class="secnum" id="sec-8.1.1.2.4"><a href="#sec-object-environment-records-initializebinding-n-v"
title="link to this section">8.1.1.2.4</a></span> InitializeBinding (N,V)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method InitializeBinding for object
Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
the argument <var>N</var> to the value of argument <var>V</var>. An uninitialized binding for <var>N</var> must already
exist.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> must have an uninitialized binding for
<i>N</i>.</li>
<li>Record that the binding for <i>N</i> in <i>envRec</i> has been initialized.</li>
<li>Return <i>envRec</i>.SetMutableBinding(<i>N</i>, <i>V</i>, <b>false</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> In this specification, all uses of CreateMutableBinding for object Environment Records
are immediately followed by a call to InitializeBinding for the same name. Hence, implementations do not need to
explicitly track the initialization state of individual object Environment Record bindings.</p>
</div>
</section>
<section id="sec-object-environment-records-setmutablebinding-n-v-s">
<h1><span class="secnum" id="sec-8.1.1.2.5"><a href="#sec-object-environment-records-setmutablebinding-n-v-s"
title="link to this section">8.1.1.2.5</a></span> SetMutableBinding (N,V,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method SetMutableBinding for object
Environment Records attempts to set the value of the Environment Record’s associated binding object’s
property whose name is the value of the argument <var>N</var> to the value of argument <var>V</var>. A property named
<var>N</var> normally already exists but if it does not or is not currently writable, error handling is determined by
the value of the Boolean argument <var>S</var>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>bindings</i> be the binding object for <i>envRec</i>.</li>
<li>Return <a href="#sec-set-o-p-v-throw">Set</a>(<i>bindings</i>, <i>N</i>, <i>V</i>, <i>S</i>).</li>
</ol>
</section>
<section id="sec-object-environment-records-getbindingvalue-n-s">
<h1><span class="secnum" id="sec-8.1.1.2.6"><a href="#sec-object-environment-records-getbindingvalue-n-s"
title="link to this section">8.1.1.2.6</a></span> GetBindingValue(N,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method GetBindingValue for object Environment
Records returns the value of its associated binding object’s property whose name is the String value of the
argument identifier <var>N</var>. The property should already exist but if it does not the result depends upon the value
of the <var>S</var> argument:</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>bindings</i> be the binding object for <i>envRec</i>.</li>
<li>Let <i>value</i> be <a href="#sec-hasproperty">HasProperty</a>(<i>bindings</i>, <i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>value</i>).</li>
<li>If <i>value</i> is <b>false</b>, then
<ol class="block">
<li>If <i>S</i> is <b>false</b>, return the value <b>undefined</b>, otherwise throw a <b>ReferenceError</b>
exception.</li>
</ol>
</li>
<li>Return <a href="#sec-get-o-p">Get</a>(<i>bindings</i>, <i>N</i>).</li>
</ol>
</section>
<section id="sec-object-environment-records-deletebinding-n">
<h1><span class="secnum" id="sec-8.1.1.2.7"><a href="#sec-object-environment-records-deletebinding-n"
title="link to this section">8.1.1.2.7</a></span> DeleteBinding (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method DeleteBinding for object Environment
Records can only delete bindings that correspond to properties of the environment object whose [[Configurable]]
attribute have the value <b>true</b>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>bindings</i> be the binding object for <i>envRec</i>.</li>
<li>Return <i>bindings</i>.[[Delete]](<i>N</i>).</li>
</ol>
</section>
<section id="sec-object-environment-records-hasthisbinding">
<h1><span class="secnum" id="sec-8.1.1.2.8"><a href="#sec-object-environment-records-hasthisbinding"
title="link to this section">8.1.1.2.8</a></span> HasThisBinding ()</h1>
<p>Regular object environment records do not provide a <code>this</code> binding.</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-object-environment-records-hassuperbinding">
<h1><span class="secnum" id="sec-8.1.1.2.9"><a href="#sec-object-environment-records-hassuperbinding"
title="link to this section">8.1.1.2.9</a></span> HasSuperBinding ()</h1>
<p>Regular object environment records do not provide a <code>super</code> binding.</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-object-environment-records-withbaseobject">
<h1><span class="secnum" id="sec-8.1.1.2.10"><a href="#sec-object-environment-records-withbaseobject"
title="link to this section">8.1.1.2.10</a></span> WithBaseObject()</h1>
<p>Object environment records return <b>undefined</b> as their WithBaseObject unless their <var>withEnvironment</var>
flag is <b>true</b>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the object <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>If the <i>withEnvironment</i> flag of <i>envRec</i> is <b>true</b>, return the binding object for
<i>envRec</i>.</li>
<li>Otherwise, return <b>undefined</b>.</li>
</ol>
</section>
</section>
<section id="sec-function-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1.3"><a href="#sec-function-environment-records"
title="link to this section">8.1.1.3</a></span> Function Environment Records</h1>
<p>A function <a href="#sec-environment-records">Environment Record</a> is a declarative <a
href="#sec-environment-records">Environment Record</a> that is used to represent the top-level scope of a function and,
if the function is not an <span class="nt">ArrowFunction</span>, provides a <code>this</code> binding. If a function is
not an <span class="nt">ArrowFunction</span> function and references <code>super</code>, its function <a
href="#sec-environment-records">Environment Record</a> also contains the state that is used to perform
<code>super</code> method invocations from within the function.</p>
<p>Function Environment Records have the additional state fields listed in <a href="#table-16">Table 16</a>.</p>
<figure>
<figcaption><span id="table-16">Table 16</span> — Additional Fields of Function Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[thisValue]]</td>
<td>Any</td>
<td>This is the <span class="value">this</span> value used for this invocation of the function.</td>
</tr>
<tr>
<td>[[thisBindingStatus]]</td>
<td><code>"lexical"</code> | <code>"initialized"</code> | <code>"uninitialized"</code></td>
<td>If the value is <code>"lexical"</code>, this is an <span class="nt">ArrowFunction</span> and does not have a local this value.</td>
</tr>
<tr>
<td>[[FunctionObject]]</td>
<td>Object</td>
<td>The function Object whose invocation caused this <a href="#sec-environment-records">Environment Record</a> to be created.</td>
</tr>
<tr>
<td>[[HomeObject]]</td>
<td>Object | <b>undefined</b></td>
<td>If the associated function has <code>super</code> property accesses and is not an <span class="nt">ArrowFunction</span>, [[HomeObject]] is the object that the function is bound to as a method. The default value for [[HomeObject]] is <span class="value">undefined</span>.</td>
</tr>
<tr>
<td>[[NewTarget]]</td>
<td>Object | <b>undefined</b></td>
<td>If this <a href="#sec-environment-records">Environment Record</a> was created by the [[Construct]] internal method, [[NewTarget]] is the value of the [[Construct]] <var>newTarget</var> parameter. Otherwise, its value is <span class="value">undefined</span>.</td>
</tr>
</table>
</figure>
<p>Function Environment Records support all of the declarative Environment Record methods listed in <a
href="#table-15">Table 15</a> and share the same specifications for all of those methods except for HasThisBinding and
HasSuperBinding. In addition, function Environment Records support the methods listed in <a href="#table-17">Table
17</a>:</p>
<figure>
<figcaption><span id="table-17">Table 17</span> — Additional Methods of Function Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Method</th>
<th>Purpose</th>
</tr>
<tr>
<td><a href="#sec-bindthisvalue">BindThisValue</a>(V)</td>
<td>Set the [[thisValue]] and record that it has been initialized.</td>
</tr>
<tr>
<td>GetThisBinding()</td>
<td>Return the value of this <a href="#sec-environment-records">Environment Record</a>’s <code>this</code> binding. Throws a <span class="value">ReferenceError</span> if the <code>this</code> binding has not been initialized.</td>
</tr>
<tr>
<td><a href="#sec-getsuperbase">GetSuperBase</a>()</td>
<td>Return the object that is the base for <code>super</code> property accesses bound in this <a href="#sec-environment-records">Environment Record</a>. The object is derived from this <a href="#sec-environment-records">Environment Record</a>’s [[HomeObject]] field. The value <span class="value">undefined</span> indicates that <code>super</code> property accesses will produce runtime errors.</td>
</tr>
</table>
</figure>
<p>The behaviour of the additional concrete specification methods for function Environment Records is defined by the
following algorithms:</p>
</div>
<section id="sec-bindthisvalue">
<h1><span class="secnum" id="sec-8.1.1.3.1"><a href="#sec-bindthisvalue"
title="link to this section">8.1.1.3.1</a></span> BindThisValue(V)</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the function <a href="#sec-environment-records">Environment Record</a> for which the method
was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i>.[[thisBindingStatus]] is not
<code>"lexical"</code>.</li>
<li>If <i>envRec</i>.[[thisBindingStatus]] is <code>"initialized"</code>, throw a <b>ReferenceError</b>
exception.</li>
<li>Set <i>envRec</i>.[[thisValue]] to <i>V</i>.</li>
<li>Set <i>envRec</i>.[[thisBindingStatus]] to <code>"initialized"</code>.</li>
<li>Return <i>V</i>.</li>
</ol>
</section>
<section id="sec-function-environment-records-hasthisbinding">
<h1><span class="secnum" id="sec-8.1.1.3.2"><a href="#sec-function-environment-records-hasthisbinding"
title="link to this section">8.1.1.3.2</a></span> HasThisBinding ()</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the function <a href="#sec-environment-records">Environment Record</a> for which the method
was invoked.</li>
<li>If <i>envRec</i>.[[thisBindingStatus]] is <code>"lexical"</code>, return <b>false</b>; otherwise, return
<b>true</b>.</li>
</ol>
</section>
<section id="sec-function-environment-records-hassuperbinding">
<h1><span class="secnum" id="sec-8.1.1.3.3"><a href="#sec-function-environment-records-hassuperbinding"
title="link to this section">8.1.1.3.3</a></span> HasSuperBinding ()</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the function <a href="#sec-environment-records">Environment Record</a> for which the method
was invoked.</li>
<li>If <i>envRec</i>.[[thisBindingStatus]] is <code>"lexical"</code>, return <b>false</b>.</li>
<li>If <i>envRec</i>.[[HomeObject]] has the value <b>undefined</b>, return <b>false</b>, otherwise, return
<b>true</b>.</li>
</ol>
</section>
<section id="sec-function-environment-records-getthisbinding">
<h1><span class="secnum" id="sec-8.1.1.3.4"><a href="#sec-function-environment-records-getthisbinding"
title="link to this section">8.1.1.3.4</a></span> GetThisBinding ()</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the function <a href="#sec-environment-records">Environment Record</a> for which the method
was invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i>.[[thisBindingStatus]] is not
<code>"lexical"</code>.</li>
<li>If <i>envRec</i>.[[thisBindingStatus]] is <code>"uninitialized"</code>, throw a <b>ReferenceError</b>
exception.</li>
<li>Return <i>envRec</i>.[[thisValue]].</li>
</ol>
</section>
<section id="sec-getsuperbase">
<h1><span class="secnum" id="sec-8.1.1.3.5"><a href="#sec-getsuperbase"
title="link to this section">8.1.1.3.5</a></span> GetSuperBase ()</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the function <a href="#sec-environment-records">Environment Record</a> for which the method
was invoked.</li>
<li>Let <i>home</i> be the value of <i>envRec</i>.[[HomeObject]].</li>
<li>If <i>home</i> has the value <b>undefined</b>, return <b>undefined</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>home</i>) is Object.</li>
<li>Return <i>home.</i>[[GetPrototypeOf]]().</li>
</ol>
</section>
</section>
<section id="sec-global-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1.4"><a href="#sec-global-environment-records"
title="link to this section">8.1.1.4</a></span> Global Environment Records</h1>
<p>A global <a href="#sec-environment-records">Environment Record</a> is used to represent the outer most scope that is
shared by all of the ECMAScript <span class="nt">Script</span> elements that are processed in a common <a
href="#sec-code-realms">Realm</a> (<a href="#sec-code-realms">8.2</a>). A global <a
href="#sec-environment-records">Environment Record</a> provides the bindings for built-in globals (<a
href="#sec-global-object">clause 18</a>), properties of the global object, and for all top-level declarations (<a
href="#sec-block-static-semantics-toplevellexicallyscopeddeclarations">13.1.8</a>, <a
href="#sec-block-static-semantics-toplevelvarscopeddeclarations">13.1.10</a>) that occur within a <span
class="nt">Script</span>.</p>
<p>A global <a href="#sec-environment-records">Environment Record</a> is logically a single record but it is specified
as a composite encapsulating an object <a href="#sec-environment-records">Environment Record</a> and a declarative <a
href="#sec-environment-records">Environment Record</a>. The object <a href="#sec-environment-records">Environment
Record</a> has as its base object the global object of the associated <a href="#sec-code-realms">Realm</a>. This global
object is the value returned by the global <a href="#sec-environment-records">Environment Record</a>’s
GetThisBinding concrete method. The object <a href="#sec-environment-records">Environment Record</a> component of a
global <a href="#sec-environment-records">Environment Record</a> contains the bindings for all built-in globals (<a
href="#sec-global-object">clause 18</a>) and all bindings introduced by a <span style="font-family: Times New
Roman"><i>FunctionDeclaration</i>, <i>GeneratorDeclaration</i></span>, or <span class="nt">VariableStatement</span>
contained in global code. The bindings for all other ECMAScript declarations in global code are contained in the
declarative <a href="#sec-environment-records">Environment Record</a> component of the global <a
href="#sec-environment-records">Environment Record</a>.</p>
<p>Properties may be created directly on a global object. Hence, the object <a
href="#sec-environment-records">Environment Record</a> component of a global <a
href="#sec-environment-records">Environment Record</a> may contain both bindings created explicitly by <span
style="font-family: Times New Roman"><i>FunctionDeclaration</i>, <i>GeneratorDeclaration</i></span>, or <span
class="nt">VariableDeclaration</span> declarations and binding created implicitly as properties of the global object. In
order to identify which bindings were explicitly created using declarations, a global <a
href="#sec-environment-records">Environment Record</a> maintains a list of the names bound using its
CreateGlobalVarBindings and CreateGlobalFunctionBindings concrete methods.</p>
<p>Global Environment Records have the additional fields listed in <a href="#table-18">Table 18</a> and the additional
methods listed in <a href="#table-19">Table 19</a>.</p>
<figure>
<figcaption><span id="table-18">Table 18</span> — Additional Fields of Global Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[ObjectRecord]]</td>
<td><a href="#sec-object-environment-records">Object Environment Record</a></td>
<td>Binding object is the global object. It contains global built-in bindings as well as <span style="font-family: Times New Roman"><i>FunctionDeclaration</i>, <i>GeneratorDeclaration</i></span>, and <span class="nt">VariableDeclaration</span> bindings in global code for the associated <a href="#sec-code-realms">Realm</a>.</td>
</tr>
<tr>
<td>[[DeclarativeRecord]]</td>
<td><a href="#sec-declarative-environment-records">Declarative Environment Record</a></td>
<td>Contains bindings for all declarations in global code for the associated <a href="#sec-code-realms">Realm</a> code except for <span style="font-family: Times New Roman"><i>FunctionDeclaration</i>, <i>GeneratorDeclaration</i></span>, and <span class="nt">VariableDeclaration</span> <var>bindings</var>.</td>
</tr>
<tr>
<td>[[VarNames]]</td>
<td><a href="#sec-list-and-record-specification-type">List</a> of String</td>
<td>The string names bound by <span style="font-family: Times New Roman"><i>FunctionDeclaration</i>, <i>GeneratorDeclaration</i></span>, and <span class="nt">VariableDeclaration</span> declarations in global code for the associated <a href="#sec-code-realms">Realm</a>.</td>
</tr>
</table>
</figure>
<figure>
<figcaption><span id="table-19">Table 19</span> — Additional Methods of Global Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Method</th>
<th>Purpose</th>
</tr>
<tr>
<td>GetThisBinding()</td>
<td>Return the value of this <a href="#sec-environment-records">Environment Record</a>’s <code>this</code> binding.</td>
</tr>
<tr>
<td><a href="#sec-hasvardeclaration">HasVarDeclaration</a> (N)</td>
<td>Determines if the argument identifier has a binding in this <a href="#sec-environment-records">Environment Record</a> that was created using a <span style="font-family: Times New Roman"><i>VariableDeclaration</i>,</span> <span class="nt">FunctionDeclaration</span>, or <span style="font-family: Times New Roman"><i>GeneratorDeclaration</i>.</span></td>
</tr>
<tr>
<td><a href="#sec-haslexicaldeclaration">HasLexicalDeclaration</a> (N)</td>
<td>Determines if the argument identifier has a binding in this <a href="#sec-environment-records">Environment Record</a> that was created using a lexical declaration such as a <span class="nt">LexicalDeclaration</span> or a <span class="nt">ClassDeclaration</span>.</td>
</tr>
<tr>
<td><a href="#sec-hasrestrictedglobalproperty">HasRestrictedGlobalProperty</a> (N)</td>
<td>Determines if the argument is the name of a global object property that may not be shadowed by a global lexically binding.</td>
</tr>
<tr>
<td><a href="#sec-candeclareglobalvar">CanDeclareGlobalVar</a> (N)</td>
<td>Determines if a corresponding <a href="#sec-createglobalvarbinding">CreateGlobalVarBinding</a> call would succeed if called for the same argument <var>N</var>.</td>
</tr>
<tr>
<td><a href="#sec-candeclareglobalfunction">CanDeclareGlobalFunction</a> (N)</td>
<td>Determines if a corresponding <a href="#sec-createglobalfunctionbinding">CreateGlobalFunctionBinding</a> call would succeed if called for the same argument <var>N</var>.</td>
</tr>
<tr>
<td><a href="#sec-createglobalvarbinding">CreateGlobalVarBinding</a>(N, D)</td>
<td>Used to create and initialize to <b>undefined</b> a global <code>var</code> binding in the [[ObjectRecord]] component of a global <a href="#sec-environment-records">Environment Record</a>. The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a <code>var</code>. The String value <var>N</var> is the bound name. If <var>D</var> is <b>true</b> the binding may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows var declarations to receive special treatment.</td>
</tr>
<tr>
<td><a href="#sec-createglobalfunctionbinding">CreateGlobalFunctionBinding</a>(N, V, D)</td>
<td>Create and initialize a global <code>function</code> binding in the [[ObjectRecord]] component of a global <a href="#sec-environment-records">Environment Record</a>. The binding will be a mutable binding. The corresponding global object property will have attribute values appropriate for a <code>function</code>. The String value <var>N</var> is the bound name. <i>V</i> is the initialization value. If the optional Boolean argument <var>D</var> is <b>true</b> the binding is may be deleted. Logically equivalent to CreateMutableBinding followed by a SetMutableBinding but it allows function declarations to receive special treatment.</td>
</tr>
</table>
</figure>
<p>The behaviour of the concrete specification methods for global Environment Records is defined by the following
algorithms.</p>
</div>
<section id="sec-global-environment-records-hasbinding-n">
<h1><span class="secnum" id="sec-8.1.1.4.1"><a href="#sec-global-environment-records-hasbinding-n"
title="link to this section">8.1.1.4.1</a></span> HasBinding(N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasBinding for global Environment
Records simply determines if the argument identifier is one of the identifiers bound by the record:</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec.</i>HasBinding(<i>N</i>) is <b>true</b>, return <b>true</b>.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Return <i>ObjRec.</i>HasBinding(<i>N</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-createmutablebinding-n-d">
<h1><span class="secnum" id="sec-8.1.1.4.2"><a href="#sec-global-environment-records-createmutablebinding-n-d"
title="link to this section">8.1.1.4.2</a></span> CreateMutableBinding (N, D)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateMutableBinding for global
Environment Records creates a new mutable binding for the name <var>N</var> that is uninitialized. The binding is
created in the associated DeclarativeRecord. A binding for <var>N</var> must not already exist in the DeclarativeRecord.
If Boolean argument <var>D</var> is provided and has the value <b>true</b> the new binding is marked as being subject to
deletion.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec</i>.HasBinding(<i>N</i>) is <b>true</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>DclRec</i>.CreateMutableBinding(<i>N</i>, <i>D</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-createimmutablebinding-n-s">
<h1><span class="secnum" id="sec-8.1.1.4.3"><a href="#sec-global-environment-records-createimmutablebinding-n-s"
title="link to this section">8.1.1.4.3</a></span> CreateImmutableBinding (N, S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateImmutableBinding for global
Environment Records creates a new immutable binding for the name <var>N</var> that is uninitialized. A binding must not
already exist in this <a href="#sec-environment-records">Environment Record</a> for <var>N</var>. If Boolean argument
<var>S</var> is provided and has the value <b>true</b> the new binding is marked as a strict binding.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec</i>.HasBinding(<i>N</i>) is <b>true</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>DclRec</i>.CreateImmutableBinding(<i>N</i>, <i>S</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-initializebinding-n-v">
<h1><span class="secnum" id="sec-8.1.1.4.4"><a href="#sec-global-environment-records-initializebinding-n-v"
title="link to this section">8.1.1.4.4</a></span> InitializeBinding (N,V)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method InitializeBinding for global
Environment Records is used to set the bound value of the current binding of the identifier whose name is the value of
the argument <var>N</var> to the value of argument <var>V</var>. An uninitialized binding for <var>N</var> must already
exist.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec.</i>HasBinding(<i>N</i>) is <b>true</b>, then
<ol class="block">
<li>Return <i>DclRec</i>.InitializeBinding(<i>N</i>, <i>V</i>).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: If the binding exists it must be in the object <a
href="#sec-environment-records">Environment Record</a>.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Return <i>ObjRec.</i>InitializeBinding(<i>N</i>, <i>V</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-setmutablebinding-n-v-s">
<h1><span class="secnum" id="sec-8.1.1.4.5"><a href="#sec-global-environment-records-setmutablebinding-n-v-s"
title="link to this section">8.1.1.4.5</a></span> SetMutableBinding (N,V,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method SetMutableBinding for global
Environment Records attempts to change the bound value of the current binding of the identifier whose name is the value
of the argument <var>N</var> to the value of argument <var>V</var>. If the binding is an immutable binding, a
<b>TypeError</b> is thrown if <span style="font-family: Times New Roman">S</span> is <span class="value">true</span>. A
property named <var>N</var> normally already exists but if it does not or is not currently writable, error handling is
determined by the value of the Boolean argument <var>S</var>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec.</i>HasBinding(<i>N</i>) is <b>true</b>, then
<ol class="block">
<li>Return <i>DclRec.</i>SetMutableBinding(<i>N</i>, <i>V</i>, <i>S</i>).</li>
</ol>
</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Return <i>ObjRec</i>.SetMutableBinding(<i>N</i>, <i>V</i>, <i>S</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-getbindingvalue-n-s">
<h1><span class="secnum" id="sec-8.1.1.4.6"><a href="#sec-global-environment-records-getbindingvalue-n-s"
title="link to this section">8.1.1.4.6</a></span> GetBindingValue(N,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method GetBindingValue for global Environment
Records returns the value of its bound identifier whose name is the value of the argument <var>N</var>. If the binding
is an uninitialized binding throw a <b>ReferenceError</b> exception. A property named <var>N</var> normally already
exists but if it does not or is not currently writable, error handling is determined by the value of the Boolean
argument <var>S</var>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec.</i>HasBinding(<i>N</i>) is <b>true</b>, then
<ol class="block">
<li>Return <i>DclRec.</i>GetBindingValue(<i>N</i>, <i>S</i>).</li>
</ol>
</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Return <i>ObjRec</i>.GetBindingValue(<i>N</i>, <i>S</i>).</li>
</ol>
</section>
<section id="sec-global-environment-records-deletebinding-n">
<h1><span class="secnum" id="sec-8.1.1.4.7"><a href="#sec-global-environment-records-deletebinding-n"
title="link to this section">8.1.1.4.7</a></span> DeleteBinding (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method DeleteBinding for global Environment
Records can only delete bindings that have been explicitly designated as being subject to deletion.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>If <i>DclRec.</i>HasBinding(<i>N</i>) is <b>true</b>, then
<ol class="block">
<li>Return <i>DclRec.</i>DeleteBinding(<i>N</i>).</li>
</ol>
</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>existingProp</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>globalObject</i>, <i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>existingProp</i>).</li>
<li>If <i>existingProp</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>ObjRec.</i>DeleteBinding(<i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>If <i>status</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>varNames</i> be <i>envRec</i>.[[VarNames]].</li>
<li>If <i>N</i> is an element of <i>varNames</i>, remove that element from the <i>varNames</i>.</li>
</ol>
</li>
<li>Return <i>status</i>.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-global-environment-records-hasthisbinding">
<h1><span class="secnum" id="sec-8.1.1.4.8"><a href="#sec-global-environment-records-hasthisbinding"
title="link to this section">8.1.1.4.8</a></span> HasThisBinding ()</h1>
<p><a href="#sec-global-environment-records">Global Environment Records</a> always provide a <code>this</code> binding
whose value is the associated global object.</p>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-global-environment-records-hassuperbinding">
<h1><span class="secnum" id="sec-8.1.1.4.9"><a href="#sec-global-environment-records-hassuperbinding"
title="link to this section">8.1.1.4.9</a></span> HasSuperBinding ()</h1>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-global-environment-records-withbaseobject">
<h1><span class="secnum" id="sec-8.1.1.4.10"><a href="#sec-global-environment-records-withbaseobject"
title="link to this section">8.1.1.4.10</a></span> WithBaseObject()</h1>
<p><a href="#sec-global-environment-records">Global Environment Records</a> always return <b>undefined</b> as their
WithBaseObject.</p>
<ol class="proc">
<li>Return <b>undefined</b>.</li>
</ol>
</section>
<section id="sec-global-environment-records-getthisbinding">
<h1><span class="secnum" id="sec-8.1.1.4.11"><a href="#sec-global-environment-records-getthisbinding"
title="link to this section">8.1.1.4.11</a></span> GetThisBinding ()</h1>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>bindings</i> be the binding object for <i>ObjRec</i>.</li>
<li>Return <i>bindings</i>.</li>
</ol>
</section>
<section id="sec-hasvardeclaration">
<h1><span class="secnum" id="sec-8.1.1.4.12"><a href="#sec-hasvardeclaration"
title="link to this section">8.1.1.4.12</a></span> HasVarDeclaration (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasVarDeclaration for global
Environment Records determines if the argument identifier has a binding in this record that was created using a <span
class="nt">VariableStatement</span> or a <span class="prod"><span class="nt">FunctionDeclaration</span> <span
class="geq">:</span></span></p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>varDeclaredNames</i> be <i>envRec</i>.[[VarNames]].</li>
<li>If <i>varDeclaredNames</i> contains the value of <i>N</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-haslexicaldeclaration">
<h1><span class="secnum" id="sec-8.1.1.4.13"><a href="#sec-haslexicaldeclaration"
title="link to this section">8.1.1.4.13</a></span> HasLexicalDeclaration (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasLexicalDeclaration for global
Environment Records determines if the argument identifier has a binding in this record that was created using a lexical
declaration such as a <span class="nt">LexicalDeclaration</span> or a <span class="prod"><span
class="nt">ClassDeclaration</span> <span class="geq">:</span></span></p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>DclRec</i> be <i>envRec</i>.[[DeclarativeRecord]].</li>
<li>Return <i>DclRec.</i>HasBinding(<i>N</i>).</li>
</ol>
</section>
<section id="sec-hasrestrictedglobalproperty">
<h1><span class="secnum" id="sec-8.1.1.4.14"><a href="#sec-hasrestrictedglobalproperty"
title="link to this section">8.1.1.4.14</a></span> HasRestrictedGlobalProperty (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method HasRestrictedGlobalProperty for global
Environment Records determines if the argument identifier is the name of a property of the global object that must not
be shadowed by a global lexically binding:</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>existingProp</i> be <i>globalObject</i>.[[GetOwnProperty]](<i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>existingProp</i>).</li>
<li>If <i>existingProp</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>If <i>existingProp</i>.[[Configurable]] is <b>true</b>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Properties may exist upon a global object that were directly created rather than being
declared using a var or function declaration. A global lexical binding may not be created that has the same name as a
non-configurable property of the global object. The global property <code>undefined</code> is an example of such a
property.</p>
</div>
</section>
<section id="sec-candeclareglobalvar">
<h1><span class="secnum" id="sec-8.1.1.4.15"><a href="#sec-candeclareglobalvar"
title="link to this section">8.1.1.4.15</a></span> CanDeclareGlobalVar (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CanDeclareGlobalVar for global
Environment Records determines if a corresponding <a href="#sec-createglobalvarbinding">CreateGlobalVarBinding</a> call
would succeed if called for the same argument <var>N</var>. Redundant var declarations and var declarations for
pre-existing global object properties are allowed.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>hasProperty</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>globalObject, N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>hasProperty</i>).</li>
<li>If <i>hasProperty</i> is <b>true</b>, return <b>true</b>.</li>
<li>Return <a href="#sec-isextensible-o">IsExtensible</a>(<i>globalObject</i>).</li>
</ol>
</section>
<section id="sec-candeclareglobalfunction">
<h1><span class="secnum" id="sec-8.1.1.4.16"><a href="#sec-candeclareglobalfunction"
title="link to this section">8.1.1.4.16</a></span> CanDeclareGlobalFunction (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CanDeclareGlobalFunction for global
Environment Records determines if a corresponding <a
href="#sec-createglobalfunctionbinding">CreateGlobalFunctionBinding</a> call would succeed if called for the same
argument <var>N</var>.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>existingProp</i> be <i>globalObject</i>.[[GetOwnProperty]](<i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>existingProp</i>).</li>
<li>If <i>existingProp</i> is <b>undefined</b>, return <a
href="#sec-isextensible-o">IsExtensible</a>(<i>globalObject</i>).</li>
<li>If <i>existingProp</i>.[[Configurable]] is <b>true</b>, return <b>true</b>.</li>
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>existingProp</i>) is <b>true</b> and
<i>existingProp</i> has attribute values {[[Writable]]: <b>true</b>, [[Enumerable]]: <b>true</b>}, return
<b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-createglobalvarbinding">
<h1><span class="secnum" id="sec-8.1.1.4.17"><a href="#sec-createglobalvarbinding"
title="link to this section">8.1.1.4.17</a></span> CreateGlobalVarBinding (N, D)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateGlobalVarBinding for global
Environment Records creates and initializes a mutable binding in the associated object Environment Record and records
the bound name in the associated [[VarNames]] <a href="#sec-list-and-record-specification-type">List</a>. If a binding
already exists, it is reused and assumed to be initialized.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>hasProperty</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>globalObject, N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>hasProperty</i>).</li>
<li>Let <i>extensible</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>globalObject</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensible</i>).</li>
<li>If <i>hasProperty</i> is <b>false</b> and <i>extensible</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>ObjRec.</i>CreateMutableBinding(<i>N</i>, <i>D</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Let <i>status</i> be <i>ObjRec.</i>InitializeBinding(<i>N</i>, <b>undefined</b>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
</ol>
</li>
<li>Let <i>varDeclaredNames</i> be <i>envRec</i>.[[VarNames]].</li>
<li>If <i>varDeclaredNames</i> does not contain the value of <i>N</i>, then
<ol class="block">
<li>Append <i>N</i> to <i>varDeclaredNames</i>.</li>
</ol>
</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</section>
<section id="sec-createglobalfunctionbinding">
<h1><span class="secnum" id="sec-8.1.1.4.18"><a href="#sec-createglobalfunctionbinding"
title="link to this section">8.1.1.4.18</a></span> CreateGlobalFunctionBinding (N, V, D)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateGlobalFunctionBinding for global
Environment Records creates and initializes a mutable binding in the associated object Environment Record and records
the bound name in the associated [[VarNames]] <a href="#sec-list-and-record-specification-type">List</a>. If a binding
already exists, it is replaced.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the global <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>Let <i>ObjRec</i> be <i>envRec</i>.[[ObjectRecord]].</li>
<li>Let <i>globalObject</i> be the binding object for <i>ObjRec</i>.</li>
<li>Let <i>existingProp</i> be <i>globalObject</i>.[[GetOwnProperty]](<i>N</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>existingProp</i>).</li>
<li>If <i>existingProp</i> is <b>undefined</b> or <i>existingProp</i>.[[Configurable]] is <b>true</b>, then
<ol class="block">
<li>Let <i>desc</i> be the PropertyDescriptor{[[Value]]:<i>V</i>, [[Writable]]: <b>true</b>, [[Enumerable]]:
<b>true</b> , [[Configurable]]: <i>D</i>}.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>desc</i> be the PropertyDescriptor{[[Value]]:<i>V</i> }.</li>
</ol>
</li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>globalObject</i>, <i>N</i>,
<i>desc</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Let <i>status</i> be <a href="#sec-set-o-p-v-throw">Set</a>(<i>globalObject</i>, <i>N</i>, <i>V</i>,
<b>false</b>).</li>
<li>Record that the binding for <i>N</i> in <i>ObjRec</i> has been initialized.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Let <i>varDeclaredNames</i> be <i>envRec</i>.[[VarNames]].</li>
<li>If <i>varDeclaredNames</i> does not contain the value of <i>N</i>, then
<ol class="block">
<li>Append <i>N</i> to <i>varDeclaredNames</i>.</li>
</ol>
</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Global function declarations are always represented as own properties of the global
object. If possible, an existing own property is reconfigured to have a standard set of attribute values. Steps 10-12
are equivalent to what calling the InitializeBinding concrete method would do and if <i>globalObject</i> is a Proxy
will produce the same sequence of Proxy trap calls.</p>
</div>
</section>
</section>
<section id="sec-module-environment-records">
<div class="front">
<h1><span class="secnum" id="sec-8.1.1.5"><a href="#sec-module-environment-records"
title="link to this section">8.1.1.5</a></span> Module Environment Records</h1>
<p>A module <a href="#sec-environment-records">Environment Record</a> is a declarative <a
href="#sec-environment-records">Environment Record</a> that is used to represent the outer scope of an ECMAScript <span
class="nt">Module</span>. In additional to normal mutable and immutable bindings, module Environment Records also
provide immutable import bindings which are bindings that provide indirect access to a target binding that exists in
another Environment Record.</p>
<p>Module Environment Records support all of the declarative Environment Record methods listed in <a
href="#table-15">Table 15</a> and share the same specifications for all of those methods except for GetBindingValue,
DeleteBinding, HasThisBinding and GetThisBinding. In addition, module Environment Records support the methods listed in
<a href="#table-20">Table 20</a>:</p>
<figure>
<figcaption><span id="table-20">Table 20</span> — Additional Methods of Module Environment Records</figcaption>
<table class="real-table">
<tr>
<th>Method</th>
<th>Purpose</th>
</tr>
<tr>
<td><a href="#sec-createimportbinding">CreateImportBinding</a>(N, M, N2 )</td>
<td>Create an immutable indirect binding in a module <a href="#sec-environment-records">Environment Record</a>. The String value <var>N</var> is the text of the bound name. <var>M</var> is a Module Record (<a href="#sec-abstract-module-records">see 15.2.1.14</a>), and <var>N2</var> is a binding that exists in M’s module <a href="#sec-environment-records">Environment Record</a>.</td>
</tr>
<tr>
<td>GetThisBinding()</td>
<td>Return the value of this <a href="#sec-environment-records">Environment Record</a>’s <code>this</code> binding.</td>
</tr>
</table>
</figure>
<p>The behaviour of the additional concrete specification methods for module Environment Records are defined by the
following algorithms:</p>
</div>
<section id="sec-module-environment-records-getbindingvalue-n-s">
<h1><span class="secnum" id="sec-8.1.1.5.1"><a href="#sec-module-environment-records-getbindingvalue-n-s"
title="link to this section">8.1.1.5.1</a></span> GetBindingValue(N,S)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method GetBindingValue for module Environment
Records returns the value of its bound identifier whose name is the value of the argument <var>N</var>. However, if the
binding is an indirect binding the value of the target binding is returned. If the binding exists but is uninitialized a
<span class="value">ReferenceError</span> is thrown, regardless of the value of <i><span style="font-family: Times New
Roman">S</span>.</i></p>
<ol class="proc">
<li>Let <i>envRec</i> be the module <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> has a binding for <i>N</i>.</li>
<li>If the binding for <i>N</i> is an indirect binding, then
<ol class="block">
<li>Let <i>M</i> and <i>N2</i> be the indirection values provided when this binding for <i>N</i> was created.</li>
<li>If <i>M</i> is <b>undefined</b>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>targetEnv</i> be <i>M</i>.[[Environment]].</li>
<li>If <i>targetEnv</i> is <b>undefined</b>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>targetER</i> be <i>targetEnv</i>’s EnvironmentRecord.</li>
<li>Return <i>targetER</i>.GetBindingValue(<i>N2</i>, <i>S</i>).</li>
</ol>
</li>
<li>If the binding for <i>N</i> in <i>envRec</i> is an uninitialized binding, throw a <b>ReferenceError</b>
exception.</li>
<li>Return the value currently bound to <i>N</i> in <i>envRec</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Because a <i>Module</i> is always <a href="#sec-strict-mode-code">strict mode
code</a>, calls to GetBindingValue should always pass <b>true</b> <span style="font-family: sans-serif">as</span>
<span style="font-family: sans-serif">the value of</span> <i>S</i>.</p>
</div>
</section>
<section id="sec-module-environment-records-deletebinding-n">
<h1><span class="secnum" id="sec-8.1.1.5.2"><a href="#sec-module-environment-records-deletebinding-n"
title="link to this section">8.1.1.5.2</a></span> DeleteBinding (N)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method DeleteBinding for module Environment
Records refuses to delete bindings.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the module <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li>If <i>envRec</i> does not have a binding for the name that is the value of <i>N</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Because the bindings of a module <a href="#sec-environment-records">Environment
Record</a> are not deletable.</p>
</div>
</section>
<section id="sec-module-environment-records-hasthisbinding">
<h1><span class="secnum" id="sec-8.1.1.5.3"><a href="#sec-module-environment-records-hasthisbinding"
title="link to this section">8.1.1.5.3</a></span> HasThisBinding ()</h1>
<p>Module Environment Records provide a <code>this</code> binding.</p>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-module-environment-records-getthisbinding">
<h1><span class="secnum" id="sec-8.1.1.5.4"><a href="#sec-module-environment-records-getthisbinding"
title="link to this section">8.1.1.5.4</a></span> GetThisBinding ()</h1>
<ol class="proc">
<li>Return <b>undefined</b>.</li>
</ol>
</section>
<section id="sec-createimportbinding">
<h1><span class="secnum" id="sec-8.1.1.5.5"><a href="#sec-createimportbinding"
title="link to this section">8.1.1.5.5</a></span> CreateImportBinding (N, M, N2)</h1>
<p>The concrete <a href="#sec-environment-records">Environment Record</a> method CreateImportBinding for module
Environment Records creates a new initialized immutable indirect binding for the name <var>N</var>. A binding must not
already exist in this <a href="#sec-environment-records">Environment Record</a> for <var>N</var>. <var>M</var> is a
Module Record (<a href="#sec-abstract-module-records">see 15.2.1.14</a>), and <var>N2</var> is the name of a binding
that exists in M’s module <a href="#sec-environment-records">Environment Record</a>. Accesses to the value of the
new binding will indirectly access the bound value of value of the target binding.</p>
<ol class="proc">
<li>Let <i>envRec</i> be the module <a href="#sec-environment-records">Environment Record</a> for which the method was
invoked.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> does not already have a binding for <i>N</i>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>M</i> is a Module Record.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: When <i>M</i>.[[Environment]] is instantiated it will have a
direct binding for <i>N2</i>.</li>
<li>Create an immutable indirect binding in <i>envRec</i> for <i>N</i> that references <i>M</i> and <i>N2</i> as its
target binding and record that the binding is initialized.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family:
sans-serif">empty</span>).</li>
</ol>
</section>
</section>
</section>
<section id="sec-lexical-environment-operations">
<div class="front">
<h1><span class="secnum" id="sec-8.1.2"><a href="#sec-lexical-environment-operations"
title="link to this section">8.1.2</a></span> Lexical Environment Operations</h1>
<p>The following abstract operations are used in this specification to operate upon lexical environments:</p>
</div>
<section id="sec-getidentifierreference">
<h1><span class="secnum" id="sec-8.1.2.1"><a href="#sec-getidentifierreference"
title="link to this section">8.1.2.1</a></span> GetIdentifierReference (lex, name, strict)</h1>
<p>The abstract operation GetIdentifierReference is called with a <a href="#sec-lexical-environments">Lexical
Environment</a> <var>lex</var>, a String <var>name</var>, and a Boolean flag <var>strict.</var> The value of
<var>lex</var> may be <b>null</b>. When called, the following steps are performed:</p>
<ol class="proc">
<li>If <i>lex</i> is the value <b>null</b>, then
<ol class="block">
<li>Return a value of type <a href="#sec-reference-specification-type">Reference</a> whose base value is
<b>undefined</b>, whose referenced name is <i>name</i>, and whose strict reference flag is <i>strict</i>.</li>
</ol>
</li>
<li>Let <i>envRec</i> be <i>lex</i>’s EnvironmentRecord.</li>
<li>Let <i>exists</i> be <i>envRec</i>.HasBinding(<i>name</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>exists</i>).</li>
<li>If <i>exists</i> is <b>true</b>, then
<ol class="block">
<li>Return a value of type <a href="#sec-reference-specification-type">Reference</a> whose base value is
<i>envRec</i>, whose referenced name is <i>name</i>, and whose strict reference flag is <i>strict.</i></li>
</ol>
</li>
<li>Else
<ol class="block">
<li>Let <i>outer</i> be the value of <i>lex’s</i> <a href="#sec-lexical-environments">outer environment
reference</a>.</li>
<li>Return GetIdentifierReference(<i>outer</i>, <i>name</i>, <i>strict</i>).</li>
</ol>
</li>
</ol>
</section>
<section id="sec-newdeclarativeenvironment">
<h1><span class="secnum" id="sec-8.1.2.2"><a href="#sec-newdeclarativeenvironment"
title="link to this section">8.1.2.2</a></span> NewDeclarativeEnvironment (E)</h1>
<p>When the abstract operation NewDeclarativeEnvironment is called with a <a href="#sec-lexical-environments">Lexical
Environment</a> as argument <var>E</var> the following steps are performed:</p>
<ol class="proc">
<li>Let <i>env</i> be a new <a href="#sec-lexical-environments">Lexical Environment</a>.</li>
<li>Let <i>envRec</i> be a new declarative <a href="#sec-environment-records">Environment Record</a> containing no
bindings.</li>
<li>Set <i>env’s</i> EnvironmentRecord to be <i>envRec</i>.</li>
<li>Set the <a href="#sec-lexical-environments">outer lexical environment reference</a> of <i>env</i> to <i>E</i>.</li>
<li>Return <i>env</i>.</li>
</ol>
</section>
<section id="sec-newobjectenvironment">
<h1><span class="secnum" id="sec-8.1.2.3"><a href="#sec-newobjectenvironment"
title="link to this section">8.1.2.3</a></span> NewObjectEnvironment (O, E)</h1>
<p>When the abstract operation NewObjectEnvironment is called with an Object <var>O</var> and a <a
href="#sec-lexical-environments">Lexical Environment</a> <var>E</var> as arguments, the following steps are performed:</p>
<ol class="proc">
<li>Let <i>env</i> be a new <a href="#sec-lexical-environments">Lexical Environment</a>.</li>
<li>Let <i>envRec</i> be a new object <a href="#sec-environment-records">Environment Record</a> containing <i>O</i> as
the binding object.</li>
<li>Set <i>env’s</i> EnvironmentRecord to <i>envRec</i>.</li>
<li>Set the <a href="#sec-lexical-environments">outer lexical environment reference</a> of <i>env</i> to <i>E</i>.</li>
<li>Return <i>env</i>.</li>
</ol>
</section>
<section id="sec-newfunctionenvironment">
<h1><span class="secnum" id="sec-8.1.2.4"><a href="#sec-newfunctionenvironment"
title="link to this section">8.1.2.4</a></span> NewFunctionEnvironment ( F, newTarget )</h1>
<p>When the abstract operation NewFunctionEnvironment is called with arguments <var>F</var> and <var>newTarget</var> the
following steps are performed:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an ECMAScript function.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>newTarget</i>) is Undefined or Object.</li>
<li>Let <i>env</i> be a new <a href="#sec-lexical-environments">Lexical Environment</a>.</li>
<li>Let <i>envRec</i> be a new function <a href="#sec-environment-records">Environment Record</a> containing no
bindings.</li>
<li>Set <i>envRec</i>.[[FunctionObject]] to <i>F</i>.</li>
<li>If <i>F’s</i> [[ThisMode]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is
<span style="font-family: sans-serif">lexical</span>, set <i>envRec</i>.[[thisBindingStatus]] to
<code>"lexical"</code>.</li>
<li>Else, Set <i>envRec</i>.[[thisBindingStatus]] to <code>"uninitialized"</code>.</li>
<li>Let <i>home</i> be the value of <i>F’s</i> [[HomeObject]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Set <i>envRec</i>.[[HomeObject]] to <i>home</i>.</li>
<li>Set <i>envRec</i>.[[NewTarget]] to <i>newTarget</i>.</li>
<li>Set <i>env’s</i> EnvironmentRecord to be <i>envRec</i>.</li>
<li>Set the <a href="#sec-lexical-environments">outer lexical environment reference</a> of <i>env</i> to the value of
<i>F’s</i> [[Environment]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Return <i>env</i>.</li>
</ol>
</section>
<section id="sec-newglobalenvironment">
<h1><span class="secnum" id="sec-8.1.2.5"><a href="#sec-newglobalenvironment"
title="link to this section">8.1.2.5</a></span> NewGlobalEnvironment ( G )</h1>
<p>When the abstract operation NewGlobalEnvironment is called with an ECMAScript Object <var>G</var> as its argument, the
following steps are performed:</p>
<ol class="proc">
<li>Let <i>env</i> be a new <a href="#sec-lexical-environments">Lexical Environment</a>.</li>
<li>Let <i>objRec</i> be a new object <a href="#sec-environment-records">Environment Record</a> containing <i>G</i> as
the binding object.</li>
<li>Let <i>dclRec</i> be a new declarative <a href="#sec-environment-records">Environment Record</a> containing no
bindings.</li>
<li>Let <i>globalRec</i> be a new global <a href="#sec-environment-records">Environment Record</a>.</li>
<li>Set <i>globalRec</i>.[[ObjectRecord]] to <i>objRec</i>.</li>
<li>Set <i>globalRec</i>.[[DeclarativeRecord]] to <i>dclRec</i>.</li>
<li>Set <i>globalRec</i>.[[VarNames]] to a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Set <i>env’s</i> EnvironmentRecord to <i>globalRec</i>.</li>
<li>Set the <a href="#sec-lexical-environments">outer lexical environment reference</a> of <i>env</i> to
<b>null</b></li>
<li>Return <i>env</i>.</li>
</ol>
</section>
<section id="sec-newmoduleenvironment">
<h1><span class="secnum" id="sec-8.1.2.6"><a href="#sec-newmoduleenvironment"
title="link to this section">8.1.2.6</a></span> NewModuleEnvironment (E)</h1>
<p>When the abstract operation NewModuleEnvironment is called with a <a href="#sec-lexical-environments">Lexical
Environment</a> argument <var>E</var> the following steps are performed:</p>
<ol class="proc">
<li>Let <i>env</i> be a new <a href="#sec-lexical-environments">Lexical Environment</a>.</li>
<li>Let <i>envRec</i> be a new module <a href="#sec-environment-records">Environment Record</a> containing no
bindings.</li>
<li>Set <i>env’s</i> EnvironmentRecord to be <i>envRec</i>.</li>
<li>Set the <a href="#sec-lexical-environments">outer lexical environment reference</a> of <i>env</i> to <i>E</i>.</li>
<li>Return <i>env</i>.</li>
</ol>
</section>
</section>
</section>
<section id="sec-code-realms">
<div class="front">
<h1><span class="secnum" id="sec-8.2"><a href="#sec-code-realms" title="link to this section">8.2</a></span> Code
Realms</h1>
<p>Before it is evaluated, all ECMAScript code must be associated with a <i>Realm</i>. Conceptually, a realm consists of a
set of intrinsic objects, an ECMAScript global environment, all of the ECMAScript code that is loaded within the scope of
that global environment, and other associated state and resources.</p>
<p>A Realm is specified as a Record with the fields specified in <a href="#table-21">Table 21</a>:</p>
<figure>
<figcaption><span id="table-21">Table 21</span> — Realm Record Fields</figcaption>
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[intrinsics]]</td>
<td>Record whose field names are intrinsic keys and whose values are objects</td>
<td>These are the intrinsic values used by code associated with this Realm</td>
</tr>
<tr>
<td>[[globalThis]]</td>
<td>Object</td>
<td>The global object for this Realm</td>
</tr>
<tr>
<td>[[globalEnv]]</td>
<td><a href="#sec-lexical-environments">Lexical Environment</a></td>
<td>The global environment for this Realm</td>
</tr>
<tr>
<td>[[templateMap]]</td>
<td>A <a href="#sec-list-and-record-specification-type">List</a> of Record { [[strings]]: <a href="#sec-list-and-record-specification-type">List</a>, [[array]]: Object}.</td>
<td>Template objects are canonicalized separately for each Realm using its [[templateMap]]. Each [[strings]] value is a <a href="#sec-list-and-record-specification-type">List</a> containing, in source text order, the raw string values of a <span class="nt">TemplateLiteral</span> that has been evaluated. The associated [[array]] value is the corresponding template object that is passed to a tag function.</td>
</tr>
</table>
</figure>
<p>An implementation may define other, implementation specific fields.</p>
</div>
<section id="sec-createrealm">
<h1><span class="secnum" id="sec-8.2.1"><a href="#sec-createrealm" title="link to this section">8.2.1</a></span> CreateRealm
( )</h1>
<p>The abstract operation CreateRealm with no arguments performs the following steps:</p>
<ol class="proc">
<li>Let <i>realmRec</i> be a new Record.</li>
<li>Perform <a href="#sec-createintrinsics">CreateIntrinsics</a>(<i>realmRec</i>).</li>
<li>Set <i>realmRec</i>.[[globalThis]] to <b>undefined</b>.</li>
<li>Set <i>realmRec</i>.[[globalEnv]] to <b>undefined</b>.</li>
<li>Set <i>realmRec</i>.[[templateMap]] to a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Return <i>realmRec</i>.</li>
</ol>
</section>
<section id="sec-createintrinsics">
<h1><span class="secnum" id="sec-8.2.2"><a href="#sec-createintrinsics" title="link to this section">8.2.2</a></span>
CreateIntrinsics ( realmRec )</h1>
<p>When the abstract operation CreateIntrinsics with argument <var>realmRec</var> performs the following steps:</p>
<ol class="proc">
<li>Let <i>intrinsics</i> be a new Record.</li>
<li>Set <i>realmRec</i>.[[intrinsics]] to <i>intrinsics</i>.</li>
<li>Let <i>objProto</i> be <a href="#sec-objectcreate">ObjectCreate</a>(<b>null</b>).</li>
<li>Set <i>intrinsics</i>.[[%ObjectPrototype%]] to <i>objProto</i>.</li>
<li>Let <i>throwerSteps</i> be the algorithm steps specified in <a href="#sec-%throwtypeerror%">9.2.7.1</a> for the <a
href="#sec-%throwtypeerror%">%ThrowTypeError%</a> function.</li>
<li>Let <i>thrower</i> be <a href="#sec-createbuiltinfunction">CreateBuiltinFunction</a>(<i>realmRec</i>,
<i>throwerSteps</i>, <b>null</b>).</li>
<li>Set <i>intrinsics</i>.[[<span style="font-family: sans-serif"><a
href="#sec-%throwtypeerror%">%ThrowTypeError%</a></span>]] to <i>thrower</i>.</li>
<li>Let <i>noSteps</i> be an empty sequence of algorithm steps.</li>
<li>Let <i>funcProto</i> be <a href="#sec-createbuiltinfunction">CreateBuiltinFunction</a>(<i>realmRec</i>,
<i>noSteps</i>, <i>objProto</i>).</li>
<li>Set <i>intrinsics</i>.[[%FunctionPrototype%]] to <i>funcProto</i>.</li>
<li><a href="#sec-call">Call</a> <i>thrower</i>.[[SetPrototypeOf]](<i>funcProto</i>).</li>
<li>Perform <a href="#sec-addrestrictedfunctionproperties">AddRestrictedFunctionProperties</a>(<i>funcProto</i>,
<i>realmRec</i>).</li>
<li>Set fields of <i>intrinsics</i> with the values listed in <a href="#table-7">Table 7</a> that have not already been
handled above. The field names are the names listed in column one of the table. The value of each field is a new
object value fully and recursively populated with property values as defined by the specification of each object in
clauses 18-26. All object property values are newly created object values. All values that are built-in function
objects are created by performing <a href="#sec-createbuiltinfunction">CreateBuiltinFunction</a>(<i>realmRec</i>,
<steps>, <prototype>, <slots>) where <steps> is the definition of that function provided by
this specification, <prototype> is the specified value of the function’s [[Prototype]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> and <slots> is a list of the names, if
any, of the functions specified internal slots. The creation of the intrinsics and their properties must be ordered to
avoid any dependencies upon objects that have not yet been created.</li>
<li>Return <i>intrinsics</i>.</li>
</ol>
</section>
<section id="sec-setrealmglobalobject">
<h1><span class="secnum" id="sec-8.2.3"><a href="#sec-setrealmglobalobject" title="link to this section">8.2.3</a></span>
SetRealmGlobalObject ( realmRec, globalObj )</h1>
<p>The abstract operation SetRealmGlobalObject with arguments <var>realmRec</var> and <var>globalObj</var> performs the
following steps:</p>
<ol class="proc">
<li>If <i>globalObj</i> is <b>undefined</b>, then
<ol class="block">
<li>Let <i>intrinsics</i> be <i>realmRec</i>.[[intrinsics]].</li>
<li>Let <i>globalObj</i> be <a
href="#sec-objectcreate">ObjectCreate</a>(<i>intrinsics</i>.[[%ObjectPrototype%]]).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>globalObj</i>) is Object.</li>
<li>Set <i>realmRec</i>.[[globalThis]] to <i>globalObj</i>.</li>
<li>Let <i>newGlobalEnv</i> be <a href="#sec-newglobalenvironment">NewGlobalEnvironment</a>(<i>globalObj</i>).</li>
<li>Set <i>realmRec</i>.[[globalEnv]] to <i>newGlobalEnv</i>.</li>
<li>Return <i>realmRec</i>.</li>
</ol>
</section>
<section id="sec-setdefaultglobalbindings">
<h1><span class="secnum" id="sec-8.2.4"><a href="#sec-setdefaultglobalbindings"
title="link to this section">8.2.4</a></span> SetDefaultGlobalBindings ( realmRec )</h1>
<p>The abstract operation SetDefaultGlobalBindings with argument <var>realmRec</var> performs the following steps:</p>
<ol class="proc">
<li>Let <i>global</i> be <i>realmRec</i>.[[globalThis]].</li>
<li>For each property of the Global Object specified in <a href="#sec-global-object">clause 18</a>, do
<ol class="block">
<li>Let <i>name</i> be the string value of the property name.</li>
<li>Let <i>desc</i> be the fully populated data property descriptor for the property containing the specified
attributes for the property. For properties listed in <a
href="#sec-function-properties-of-the-global-object">18.2</a>, <a
href="#sec-constructor-properties-of-the-global-object">18.3</a>, or <a
href="#sec-other-properties-of-the-global-object">18.4</a> the value of the [[Value]] attribute is the
corresponding intrinsic object from <i>realmRec</i>.</li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>global</i>, <i>name</i>,
<i>desc</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
</ol>
</li>
<li>Return <i>global</i>.</li>
</ol>
</section>
</section>
<section id="sec-execution-contexts">
<div class="front">
<h1><span class="secnum" id="sec-8.3"><a href="#sec-execution-contexts" title="link to this section">8.3</a></span>
Execution Contexts</h1>
<p>An <i>execution context</i> is a specification device that is used to track the runtime evaluation of code by an
ECMAScript implementation. At any point in time, there is at most one execution context that is actually executing code.
This is known as the <i>running</i> execution context. A stack is used to track execution contexts. The running execution
context is always the top element of this stack. A new execution context is created whenever control is transferred from the
executable code associated with the currently running execution context to executable code that is not associated with that
execution context. The newly created execution context is pushed onto the stack and becomes the running execution
context.</p>
<p>An execution context contains whatever implementation specific state is necessary to track the execution progress of its
associated code. Each execution context has at least the state components listed in <a href="#table-22">Table 22</a>.</p>
<figure>
<figcaption><span id="table-22">Table 22</span> —State Components for All Execution Contexts</figcaption>
<table class="real-table">
<tr>
<th>Component</th>
<th>Purpose</th>
</tr>
<tr>
<td>code evaluation state</td>
<td>Any state needed to perform, suspend, and resume evaluation of the code associated with this execution context.</td>
</tr>
<tr>
<td>Function</td>
<td>If this execution context is evaluating the code of a function object, then the value of this component is that function object. If the context is evaluating the code of a <span class="nt">Script</span> or <span class="nt">Module</span>, the value is <span class="value">null</span>.</td>
</tr>
<tr>
<td><a href="#sec-code-realms">Realm</a></td>
<td>The <a href="#sec-code-realms">Realm</a> from which associated code accesses ECMAScript resources.</td>
</tr>
</table>
</figure>
<p>Evaluation of code by the running execution context may be suspended at various points defined within this specification.
Once the running execution context has been suspended a different execution context may become the running execution context
and commence evaluating its code. At some later time a suspended execution context may again become the running execution
context and continue evaluating its code at the point where it had previously been suspended. Transition of the running
execution context status among execution contexts usually occurs in stack-like last-in/first-out manner. However, some
ECMAScript features require non-LIFO transitions of the running execution context.</p>
<p>The value of the <a href="#sec-code-realms">Realm</a> component of the running execution context is also called the
<i>current <a href="#sec-code-realms">Realm</a></i>. The value of the Function component of the running execution context is
also called the <i>active function object.</i></p>
<p>Execution contexts for ECMAScript code have the additional state components listed in <a href="#table-23">Table
23</a>.</p>
<figure>
<figcaption><span id="table-23">Table 23</span> — Additional State Components for ECMAScript Code Execution Contexts</figcaption>
<table class="real-table">
<tr>
<th>Component</th>
<th>Purpose</th>
</tr>
<tr>
<td>LexicalEnvironment</td>
<td>Identifies the <a href="#sec-lexical-environments">Lexical Environment</a> used to resolve identifier references made by code within this execution context.</td>
</tr>
<tr>
<td>VariableEnvironment</td>
<td>Identifies the <a href="#sec-lexical-environments">Lexical Environment</a> whose EnvironmentRecord holds bindings created by <span class="nt">VariableStatements</span> within this execution context.</td>
</tr>
</table>
</figure>
<p>The LexicalEnvironment and VariableEnvironment components of an execution context are always Lexical Environments. When
an execution context is created its LexicalEnvironment and VariableEnvironment components initially have the same value.</p>
<p>Execution contexts representing the evaluation of generator objects have the additional state components listed in <a
href="#table-24">Table 24</a>.</p>
<figure>
<figcaption><span id="table-24">Table 24</span> — Additional State Components for Generator Execution Contexts</figcaption>
<table class="real-table">
<tr>
<th>Component</th>
<th>Purpose</th>
</tr>
<tr>
<td>Generator</td>
<td>The GeneratorObject that this execution context is evaluating.</td>
</tr>
</table>
</figure>
<p>In most situations only the running execution context (the top of the execution context stack) is directly manipulated by
algorithms within this specification. Hence when the terms “LexicalEnvironment”, and
“VariableEnvironment” are used without qualification they are in reference to those components of the running
execution context.</p>
<p>An execution context is purely a specification mechanism and need not correspond to any particular artefact of an
ECMAScript implementation. It is impossible for ECMAScript code to directly access or observe an execution context.</p>
</div>
<section id="sec-resolvebinding">
<h1><span class="secnum" id="sec-8.3.1"><a href="#sec-resolvebinding" title="link to this section">8.3.1</a></span>
ResolveBinding ( name, [env] )</h1>
<p>The ResolveBinding abstract operation is used to determine the binding of <var>name</var> passed as a string value. The
optional argument <var>env</var> can be used to explicitly provide the <a href="#sec-lexical-environments">Lexical
Environment</a> that is to be searched for the binding. During execution of ECMAScript code, ResolveBinding is performed
using the following algorithm:</p>
<ol class="proc">
<li>If <i>env</i> was not passed or if <i>env</i> is <b>undefined</b>, then
<ol class="block">
<li>Let <i>env</i> be <a href="#sec-execution-contexts">the running execution context</a>’s <a
href="#sec-execution-contexts">LexicalEnvironment</a>.</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>env</i> is a <a href="#sec-lexical-environments">Lexical
Environment</a>.</li>
<li>If the code matching the syntactic production that is being evaluated is contained in <a
href="#sec-strict-mode-code">strict mode code</a>, let <i>strict</i> be <b>true</b>, else let <i>strict</i> be
<b>false</b>.</li>
<li>Return <a href="#sec-getidentifierreference">GetIdentifierReference</a>(<i>env</i>, <i>name</i>, <i>strict</i> ).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The result of ResolveBinding is always a <a
href="#sec-reference-specification-type">Reference</a> value with its referenced name component equal to the <i>name</i>
argument.</p>
</div>
</section>
<section id="sec-getthisenvironment">
<h1><span class="secnum" id="sec-8.3.2"><a href="#sec-getthisenvironment" title="link to this section">8.3.2</a></span>
GetThisEnvironment ( )</h1>
<p>The abstract operation <span style="font-family: Times New Roman">GetThisEnvironment</span> finds the <a
href="#sec-environment-records">Environment Record</a> that currently supplies the binding of the keyword <code>this</code>.
<span style="font-family: Times New Roman">GetThisEnvironment</span> performs the following steps:</p>
<ol class="proc">
<li>Let <i>lex</i> be <a href="#sec-execution-contexts">the running execution context</a>’s <a
href="#sec-execution-contexts">LexicalEnvironment</a>.</li>
<li>Repeat
<ol class="block">
<li>Let <i>envRec</i> be <i>lex</i>’s EnvironmentRecord.</li>
<li>Let <i>exists</i> be <i>envRec</i>.HasThisBinding().</li>
<li>If <i>exists</i> is <b>true</b>, return <i>envRec</i>.</li>
<li>Let <i>outer</i> be the value of <i>lex’s</i> <a href="#sec-lexical-environments">outer environment
reference</a>.</li>
<li>Let <i>lex</i> be <i>outer</i>.</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The loop in step 2 will always terminate because the list of environments always ends with
<a href="#sec-global-environment-records">the global environment</a> which has a <code>this</code> binding.</p>
</div>
</section>
<section id="sec-resolvethisbinding">
<h1><span class="secnum" id="sec-8.3.3"><a href="#sec-resolvethisbinding" title="link to this section">8.3.3</a></span>
ResolveThisBinding ( )</h1>
<p>The abstract operation ResolveThisBinding determines the binding of the keyword <code>this</code> using the <a
href="#sec-execution-contexts">LexicalEnvironment</a> of <a href="#sec-execution-contexts">the running execution
context</a>. ResolveThisBinding performs the following steps:</p>
<ol class="proc">
<li>Let <i>envRec</i> be <a href="#sec-getthisenvironment">GetThisEnvironment</a>( ).</li>
<li>Return <i>envRec</i>.GetThisBinding().</li>
</ol>
</section>
<section id="sec-getnewtarget">
<h1><span class="secnum" id="sec-8.3.4"><a href="#sec-getnewtarget" title="link to this section">8.3.4</a></span>
GetNewTarget ( )</h1>
<p>The abstract operation GetNewTarget determines the NewTarget value using the <a
href="#sec-execution-contexts">LexicalEnvironment</a> of <a href="#sec-execution-contexts">the running execution
context</a>. GetNewTarget performs the following steps:</p>
<ol class="proc">
<li>Let <i>envRec</i> be <a href="#sec-getthisenvironment">GetThisEnvironment</a>( ).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> has a [[NewTarget]] field.</li>
<li>Return <i>envRec</i>.[[NewTarget]].</li>
</ol>
</section>
<section id="sec-getglobalobject">
<h1><span class="secnum" id="sec-8.3.5"><a href="#sec-getglobalobject" title="link to this section">8.3.5</a></span>
GetGlobalObject ( )</h1>
<p>The abstract operation <span style="font-family: Times New Roman">GetGlobalObject</span> returns the global object used
by <a href="#sec-execution-contexts">the currently running execution context</a>. <span style="font-family: Times New
Roman">GetGlobalObject</span> performs the following steps:</p>
<ol class="proc">
<li>Let <i>ctx</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>currentRealm</i> be <i>ctx’s</i> <a href="#sec-code-realms">Realm</a>.</li>
<li>Return <i>currentRealm</i>.[[globalThis]].</li>
</ol>
</section>
</section>
<section id="sec-jobs-and-job-queues">
<div class="front">
<h1><span class="secnum" id="sec-8.4"><a href="#sec-jobs-and-job-queues" title="link to this section">8.4</a></span> Jobs
and Job Queues</h1>
<p>A Job is an abstract operation that initiates an ECMAScript computation when no other ECMAScript computation is currently
in progress. A Job abstract operation may be defined to accept an arbitrary set of job parameters.</p>
<p>Execution of a Job can be initiated only when there is no running <a href="#sec-execution-contexts">execution context</a>
and <a href="#sec-execution-contexts">the execution context stack</a> is empty. A PendingJob is a request for the future
execution of a Job. A PendingJob is an internal Record whose fields are specified in <a href="#table-25">Table 25</a>. Once
execution of a Job is initiated, the Job always executes to completion. No other Job may be initiated until the currently
running Job completes. However, the currently running Job or external events may cause the enqueuing of additional
PendingJobs that may be initiated sometime after completion of the currently running Job.</p>
<figure>
<figcaption><span id="table-25">Table 25</span> — PendingJob Record Fields</figcaption>
<table class="real-table">
<tr>
<th>Field Name</th>
<th>Value</th>
<th>Meaning</th>
</tr>
<tr>
<td>[[Job]]</td>
<td>The name of a Job abstract operation</td>
<td>This is the abstract operation that is performed when execution of this PendingJob is initiated. Jobs are abstract operations that use NextJob rather than Return to indicate that they have completed.</td>
</tr>
<tr>
<td>[[Arguments]]</td>
<td>A <a href="#sec-list-and-record-specification-type">List</a></td>
<td>The <a href="#sec-list-and-record-specification-type">List</a> of argument values that are to be passed to [[Job]] when it is activated.</td>
</tr>
<tr>
<td>[[Realm]]</td>
<td>A <a href="#sec-code-realms">Realm</a> Record</td>
<td>The <a href="#sec-code-realms">Realm</a> for the initial <a href="#sec-execution-contexts">execution context</a> when this Pending Job is initiated.</td>
</tr>
<tr>
<td>[[HostDefined]]</td>
<td>Any, default value is <span class="value">undefined</span>.</td>
<td>Field reserved for use by host environments that need to associate additional information with a pending Job.</td>
</tr>
</table>
</figure>
<p>A Job Queue is a FIFO queue of PendingJob records. Each Job Queue has a name and the full set of available Job Queues are
defined by an ECMAScript implementation. Every ECMAScript implementation has at least the Job Queues defined in <a
href="#table-26">Table 26</a>.</p>
<figure>
<figcaption><span id="table-26">Table 26</span> — Required Job Queues</figcaption>
<table class="real-table">
<tr>
<th>Name</th>
<th>Purpose</th>
</tr>
<tr>
<td>ScriptJobs</td>
<td>Jobs that validate and evaluate ECMAScript <span class="nt">Script</span> and <span class="nt">Module</span> source text. See clauses 10 and 15.</td>
</tr>
<tr>
<td>PromiseJobs</td>
<td>Jobs that are responses to the settlement of a Promise (<a href="#sec-promise-objects">see 25.4</a>).</td>
</tr>
</table>
</figure>
<p>A request for the future execution of a Job is made by enqueueing, on a Job Queue, a PendingJob record that includes a
Job abstract operation name and any necessary argument values. When there is no running <a
href="#sec-execution-contexts">execution context</a> and <a href="#sec-execution-contexts">the execution context stack</a>
is empty, the ECMAScript implementation removes the first PendingJob from a Job Queue and uses the information contained in
it to create an <a href="#sec-execution-contexts">execution context</a> and starts execution of the associated Job abstract
operation.</p>
<p>The PendingJob records from a single Job Queue are always initiated in FIFO order. This specification does not define the
order in which multiple Job Queues are serviced. An ECMAScript implementation may interweave the FIFO evaluation of the
PendingJob records of a Job Queue with the evaluation of the PendingJob records of one or more other Job Queues. An
implementation must define what occurs when there are no running <a href="#sec-execution-contexts">execution context</a> and
all Job Queues are empty.</p>
<div class="note">
<p><span class="nh">NOTE</span> Typically an ECMAScript implementation will have its Job Queues pre-initialized with at
least one PendingJob and one of those Jobs will be the first to be executed. An implementation might choose to free all
resources and terminate if the current Job completes and all Job Queues are empty. Alternatively, it might choose to wait
for a some implementation specific agent or mechanism to enqueue new PendingJob requests.</p>
</div>
<p>The following abstract operations are used to create and manage Jobs and Job Queues:</p>
</div>
<section id="sec-enqueuejob">
<h1><span class="secnum" id="sec-8.4.1"><a href="#sec-enqueuejob" title="link to this section">8.4.1</a></span> EnqueueJob (
queueName, job, arguments)</h1>
<p>The EnqueueJob abstract operation requires three arguments: <var>queueName</var>, <var>job</var>, and
<var>arguments</var>. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>queueName</i>) is String and its value is the name of a Job
Queue recognized by this implementation.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>job</i> is the name of a Job.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>arguments</i> is a <a
href="#sec-list-and-record-specification-type">List</a> that has the same number of elements as the number of
parameters required by <i>job</i>.</li>
<li>Let <i>callerContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>callerRealm</i> be <i>callerContext’s</i> <a href="#sec-code-realms">Realm</a>.</li>
<li>Let <i>pending</i> be PendingJob{ [[Job]]: <i>job</i>, [[Arguments]]: <i>arguments</i>, [[Realm]]: <i>callerRealm</i>,
[[HostDefined]]: <b>undefined</b> }.</li>
<li>Perform any implementation or host environment defined processing of <i>pending</i>. This may include modifying the
[[HostDefined]] field or any other field of <i>pending</i>.</li>
<li>Add <i>pending</i> at the back of the Job Queue named by <i>queueName</i>.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family: sans-serif">empty</span>).</li>
</ol>
</section>
<section id="sec-nextjob-result">
<h1><span class="secnum" id="sec-8.4.2"><a href="#sec-nextjob-result" title="link to this section">8.4.2</a></span> NextJob
result</h1>
<p>An algorithm step such as:</p>
<ol class="proc">
<li>NextJob <i>result</i>.</li>
</ol>
<p>is used in Job abstract operations in place of:</p>
<ol class="proc">
<li>Return <i>result</i>.</li>
</ol>
<p>Job abstract operations must not contain a Return step or a <a href="#sec-returnifabrupt">ReturnIfAbrupt</a> step. The
NextJob <var>result</var> operation is equivalent to the following steps:</p>
<ol class="proc">
<li>If <i>result</i> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, perform
implementation defined unhandled exception processing.</li>
<li><a href="#sec-execution-contexts">Suspend</a> <a href="#sec-execution-contexts">the running execution context</a> and
remove it from <a href="#sec-execution-contexts">the execution context stack</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: The <a href="#sec-execution-contexts">execution context stack</a> is
now empty.</li>
<li>Let <i>nextQueue</i> be a non-empty Job Queue chosen in an implementation defined manner. If all Job Queues are empty,
the result is implementation defined.</li>
<li>Let <i>nextPending</i> be the PendingJob record at the front of <i>nextQueue</i>. Remove that record from
<i>nextQueue</i>.</li>
<li>Let <i>newContext</i> be a new <a href="#sec-execution-contexts">execution context</a>.</li>
<li>Set <i>newContext</i>’s <a href="#sec-code-realms">Realm</a> to <i>nextPending</i>.[[Realm]].</li>
<li>Push <i>newContext</i> onto <a href="#sec-execution-contexts">the execution context stack</a>; <i>newContext</i> is
now <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Perform any implementation or host environment defined job initialization using <i>nextPending</i>.</li>
<li>Perform the abstract operation named by <i>nextPending</i>.[[Job]] using the elements of
<i>nextPending</i>.[[Arguments]] as its arguments.</li>
</ol>
</section>
</section>
<section id="sec-ecmascript-initialization">
<div class="front">
<h1><span class="secnum" id="sec-8.5"><a href="#sec-ecmascript-initialization" title="link to this section">8.5</a></span>
ECMAScript Initialization()</h1>
<p>An ECMAScript implementation performs the following steps prior to the execution of any Jobs or the evaluation of any
ECMAScript code:</p>
<ol class="proc">
<li>Let <i>realm</i> be <a href="#sec-createrealm">CreateRealm</a>().</li>
<li>Let <i>newContext</i> be a new <a href="#sec-execution-contexts">execution context</a>.</li>
<li>Set the Function of <i>newContext</i> to <b>null</b>.</li>
<li>Set the <a href="#sec-code-realms">Realm</a> of <i>newContext</i> to <i>realm</i>.</li>
<li>Push <i>newContext</i> onto <a href="#sec-execution-contexts">the execution context stack</a>; <i>newContext</i> is
now <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>status</i> be <a href="#sec-initializehostdefinedrealm">InitializeHostDefinedRealm</a>(<i>realm</i>).</li>
<li>If <i>status</i> is an <a href="#sec-completion-record-specification-type">abrupt completion</a>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: The first realm could not be created.</li>
<li>Terminate ECMAScript execution.</li>
</ol>
</li>
<li>In an implementation dependent manner, obtain the ECMAScript source texts (see <a
href="#sec-ecmascript-language-source-code">clause 10</a>) for zero or more ECMAScript scripts and/or ECMAScript
modules. For each such <i>sourceText</i> do,
<ol class="block">
<li>If <i>sourceText</i> is the source code of a script, then
<ol class="block">
<li>Perform <a href="#sec-enqueuejob">EnqueueJob</a>(<code>"ScriptJobs"</code>, <a
href="#sec-scriptevaluationjob">ScriptEvaluationJob</a>, « <i>sourceText</i> »).</li>
</ol>
</li>
<li>Else <i>sourceText</i> is the source code of a module,
<ol class="block">
<li>Perform <a href="#sec-enqueuejob">EnqueueJob</a>(<code>"ScriptJobs"</code>, <a
href="#sec-toplevelmoduleevaluationjob">TopLevelModuleEvaluationJob</a>, « <i>sourceText</i>
»).</li>
</ol>
</li>
</ol>
</li>
<li>NextJob <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</div>
<section id="sec-initializehostdefinedrealm">
<h1><span class="secnum" id="sec-8.5.1"><a href="#sec-initializehostdefinedrealm"
title="link to this section">8.5.1</a></span> InitializeHostDefinedRealm ( realm )</h1>
<p>The abstract operation InitializeHostDefinedRealm with parameter <var>realm</var> performs the following steps:</p>
<ol class="proc">
<li>If this implementation requires use of an exotic object to serve as <i>realm</i>’s global object, let
<i>global</i> be such an object created in an implementation defined manner. Otherwise, let <i>global</i> be
<b>undefined</b> indicating that an ordinary object should be created as the global object.</li>
<li>Perform <a href="#sec-setrealmglobalobject">SetRealmGlobalObject</a>(<i>realm</i>, <i>global</i>).</li>
<li>Let <i>globalObj</i> be <a href="#sec-setdefaultglobalbindings">SetDefaultGlobalBindings</a>(<i>realm</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>globalObj</i>).</li>
<li>Create any implementation defined global object properties on <i>globalObj</i>.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</section>
</section>
</section>
<section id="sec-ordinary-and-exotic-objects-behaviours">
<div class="front">
<h1><span class="secnum" id="sec-9"><a href="#sec-ordinary-and-exotic-objects-behaviours"
title="link to this section">9</a></span> Ordinary and Exotic Objects Behaviours</h1>
</div>
<section id="sec-ordinary-object-internal-methods-and-internal-slots">
<div class="front">
<h1><span class="secnum" id="sec-9.1"><a href="#sec-ordinary-object-internal-methods-and-internal-slots"
title="link to this section">9.1</a></span> Ordinary Object Internal Methods and Internal Slots</h1>
<p>All ordinary objects have an <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> called
[[Prototype]]. The value of this <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is either
<b>null</b> or an object and is used for implementing inheritance. Data properties of the [[Prototype]] object are inherited
(are visible as properties of the child object) for the purposes of get access, but not for set access. Accessor properties
are inherited for both get access and set access.</p>
<p>Every ordinary object has a Boolean-valued [[Extensible]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> that controls whether or not properties may be
added to the object. If the value of the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> is <b>false</b> then additional properties may not be added to the object. In addition, if [[Extensible]] is
<b>false</b> the value of the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
the object may not be modified. Once the value of an object’s [[Extensible]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> has been set to <b>false</b> it may not be
subsequently changed to <b>true</b>.</p>
<p>In the following algorithm descriptions, assume <var>O</var> is an ordinary object, <var>P</var> is a <a
href="#sec-object-type">property key value</a>, <var>V</var> is any <a href="#sec-ecmascript-language-types">ECMAScript
language value</a>, and <span class="nt">Desc</span> is a <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a> record.</p>
</div>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof">
<h1><span class="secnum" id="sec-9.1.1"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof"
title="link to this section">9.1.1</a></span> [[GetPrototypeOf]] ( )</h1>
<p>When the [[GetPrototypeOf]] internal method of <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Return the value of the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>O</i>.</li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-setprototypeof-v">
<h1><span class="secnum" id="sec-9.1.2"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-setprototypeof-v"
title="link to this section">9.1.2</a></span> [[SetPrototypeOf]] (V)</h1>
<p>When the [[SetPrototypeOf]] internal method of <var>O</var> is called with argument <var>V</var> the following steps are
taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: Either <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Object or <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Null.</li>
<li>Let <i>extensible</i> be the value of the [[Extensible]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>current</i> be the value of the [[Prototype]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>V</i>, <i>current</i>), return <b>true.</b></li>
<li>If <i>extensible</i> is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>p</i> be <i>V</i>.</li>
<li>Let <i>done</i> be <b>false</b>.</li>
<li>Repeat while <i>done</i> is <b>false</b>,
<ol class="block">
<li>If <i>p</i> is <b>null</b>, let <i>done</i> be <b>true</b>.</li>
<li>Else, if <a href="#sec-samevalue">SameValue</a>(<i>p</i>, <i>O</i>) is <b>true</b>, return <b>false</b>.</li>
<li>Else,
<ol class="block">
<li>If the [[GetPrototypeOf]] internal method of <i>p</i> is not the ordinary object internal method defined in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots-getprototypeof">9.1.1</a>, let <i>done</i> be
<b>true</b>.</li>
<li>Else, let <i>p</i> be the value of <i>p</i>’s [[Prototype]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
</ol>
</li>
</ol>
</li>
<li>Set the value of the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>O</i> to <i>V</i>.</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The loop in step 8 guarantees that there will be no circularities in any prototype chain
that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]].</p>
</div>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-isextensible">
<h1><span class="secnum" id="sec-9.1.3"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-isextensible"
title="link to this section">9.1.3</a></span> [[IsExtensible]] ( )</h1>
<p>When the [[IsExtensible]] internal method of <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Return the value of the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>O</i>.</li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-preventextensions">
<h1><span class="secnum" id="sec-9.1.4"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-preventextensions"
title="link to this section">9.1.4</a></span> [[PreventExtensions]] ( )</h1>
<p>When the [[PreventExtensions]] internal method of <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Set the value of the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>O</i> to <b>false</b>.</li>
<li>Return <b>true.</b></li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-getownproperty-p">
<div class="front">
<h1><span class="secnum" id="sec-9.1.5"><a
href="#sec-ordinary-object-internal-methods-and-internal-slots-getownproperty-p"
title="link to this section">9.1.5</a></span> [[GetOwnProperty]] (P)</h1>
<p>When the [[GetOwnProperty]] internal method of <var>O</var> is called with <a href="#sec-object-type">property key</a>
<var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>Return <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>O</i>, <i>P</i>).</li>
</ol>
</div>
<section id="sec-ordinarygetownproperty">
<h1><span class="secnum" id="sec-9.1.5.1"><a href="#sec-ordinarygetownproperty"
title="link to this section">9.1.5.1</a></span> OrdinaryGetOwnProperty (O, P)</h1>
<p>When the abstract operation OrdinaryGetOwnProperty is called with Object <var>O</var> and with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>If <i>O</i> does not have an own property with key <i>P</i>, return <b>undefined</b>.</li>
<li>Let <i>D</i> be a newly created <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> with
no fields.</li>
<li>Let <i>X</i> be <i>O</i>’s own property whose key is <i>P</i>.</li>
<li>If <i>X</i> is a data property, then
<ol class="block">
<li>Set <i>D</i>.[[Value]] to the value of <i>X</i>’s [[Value]] attribute.</li>
<li>Set <i>D</i>.[[Writable]] to the value of <i>X</i>’s [[Writable]] attribute</li>
</ol>
</li>
<li>Else <i>X</i> is an accessor property, so
<ol class="block">
<li>Set <i>D</i>.[[Get]] to the value of <i>X</i>’s [[Get]] attribute.</li>
<li>Set <i>D</i>.[[Set]] to the value of <i>X</i>’s [[Set]] attribute.</li>
</ol>
</li>
<li>Set <i>D</i>.[[Enumerable]] to the value of <i>X</i>’s [[Enumerable]] attribute.</li>
<li>Set <i>D</i>.[[Configurable]] to the value of <i>X</i>’s [[Configurable]] attribute.</li>
<li>Return <i>D</i>.</li>
</ol>
</section>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc">
<div class="front">
<h1><span class="secnum" id="sec-9.1.6"><a
href="#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc"
title="link to this section">9.1.6</a></span> [[DefineOwnProperty]] (P, Desc)</h1>
<p>When the [[DefineOwnProperty]] internal method of <var>O</var> is called with <a href="#sec-object-type">property
key</a> <var>P</var> and <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span
class="nt">Desc</span>, the following steps are taken:</p>
<ol class="proc">
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>O</i>, <i>P</i>, <i>Desc</i>).</li>
</ol>
</div>
<section id="sec-ordinarydefineownproperty">
<h1><span class="secnum" id="sec-9.1.6.1"><a href="#sec-ordinarydefineownproperty"
title="link to this section">9.1.6.1</a></span> OrdinaryDefineOwnProperty (O, P, Desc)</h1>
<p>When the abstract operation <span style="font-family: Times New Roman">OrdinaryDefineOwnProperty</span> is called with
Object <var>O</var>, <a href="#sec-object-type">property key</a> <span style="font-family: Times New
Roman"><i>P</i>,</span> and <a href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span
class="nt">Desc</span> the following steps are taken:</p>
<ol class="proc">
<li>Let <i>current</i> be <i>O</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>current</i>).</li>
<li>Let <i>extensible</i> be the value of the [[Extensible]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Return <a href="#sec-validateandapplypropertydescriptor">ValidateAndApplyPropertyDescriptor</a>(<i>O</i>, <i>P</i>,
<i>extensible</i>, <i>Desc</i>, <i>current</i>).</li>
</ol>
</section>
<section id="sec-iscompatiblepropertydescriptor">
<h1><span class="secnum" id="sec-9.1.6.2"><a href="#sec-iscompatiblepropertydescriptor"
title="link to this section">9.1.6.2</a></span> IsCompatiblePropertyDescriptor (Extensible, Desc, Current)</h1>
<p>When the abstract operation <span style="font-family: Times New Roman">IsCompatiblePropertyDescriptor</span> is called
with Boolean value <span class="nt">Extensible</span>, and Property Descriptors <span class="nt">Desc</span>, and <span
class="nt">Current</span> the following steps are taken:</p>
<ol class="proc">
<li>Return <a href="#sec-validateandapplypropertydescriptor">ValidateAndApplyPropertyDescriptor</a>(<b>undefined</b>,
<b>undefined</b>, <i>Extensible</i>, <i>Desc</i>, <i>Current</i>).</li>
</ol>
</section>
<section id="sec-validateandapplypropertydescriptor">
<h1><span class="secnum" id="sec-9.1.6.3"><a href="#sec-validateandapplypropertydescriptor"
title="link to this section">9.1.6.3</a></span> ValidateAndApplyPropertyDescriptor (O, P, extensible, Desc,
current)</h1>
<p>When the abstract operation <span style="font-family: Times New Roman">ValidateAndApplyPropertyDescriptor</span> is
called with Object <var>O</var>, <a href="#sec-object-type">property key</a> <span style="font-family: Times New
Roman"><i>P</i>,</span> Boolean value <var>extensible</var>, and Property Descriptors <span class="nt">Desc</span>, and
<var>current</var> the following steps are taken:</p>
<p>This algorithm contains steps that test various fields of the <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span> for specific
values. The fields that are tested in this manner need not actually exist in <span class="nt">Desc</span>. If a field is
absent then its value is considered to be <b>false</b>.</p>
<div class="note">
<p><span class="nh">NOTE</span> If <b>undefined</b> is passed as the <i>O</i> argument only validation is performed and
no object updates are performed.</p>
</div>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: If <i>O</i> is not <b>undefined</b> then <i>P</i> is a valid <a
href="#sec-object-type">property key</a>.</li>
<li>If <i>current</i> is <b>undefined</b>, then
<ol class="block">
<li>If <i>extensible</i> is <b>false</b>, return <b>false</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>extensible</i> is <b>true</b>.</li>
<li>If <a href="#sec-isgenericdescriptor">IsGenericDescriptor</a>(<i>Desc</i>) or <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>Desc</i>) is <b>true</b>, then
<ol class="block">
<li>If <i>O</i> is not <b>undefined</b>, create an own data property named <i>P</i> of object <i>O</i> whose
[[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values are described by <i>Desc</i>.
If the value of an attribute field of <i>Desc</i> is absent, the attribute of the newly created property is
set to its default value.</li>
</ol>
</li>
<li>Else <i>Desc</i> must be an accessor <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a>,
<ol class="block">
<li>If <i>O</i> is not <b>undefined</b>, create an own accessor property named <i>P</i> of object <i>O</i> whose
[[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by <i>Desc</i>. If the
value of an attribute field of <i>Desc</i> is absent, the attribute of the newly created property is set to
its default value.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
<li>Return <b>true</b>, if every field in <i>Desc</i> is absent.</li>
<li>Return <b>true</b>, if every field in <i>Desc</i> also occurs in <i>current</i> and the value of every field in
<i>Desc</i> is the same value as the corresponding field in <i>current</i> when compared using <a
href="#sec-samevalue">the SameValue algorithm</a>.</li>
<li>If the [[Configurable]] field of <i>current</i> is <b>false</b>, then
<ol class="block">
<li>Return <b>false</b>, if the [[Configurable]] field of <i>Desc</i> is <b>true</b>.</li>
<li>Return <b>false</b>, if the [[Enumerable]] field of <i>Desc</i> is present and the [[Enumerable]] fields of
<i>current</i> and <i>Desc</i> are the Boolean negation of each other.</li>
</ol>
</li>
<li>If <a href="#sec-isgenericdescriptor">IsGenericDescriptor</a>(<i>Desc</i>) is <b>true</b>, no further validation is
required.</li>
<li>Else if <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>current</i>) and <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>Desc</i>) have different results, then
<ol class="block">
<li>Return <b>false</b>, if the [[Configurable]] field of <i>current</i> is <b>false</b>.</li>
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>current</i>) is <b>true</b>, then
<ol class="block">
<li>If <i>O</i> is not <b>undefined</b>, convert the property named <i>P</i> of object <i>O</i> from a data
property to an accessor property. Preserve the existing values of the converted property’s
[[Configurable]] and [[Enumerable]] attributes and set the rest of the property’s attributes to their
default values.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>If <i>O</i> is not <b>undefined</b>, convert the property named <i>P</i> of object <i>O</i> from an accessor
property to a data property. Preserve the existing values of the converted property’s [[Configurable]]
and [[Enumerable]] attributes and set the rest of the property’s attributes to their default
values.</li>
</ol>
</li>
</ol>
</li>
<li>Else if <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>current</i>) and <a
href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>Desc</i>) are both <b>true</b>, then
<ol class="block">
<li>If the [[Configurable]] field of <i>current</i> is <b>false</b>, then
<ol class="block">
<li>Return <b>false</b>, if the [[Writable]] field of <i>current</i> is <b>false</b> and the [[Writable]] field
of <i>Desc</i> is <b>true</b>.</li>
<li>If the [[Writable]] field of <i>current</i> is <b>false</b>, then
<ol class="block">
<li>Return <b>false</b>, if the [[Value]] field of <i>Desc</i> is present and <a
href="#sec-samevalue">SameValue</a>(<i>Desc</i>.[[Value]], <i>current</i>.[[Value]]) is
<b>false</b>.</li>
</ol>
</li>
</ol>
</li>
<li>Else the [[Configurable]] field of <i>current</i> is <b>true</b>, so any change is acceptable.</li>
</ol>
</li>
<li>Else <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>current</i>) and <a
href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>Desc</i>) are both <b>true</b>,
<ol class="block">
<li>If the [[Configurable]] field of <i>current</i> is <b>false</b>, then
<ol class="block">
<li>Return <b>false</b>, if the [[Set]] field of <i>Desc</i> is present and <a
href="#sec-samevalue">SameValue</a>(<i>Desc</i>.[[Set]], <i>current</i>.[[Set]]) is <b>false</b>.</li>
<li>Return <b>false</b>, if the [[Get]] field of <i>Desc</i> is present and <a
href="#sec-samevalue">SameValue</a>(<i>Desc</i>.[[Get]], <i>current</i>.[[Get]]) is <b>false</b>.</li>
</ol>
</li>
</ol>
</li>
<li>If <i>O</i> is not <b>undefined</b>, then
<ol class="block">
<li>For each field of <i>Desc</i> that is present, set the corresponding attribute of the property named <i>P</i> of
object <i>O</i> to the value of the field.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Step 8.b allows any field of Desc to be different from the corresponding field of
current if current’s [[Configurable]] field is <b>true</b>. This even permits changing the [[Value]] of a property
whose [[Writable]] attribute is <b>false</b>. This is allowed because a <b>true</b> [[Configurable]] attribute would
permit an equivalent sequence of calls where [[Writable]] is first set to <b>true</b>, a new [[Value]] is set, and then
[[Writable]] is set to <b>false</b>.</p>
</div>
</section>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-hasproperty-p">
<div class="front">
<h1><span class="secnum" id="sec-9.1.7"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-hasproperty-p"
title="link to this section">9.1.7</a></span> [[HasProperty]](P)</h1>
<p>When the [[HasProperty]] internal method of <var>O</var> is called with <a href="#sec-object-type">property key</a>
<var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>Return <a href="#sec-ordinaryhasproperty">OrdinaryHasProperty</a>(<i>O</i>, <i>P</i>).</li>
</ol>
</div>
<section id="sec-ordinaryhasproperty">
<h1><span class="secnum" id="sec-9.1.7.1"><a href="#sec-ordinaryhasproperty"
title="link to this section">9.1.7.1</a></span> OrdinaryHasProperty (O, P)</h1>
<p>When the abstract operation OrdinaryHasProperty is called with Object <var>O</var> and with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>hasOwn</i> be <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>O</i>, <i>P</i>).</li>
<li>If <i>hasOwn</i> is not <b>undefined</b>, return <b>true</b>.</li>
<li>Let <i>parent</i> be <i>O</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>parent</i>).</li>
<li>If <i>parent</i> is not <b>null</b>, then
<ol class="block">
<li>Return <i>parent</i>.[[HasProperty]](<i>P</i>).</li>
</ol>
</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver">
<h1><span class="secnum" id="sec-9.1.8"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver"
title="link to this section">9.1.8</a></span> [[Get]] (P, Receiver)</h1>
<p>When the [[Get]] internal method of <var>O</var> is called with <a href="#sec-object-type">property key</a> <var>P</var>
and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span class="nt">Receiver</span> the following
steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>desc</i> be <i>O</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>desc</i>).</li>
<li>If <i>desc</i> is <b>undefined</b>, then
<ol class="block">
<li>Let <i>parent</i> be <i>O</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>parent</i>).</li>
<li>If <i>parent</i> is <b>null</b>, return <b>undefined.</b></li>
<li>Return <i>parent</i>.[[Get]](<i>P</i>, <i>Receiver</i>).</li>
</ol>
</li>
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>desc</i>) is <b>true</b>, return
<i>desc</i>.[[Value]].</li>
<li>Otherwise, <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>desc</i>) must be <b>true</b> so, let
<i>getter</i> be <i>desc</i>.[[Get]].</li>
<li>If <i>getter</i> is <b>undefined</b>, return <b>undefined</b>.</li>
<li>Return <a href="#sec-call">Call</a>(<i>getter,</i> <i>Receiver</i>).</li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver">
<h1><span class="secnum" id="sec-9.1.9"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver"
title="link to this section">9.1.9</a></span> [[Set]] ( P, V, Receiver)</h1>
<p>When the [[Set]] internal method of <var>O</var> is called with <a href="#sec-object-type">property key</a> <var>P</var>,
value <var>V</var>, and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span
class="nt">Receiver</span>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>ownDesc</i> be <i>O</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>ownDesc</i>).</li>
<li>If <i>ownDesc</i> is <b>undefined</b>, then
<ol class="block">
<li>Let <i>parent</i> be <i>O</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>parent</i>).</li>
<li>If <i>parent</i> is not <b>null</b>, then
<ol class="block">
<li>Return <i>parent</i>.[[Set]](<i>P</i>, <i>V</i>, <i>Receiver</i>).</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>ownDesc</i> be the PropertyDescriptor{[[Value]]: <b>undefined</b>, [[Writable]]: <b>true</b>,
[[Enumerable]]: <b>true</b>, [[Configurable]]: <b>true</b>}.</li>
</ol>
</li>
</ol>
</li>
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>ownDesc</i>) is <b>true</b>, then
<ol class="block">
<li>If <i>ownDesc</i>.[[Writable]] is <b>false</b>, return <b>false</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>Receiver</i>) is not Object, return
<b>false</b>.</li>
<li>Let <i>existingDescriptor</i> be <i>Receiver</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>existingDescriptor</i>).</li>
<li>If <i>existingDescriptor</i> is not <b>undefined</b>, then
<ol class="block">
<li>Let <i>valueDesc</i> be the PropertyDescriptor{[[Value]]: <i>V</i>}.</li>
<li>Return <i>Receiver</i>.[[DefineOwnProperty]](<i>P</i>, <i>valueDesc</i>).</li>
</ol>
</li>
<li>Else <i>Receiver</i> does not currently have a property <i>P</i>,
<ol class="block">
<li>Return <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>Receiver</i>, <i>P</i>, <i>V</i>).</li>
</ol>
</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>ownDesc</i>) is <b>true</b>.</li>
<li>Let <i>setter</i> be <i>ownDesc</i>.[[Set]].</li>
<li>If <i>setter</i> is <b>undefined</b>, return <b>false</b>.</li>
<li>Let <i>setterResult</i> be <a href="#sec-call">Call</a>(<i>setter</i>, <i>Receiver</i>, «<i>V</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>setterResult</i>).</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-delete-p">
<h1><span class="secnum" id="sec-9.1.10"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-delete-p"
title="link to this section">9.1.10</a></span> [[Delete]] (P)</h1>
<p>When the [[Delete]] internal method of <var>O</var> is called with <a href="#sec-object-type">property key</a>
<var>P</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>desc</i> be <i>O</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>desc</i>).</li>
<li>If <i>desc</i> is <b>undefined</b>, return <b>true</b>.</li>
<li>If <i>desc</i>.[[Configurable]] is <b>true</b>, then
<ol class="block">
<li>Remove the own property with name <i>P</i> from <i>O</i>.</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-enumerate">
<h1><span class="secnum" id="sec-9.1.11"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-enumerate"
title="link to this section">9.1.11</a></span> [[Enumerate]] ()</h1>
<p>When the [[Enumerate]] internal method of <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Return an Iterator object (<a href="#sec-iterator-interface">25.1.1.2</a>) whose <code>next</code> method iterates
over all the String-valued keys of enumerable properties of <i>O</i>. The Iterator object must inherit from
%IteratorPrototype% (<a href="#sec-%iteratorprototype%-object">25.1.2</a>). The mechanics and order of enumerating the
properties is not specified but must conform to the rules specified below.</li>
</ol>
<p>The iterator’s <code>next</code> method processes object properties to determine whether the <a
href="#sec-object-type">property key</a> should be returned as an iterator value. Returned property keys do not include keys
that are Symbols. Properties of the target object may be deleted during enumeration. A property that is deleted before it is
processed by the iterator’s <code>next</code> method is ignored. If new properties are added to the target object
during enumeration, the newly added properties are not guaranteed to be processed in the active enumeration. A property name
will be returned by the iterator’s <code>next</code> method at most once in any enumeration.</p>
<p>Enumerating the properties of the target object includes enumerating properties of its prototype, and the prototype of
the prototype, and so on, recursively; but a property of a prototype is not processed if it has the same name as a property
that has already been processed by the iterator’s <code>next</code> method. The values of [[Enumerable]] attributes
are not considered when determining if a property of a prototype object has already been processed. The enumerable property
names of prototype objects must be obtained as if by invoking the prototype object’s [[Enumerate]] internal method.
[[Enumerate]] must obtain the own property keys of the target object as if by calling its [[OwnPropertyKeys]] internal
method. Property attributes of the target object must be obtained as if by calling its [[GetOwnProperty]] internal
method.</p>
<p class="Note">NOTE The following is an informative definition of an ECMAScript generator function that conforms to these
rules:</p>
<pre>function* enumerate(obj) {</pre>
<pre>let visited=new Set;</pre>
<pre>for (let key of <a href="#sec-reflect.ownkeys">Reflect.ownKeys</a>(obj)) {</pre>
<pre>if (typeof key === "string") {</pre>
<pre>let desc = <a href="#sec-reflect.getownpropertydescriptor">Reflect.getOwnPropertyDescriptor</a>(obj,key);</pre>
<pre>if (desc) {</pre>
<pre>visited.add(key);</pre>
<pre>if (desc.enumerable) yield key;</pre>
<pre>}</pre>
<pre>}</pre>
<pre>}</pre>
<pre>let proto = <a href="#sec-reflect.getprototypeof">Reflect.getPrototypeOf</a>(obj)</pre>
<pre>if (proto === null) return;</pre>
<pre>for (let protoName of <a href="#sec-reflect.enumerate">Reflect.enumerate</a>(proto)) {</pre>
<pre>if (!visited.has(protoName)) yield protoName;</pre>
<pre>}</pre>
<pre>}</pre>
</section>
<section id="sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">
<h1><span class="secnum" id="sec-9.1.12"><a href="#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys"
title="link to this section">9.1.12</a></span> [[OwnPropertyKeys]] ( )</h1>
<p>When the [[OwnPropertyKeys]] internal method of <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Let <i>keys</i> be a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> that is an integer index, in ascending
numeric index order
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> that is a String but is not an integer
index, in property creation order
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> that is a Symbol, in property creation
order
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>Return <i>keys</i>.</li>
</ol>
</section>
<section id="sec-objectcreate">
<h1><span class="secnum" id="sec-9.1.13"><a href="#sec-objectcreate" title="link to this section">9.1.13</a></span>
ObjectCreate(proto, internalSlotsList)</h1>
<p>The abstract operation ObjectCreate with argument <var>proto</var> (an object or null) is used to specify the runtime
creation of new ordinary objects. The optional argument <var>internalSlotsList</var> is a <a
href="#sec-list-and-record-specification-type">List</a> of the names of additional internal slots that must be defined as
part of the object. If the list is not provided, an empty <a href="#sec-list-and-record-specification-type">List</a> is
used. This abstract operation performs the following steps:</p>
<ol class="proc">
<li>If <i>internalSlotsList</i> was not provided, let <i>internalSlotsList</i> be an empty <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>obj</i> be a newly created object with an <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> for each name in <i>internalSlotsList</i>.</li>
<li>Set <i>obj</i>’s essential internal methods to the default ordinary object definitions specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
<i>proto</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
<b>true</b>.</li>
<li>Return <i>obj</i>.</li>
</ol>
</section>
<section id="sec-ordinarycreatefromconstructor">
<h1><span class="secnum" id="sec-9.1.14"><a href="#sec-ordinarycreatefromconstructor"
title="link to this section">9.1.14</a></span> OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto,
internalSlotsList )</h1>
<p>The abstract operation OrdinaryCreateFromConstructor creates an ordinary object whose [[Prototype]] value is retrieved
from a constructor’s <code>prototype</code> property, if it exists. Otherwise the intrinsic named by
<var>intrinsicDefaultProto</var> is used for [[Prototype]]. The optional <var>internalSlotsList</var> is a <a
href="#sec-list-and-record-specification-type">List</a> of the names of additional internal slots that must be defined as
part of the object. If the list is not provided, an empty <a href="#sec-list-and-record-specification-type">List</a> is
used. This abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>intrinsicDefaultProto</i> is a string value that is this
specification’s name of an intrinsic object. The corresponding object must be an intrinsic that is intended to
be used as the [[Prototype]] value of an object.</li>
<li>Let <i>proto</i> be <a href="#sec-getprototypefromconstructor">GetPrototypeFromConstructor</a>(<i>constructor</i>,
<i>intrinsicDefaultProto</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>proto</i>).</li>
<li>Return <a href="#sec-objectcreate">ObjectCreate</a>(<i>proto</i>, <i>internalSlotsList</i>).</li>
</ol>
</section>
<section id="sec-getprototypefromconstructor">
<h1><span class="secnum" id="sec-9.1.15"><a href="#sec-getprototypefromconstructor"
title="link to this section">9.1.15</a></span> GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )</h1>
<p>The abstract operation GetPrototypeFromConstructor determines the [[Prototype]] value that should be used to create an
object corresponding to a specific constructor. The value is retrieved from the constructor’s <code>prototype</code>
property, if it exists. Otherwise the intrinsic named by <var>intrinsicDefaultProto</var> is used for [[Prototype]]. This
abstract operation performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>intrinsicDefaultProto</i> is a string value that is this
specification’s name of an intrinsic object. The corresponding object must be an intrinsic that is intended to
be used as the [[Prototype]] value of an object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-isconstructor">IsConstructor</a> (<i>constructor</i>)
is <b>true</b>.</li>
<li>Let <i>proto</i> be <a href="#sec-get-o-p">Get</a>(<i>constructor</i>, <code>"prototype"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>proto</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>proto</i>) is not Object, then
<ol class="block">
<li>Let <i>realm</i> be <a href="#sec-getfunctionrealm">GetFunctionRealm</a>(<i>constructor</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>realm</i>).</li>
<li>Let <i>proto</i> be <i>realm’s</i> intrinsic object named <i>intrinsicDefaultProto</i>.</li>
</ol>
</li>
<li>Return <i>proto</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> If <i>constructor</i> does not supply a [[Prototype]] value, the default value that is
used is obtained from the <a href="#sec-code-realms">Code Realm</a> of the <i>constructor</i> function rather than from <a
href="#sec-execution-contexts">the running execution context</a>.</p>
</div>
</section>
</section>
<section id="sec-ecmascript-function-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.2"><a href="#sec-ecmascript-function-objects" title="link to this section">9.2</a></span>
ECMAScript Function Objects</h1>
<p>ECMAScript function objects encapsulate parameterized ECMAScript code closed over a <a
href="#sec-lexical-environments">lexical environment</a> and support the dynamic evaluation of that code. An ECMAScript
function object is an ordinary object and has the same internal slots and the same internal methods as other ordinary
objects. The code of an ECMAScript function object may be either <a href="#sec-strict-mode-code">strict mode code</a> (<a
href="#sec-strict-mode-code">10.2.1</a>) or non-<a href="#sec-strict-mode-code">strict mode code</a>. An ECMAScript function
object whose code is <a href="#sec-strict-mode-code">strict mode code</a> is called a <i>strict function</i>. One whose code
is not <a href="#sec-strict-mode-code">strict mode code</a> is called a <i>non-strict function</i>.</p>
<p>ECMAScript function objects have the additional internal slots listed in <a href="#table-27">Table 27</a>.</p>
<figure>
<figcaption><span id="table-27">Table 27</span> — Internal Slots of ECMAScript Function Objects</figcaption>
<table class="real-table">
<tr>
<th>Internal Slot</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>[[Environment]]</td>
<td><a href="#sec-lexical-environments">Lexical Environment</a></td>
<td>The <a href="#sec-lexical-environments">Lexical Environment</a> that the function was closed over. Used as the outer environment when evaluating the code of the function.</td>
</tr>
<tr>
<td>[[FormalParameters]]</td>
<td>Parse Node</td>
<td>The root parse node of the source text that defines the function’s formal parameter list.</td>
</tr>
<tr>
<td>[[FunctionKind]]</td>
<td>String</td>
<td>Either <code>"normal"</code>, <code>"classConstructor"</code> or <code>"generator"</code>.</td>
</tr>
<tr>
<td>[[ECMAScriptCode]]</td>
<td>Parse Node</td>
<td>The root parse node of the source text that defines the function’s body.</td>
</tr>
<tr>
<td>[[ConstructorKind]]</td>
<td>String</td>
<td>Either <code>"base"</code> or <code>"derived"</code>.</td>
</tr>
<tr>
<td>[[Realm]]</td>
<td><a href="#sec-code-realms">Realm</a> Record</td>
<td>The <a href="#sec-code-realms">Code Realm</a> in which the function was created and which provides any intrinsic objects that are accessed when evaluating the function.</td>
</tr>
<tr>
<td>[[ThisMode]]</td>
<td>(lexical, strict, global)</td>
<td>Defines how <code>this</code> references are interpreted within the formal parameters and code body of the function. <b>lexical</b> means that <code>this</code> refers to the <b>this</b> value of a lexically enclosing function. <b>strict</b> means that the <b>this</b> value is used exactly as provided by an invocation of the function. <b>global</b> means that a <b>this</b> value of <span class="value">undefined</span> is interpreted as a reference to the global object.</td>
</tr>
<tr>
<td>[[Strict]]</td>
<td>Boolean</td>
<td><span class="value">true</span> if this is a strict mode function, <span class="value">false</span> if this is not a strict mode function.</td>
</tr>
<tr>
<td>[[HomeObject]]</td>
<td>Object</td>
<td>If the function uses <code>super</code>, this is the object whose [[GetPrototypeOf]] provides the object where <code>super</code> property lookups begin.</td>
</tr>
</table>
</figure>
<p>All ECMAScript function objects have the [[Call]] internal method defined here. ECMAScript functions that are also
constructors in addition have the [[Construct]] internal method. ECMAScript function objects whose code is not <a
href="#sec-strict-mode-code">strict mode code</a> have the [[GetOwnProperty]] internal method defined here.</p>
</div>
<section id="sec-ecmascript-function-objects-call-thisargument-argumentslist">
<div class="front">
<h1><span class="secnum" id="sec-9.2.1"><a href="#sec-ecmascript-function-objects-call-thisargument-argumentslist"
title="link to this section">9.2.1</a></span> [[Call]] ( thisArgument, argumentsList)</h1>
<p>The [[Call]] internal method for an <a href="#sec-ecmascript-function-objects">ECMAScript function object</a>
<var>F</var> is called with parameters <var>thisArgument</var> and <var>argumentsList</var>, a <a
href="#sec-list-and-record-specification-type">List</a> of <a href="#sec-ecmascript-language-types">ECMAScript language
values</a>. The following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an <a
href="#sec-ecmascript-function-objects">ECMAScript function object</a>.</li>
<li>If <i>F</i>’s [[FunctionKind]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is
<code>"classConstructor"</code>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>callerContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>calleeContext</i> be <a href="#sec-prepareforordinarycall">PrepareForOrdinaryCall</a>(<i>F</i>,
<b>undefined</b>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>calleeContext</i> is now <a href="#sec-execution-contexts">the
running execution context</a>.</li>
<li>Perform <a href="#sec-ordinarycallbindthis">OrdinaryCallBindThis</a>(<i>F</i>, <i>calleeContext</i>,
<i>thisArgument</i>).</li>
<li>Let <i>result</i> be <a href="#sec-ordinarycallevaluatebody">OrdinaryCallEvaluateBody</a>(<i>F</i>,
<i>argumentsList</i>).</li>
<li>Remove <i>calleeContext</i> from <a href="#sec-execution-contexts">the execution context stack</a> and restore
<i>callerContext</i> as <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>If <i>result</i>.[[type]] is <span style="font-family: sans-serif">return</span>, return <a
href="#sec-normalcompletion">NormalCompletion</a>(<i>result</i>.[[value]]).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> When <i>calleeContext</i> is removed from <a href="#sec-execution-contexts">the
execution context stack</a> in step 8 it must not be destroyed if it is <a href="#sec-execution-contexts">suspended</a>
and retained for later resumption by an accessible generator object<i>.</i></p>
</div>
</div>
<section id="sec-prepareforordinarycall">
<h1><span class="secnum" id="sec-9.2.1.1"><a href="#sec-prepareforordinarycall"
title="link to this section">9.2.1.1</a></span> PrepareForOrdinaryCall( F, newTarget )</h1>
<p>When the abstract operation PrepareForOrdinaryCall is called with function object <var>F</var> <span
style="font-family: Times New Roman">and <a href="#sec-ecmascript-language-types">ECMAScript language value</a>
<i>newTarget</i></span>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>newTarget</i>) is Undefined or Object.</li>
<li>Let <i>callerContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>calleeContext</i> be a new <a href="#sec-execution-contexts">ECMAScript code execution context</a>.</li>
<li>Set the Function of <i>calleeContext</i> to <i>F</i>.</li>
<li>Let <i>calleeRealm</i> be the value of <i>F’s</i> [[Realm]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Set the <a href="#sec-code-realms">Realm</a> of <i>calleeContext</i> to <i>calleeRealm</i>.</li>
<li>Let <i>localEnv</i> be <a href="#sec-newfunctionenvironment">NewFunctionEnvironment</a>(<i>F</i>,
<i>newTarget</i>).</li>
<li>Set the <a href="#sec-execution-contexts">LexicalEnvironment</a> of <i>calleeContext</i> to <i>localEnv</i>.</li>
<li>Set the <a href="#sec-execution-contexts">VariableEnvironment</a> of <i>calleeContext</i> to <i>localEnv</i>.</li>
<li>If <i>callerContext</i> is not already <a href="#sec-execution-contexts">suspended</a>, <a
href="#sec-execution-contexts">Suspend</a> <i>callerContext</i>.</li>
<li>Push <i>calleeContext</i> onto <a href="#sec-execution-contexts">the execution context stack</a>;
<i>calleeContext</i> is now <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li><span style="font-family: sans-serif">NOTE Any exception objects produced after this point are associated
with</span> <i>calleeRealm</i>.</li>
<li>Return <i>calleeContext</i>.</li>
</ol>
</section>
<section id="sec-ordinarycallbindthis">
<h1><span class="secnum" id="sec-9.2.1.2"><a href="#sec-ordinarycallbindthis"
title="link to this section">9.2.1.2</a></span> OrdinaryCallBindThis ( F, calleeContext, thisArgument )</h1>
<p>When the abstract operation OrdinaryCallBindThis is called with function object <var>F</var>, <a
href="#sec-execution-contexts">execution context</a> <var>calleeContext</var>, and ECMAScript value
<var>thisArgument</var> the following steps are taken:</p>
<ol class="proc">
<li>Let <i>thisMode</i> be the value of <i>F</i>’s [[ThisMode]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>thisMode</i> is <span style="font-family: sans-serif">lexical</span>, return <a
href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
<li>Let <i>calleeRealm</i> be the value of <i>F’s</i> [[Realm]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>localEnv</i> be the <a href="#sec-execution-contexts">LexicalEnvironment</a> of <i>calleeContext</i>.</li>
<li>If <i>thisMode</i> is <span style="font-family: sans-serif">strict</span>, let <i>thisValue</i> be
<i>thisArgument</i>.</li>
<li>Else
<ol class="block">
<li>if <i>thisArgument</i> is <b>null</b> or <b>undefined</b>, then
<ol class="block">
<li>Let <i>thisValue</i> be <i>calleeRealm</i>.[[globalThis]].</li>
</ol>
</li>
<li>Else
<ol class="block">
<li>Let <i>thisValue</i> be <a href="#sec-toobject">ToObject</a>(<i>thisArgument</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>thisValue</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li><span style="font-family: sans-serif">NOTE <a href="#sec-toobject">ToObject</a> produces</span> <span
style="font-family: sans-serif">wrapper objects using</span> <i>calleeRealm</i>.</li>
</ol>
</li>
</ol>
</li>
<li>Let <i>envRec</i> be <i>localEnv</i>’s EnvironmentRecord.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: The next step never returns an <a
href="#sec-completion-record-specification-type">abrupt completion</a> because <i>envRec</i>.[[thisBindingStatus]]
is <code>"uninitialized"</code>.</li>
<li>Return <i>envRec</i>.<a href="#sec-bindthisvalue">BindThisValue</a>(<i>thisValue</i>).</li>
</ol>
</section>
<section id="sec-ordinarycallevaluatebody">
<h1><span class="secnum" id="sec-9.2.1.3"><a href="#sec-ordinarycallevaluatebody"
title="link to this section">9.2.1.3</a></span> OrdinaryCallEvaluateBody ( F, argumentsList )</h1>
<p>When the abstract operation OrdinaryCallEvaluateBody is called with function object <var>F</var> and <a
href="#sec-list-and-record-specification-type">List</a> <var>argumentsList</var> the following steps are taken:</p>
<ol class="proc">
<li>Let <i>status</i> be <a href="#sec-functiondeclarationinstantiation">FunctionDeclarationInstantiation</a>(<i>F</i>,
<i>argumentsList</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>)</li>
<li>Return the result of EvaluateBody of the parsed code that is the value of <i>F</i>'s [[ECMAScriptCode]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> passing <i>F</i> as the argument.</li>
</ol>
</section>
</section>
<section id="sec-ecmascript-function-objects-construct-argumentslist-newtarget">
<h1><span class="secnum" id="sec-9.2.2"><a href="#sec-ecmascript-function-objects-construct-argumentslist-newtarget"
title="link to this section">9.2.2</a></span> [[Construct]] ( argumentsList, newTarget)</h1>
<p>The [[Construct]] internal method for an <a href="#sec-ecmascript-function-objects">ECMAScript Function object</a>
<var>F</var> is called with parameters <var>argumentsList</var> and <span style="font-family: Times New
Roman"><i>newTarget</i>. <i>argumentsList</i></span> is a possibly empty <a
href="#sec-list-and-record-specification-type">List</a> of <a href="#sec-ecmascript-language-types">ECMAScript language
values</a>. The following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an <a href="#sec-ecmascript-function-objects">ECMAScript
function object</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>newTarget</i>) is Object.</li>
<li>Let <i>callerContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>kind</i> be <i>F</i>’s [[ConstructorKind]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>kind</i> is <code>"base"</code>, then
<ol class="block">
<li>Let <i>thisArgument</i> be <a
href="#sec-ordinarycreatefromconstructor">OrdinaryCreateFromConstructor</a>(<i>newTarget</i>,
<code>"%ObjectPrototype%"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>thisArgument</i>).</li>
</ol>
</li>
<li>Let <i>calleeContext</i> be <a href="#sec-prepareforordinarycall">PrepareForOrdinaryCall</a>(<i>F</i>,
<i>newTarget</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>calleeContext</i> is now <a href="#sec-execution-contexts">the
running execution context</a>.</li>
<li>If <i>kind</i> is <code>"base"</code>, perform <a href="#sec-ordinarycallbindthis">OrdinaryCallBindThis</a>(<i>F</i>,
<i>calleeContext</i>, <i>thisArgument</i>).</li>
<li>Let <i>constructorEnv</i> be the <a href="#sec-execution-contexts">LexicalEnvironment</a> of
<i>calleeContext</i>.</li>
<li>Let <i>envRec</i> be <i>constructorEnv</i>’s EnvironmentRecord.</li>
<li>Let <i>result</i> be <a href="#sec-ordinarycallevaluatebody">OrdinaryCallEvaluateBody</a>(<i>F</i>,
<i>argumentsList</i>).</li>
<li>Remove <i>calleeContext</i> from <a href="#sec-execution-contexts">the execution context stack</a> and restore
<i>callerContext</i> as <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>If <i>result</i>.[[type]] is <span style="font-family: sans-serif">return</span>, then
<ol class="block">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>result</i>.[[value]]) is Object, return <a
href="#sec-normalcompletion">NormalCompletion</a>(<i>result</i>.[[value]]).</li>
<li>If <i>kind</i> is <code>"base"</code>, return <a
href="#sec-normalcompletion">NormalCompletion</a>(<i>thisArgument</i>).</li>
<li>If <i>result</i>.[[value]] is not <b>undefined</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
<li>Else, <a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>Return <i>envRec</i>.GetThisBinding().</li>
</ol>
</section>
<section id="sec-functionallocate">
<h1><span class="secnum" id="sec-9.2.3"><a href="#sec-functionallocate" title="link to this section">9.2.3</a></span>
FunctionAllocate (functionPrototype, strict [,functionKind] )</h1>
<p>The abstract operation FunctionAllocate requires the two arguments <span style="font-family: Times New
Roman"><i>functionPrototype</i> and <i>strict</i>.</span> It also accepts one optional argument, <var>functionKind</var>.
FunctionAllocate performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>functionPrototype</i>) is Object.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: If <i>functionKind</i> is present, its value is either
<code>"normal"</code>, <code>"non-constructor"</code> or <code>"generator"</code>.</li>
<li>If <i>functionKind</i> is not present, let <i>functionKind</i> be <code>"normal"</code>.</li>
<li>If <i>functionKind</i> is <code>"non-constructor"</code>, then
<ol class="block">
<li>Let <i>functionKind</i> be <code>"normal"</code>.</li>
<li>Let <i>needsConstruct</i> be <b>false</b>.</li>
</ol>
</li>
<li>Else let <i>needsConstruct</i> be <b>true</b>.</li>
<li>Let <i>F</i> be a newly created <a href="#sec-ecmascript-function-objects">ECMAScript function object</a> with the
internal slots listed in <a href="#table-27">Table 27</a>. All of those internal slots are initialized to
<b>undefined</b>.</li>
<li>Set <i>F</i>’s essential internal methods to the default ordinary object definitions specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set <i>F</i>’s [[Call]] internal method to the definition specified in <a
href="#sec-ecmascript-function-objects-call-thisargument-argumentslist">9.2.1</a>.</li>
<li>If <i>needsConstruct</i> is <b>true</b>, then
<ol class="block">
<li>Set <i>F</i>’s [[Construct]] internal method to the definition specified in <a
href="#sec-ecmascript-function-objects-construct-argumentslist-newtarget">9.2.2</a>.</li>
<li>If <i>functionKind</i> is <code>"generator"</code>, set the [[ConstructorKind]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<code>"derived"</code>.</li>
<li>Else, set the [[ConstructorKind]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>F</i> to <code>"base"</code>.</li>
<li>NOTE Generator functions are tagged as <code>"derived"</code> constructors to prevent [[Construct]] from
preallocating a generator instance. Generator instance objects are allocated when EvaluateBody is applied to the
<span class="nt">GeneratorBody</span> of a generator function.</li>
</ol>
</li>
<li>Set the [[Strict]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<i>strict</i>.</li>
<li>Set the [[FunctionKind]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<i>functionKind</i>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<i>functionPrototype</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<b>true</b>.</li>
<li>Set the [[Realm]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to <a
href="#sec-execution-contexts">the running execution context</a>’s <a href="#sec-code-realms">Realm</a>.</li>
<li>Return <i>F</i>.</li>
</ol>
</section>
<section id="sec-functioninitialize">
<h1><span class="secnum" id="sec-9.2.4"><a href="#sec-functioninitialize" title="link to this section">9.2.4</a></span>
FunctionInitialize (F, kind, ParameterList, Body, Scope)</h1>
<p>The abstract operation FunctionInitialize requires the arguments: a function object <var>F</var>, <var>kind</var> which
is one of (Normal, Method, Arrow), a parameter list production specified by <span class="nt">ParameterList</span>, a body
production specified by <span class="nt">Body</span>, a <a href="#sec-lexical-environments">Lexical Environment</a>
specified by <span style="font-family: Times New Roman"><i>Scope</i>.</span> FunctionInitialize performs the following
steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an extensible object that does not have a
<code>length</code> own property.</li>
<li>Let <i>len</i> be the ExpectedArgumentCount of <i>ParameterList</i>.</li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>F</i>, <code>"length"</code>,
PropertyDescriptor{[[Value]]: <i>len</i>, [[Writable]]: <b>false</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>true</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Let <i>Strict</i> be the value of the [[Strict]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> of <i>F</i>.</li>
<li>Set the [[Environment]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to the
value of <i>Scope</i>.</li>
<li>Set the [[FormalParameters]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i>
to <i>ParameterList</i> .</li>
<li>Set the [[ECMAScriptCode]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<i>Body</i>.</li>
<li>If <i>kind</i> is <span style="font-family: sans-serif">Arrow</span>, set the [[ThisMode]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to <span style="font-family:
sans-serif">lexical</span>.</li>
<li>Else if <i>Strict</i> is <b>true</b>, set the [[ThisMode]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to <span style="font-family:
sans-serif">strict</span>.</li>
<li>Else set the [[ThisMode]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<span style="font-family: sans-serif">global</span>.</li>
<li>Return <i>F</i>.</li>
</ol>
</section>
<section id="sec-functioncreate">
<h1><span class="secnum" id="sec-9.2.5"><a href="#sec-functioncreate" title="link to this section">9.2.5</a></span>
FunctionCreate (kind, ParameterList, Body, Scope, Strict, prototype)</h1>
<p>The abstract operation FunctionCreate requires the arguments: <var>kind</var> which is one of (Normal, Method, Arrow), a
parameter list production specified by <span class="nt">ParameterList</span>, a body production specified by <span
class="nt">Body</span>, a <a href="#sec-lexical-environments">Lexical Environment</a> specified by <span
class="nt">Scope</span>, a Boolean flag <span class="nt">Strict</span>, and optionally, an object <span style="font-family:
Times New Roman"><i>prototype</i>.</span> FunctionCreate performs the following steps:</p>
<ol class="proc">
<li>If the <i>prototype</i> argument was not passed, then
<ol class="block">
<li>Let <i>prototype</i> be the intrinsic object %FunctionPrototype%.</li>
</ol>
</li>
<li>If <i>kind</i> is not <span style="font-family: sans-serif">Normal</span>, let <i>allocKind</i> be
<code>"non-constructor"</code>.</li>
<li>Else let <i>allocKind</i> be <code>"normal"</code>.</li>
<li>Let <i>F</i> be <a href="#sec-functionallocate">FunctionAllocate</a>(<i>prototype</i>, <i>Strict</i>,
<i>allocKind</i>).</li>
<li>Return <a href="#sec-functioninitialize">FunctionInitialize</a>(<i>F</i>, <i>kind</i>, <i>ParameterList</i>,
<i>Body</i>, <i>Scope</i>).</li>
</ol>
</section>
<section id="sec-generatorfunctioncreate">
<h1><span class="secnum" id="sec-9.2.6"><a href="#sec-generatorfunctioncreate" title="link to this section">9.2.6</a></span>
GeneratorFunctionCreate (kind, ParameterList, Body, Scope, Strict)</h1>
<p>The abstract operation GeneratorFunctionCreate requires the arguments: <var>kind</var> which is one of (Normal, Method),
a parameter list production specified by <span class="nt">ParameterList</span>, a body production specified by <span
class="nt">Body</span>, a <a href="#sec-lexical-environments">Lexical Environment</a> specified by <span
class="nt">Scope</span>, and a Boolean flag <span class="nt">Strict</span>. GeneratorFunctionCreate performs the following
steps:</p>
<ol class="proc">
<li>Let <i>functionPrototype</i> be the intrinsic object %Generator%.</li>
<li>Let <i>F</i> be <a href="#sec-functionallocate">FunctionAllocate</a>(<i>functionPrototype</i>, <i>Strict</i>,
<code>"generator"</code>).</li>
<li>Return <a href="#sec-functioninitialize">FunctionInitialize</a>(<i>F</i>, <i>kind</i>, <i>ParameterList</i>,
<i>Body</i>, <i>Scope</i>).</li>
</ol>
</section>
<section id="sec-addrestrictedfunctionproperties">
<div class="front">
<h1><span class="secnum" id="sec-9.2.7"><a href="#sec-addrestrictedfunctionproperties"
title="link to this section">9.2.7</a></span> AddRestrictedFunctionProperties ( F, realm )</h1>
<p>The abstract operation AddRestrictedFunctionProperties is called with a function object <var>F</var> and <a
href="#sec-code-realms">Realm</a> Record <var>realm</var> as its argument. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>realm</i>.[[intrinsics]].[[<span style="font-family:
sans-serif">%ThrowTypeError%]] exists and has been initialized.</span></li>
<li>Let <i>thrower</i> be <i>realm</i>.[[intrinsics]].[[<span style="font-family:
sans-serif">%ThrowTypeError%]].</span></li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>F</i>, <code>"caller"</code>,
PropertyDescriptor {[[Get]]: <i>thrower</i>, [[Set]]: <i>thrower</i>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>true</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>F</i> , <code>"arguments"</code>,
PropertyDescriptor {[[Get]]: <i>thrower</i>, [[Set]]: <i>thrower</i>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>true</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: The above returned value is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</div>
<section id="sec-%throwtypeerror%">
<h1><span class="secnum" id="sec-9.2.7.1"><a href="#sec-%throwtypeerror%" title="link to this section">9.2.7.1</a></span>
%ThrowTypeError% ( )</h1>
<p>The %ThrowTypeError% intrinsic is an anonymous built-in function object that is defined once for each <a
href="#sec-code-realms">Realm</a>. When %ThrowTypeError% is called it performs the following steps:</p>
<ol class="proc">
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
<p>The value of the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of a
%ThrowTypeError% function is <span class="value">false</span>.</p>
<p>The <code>length</code> property of a %ThrowTypeError% function has the attributes { [[Writable]]: <b>false</b>,
[[Enumerable]]: <b>false</b>, [[Configurable]]: <b>false</b> }.</p>
</section>
</section>
<section id="sec-makeconstructor">
<h1><span class="secnum" id="sec-9.2.8"><a href="#sec-makeconstructor" title="link to this section">9.2.8</a></span>
MakeConstructor (F, writablePrototype, prototype)</h1>
<p>The abstract operation MakeConstructor requires a Function argument <var>F</var> and optionally, a Boolean
<var>writablePrototype</var> and an object <var>prototype</var>. If <var>prototype</var> is provided it is assumed to
already contain, if needed, a <code>"constructor"</code> property whose value is <var>F</var>. This operation converts
<var>F</var> into a constructor by performing the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an <a href="#sec-ecmascript-function-objects">ECMAScript
function object</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> has a [[Construct]] internal method.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an extensible object that does not have a
<code>prototype</code> own property.</li>
<li>Let <i>installNeeded</i> be <b>false</b>.</li>
<li>If the <i>prototype</i> argument was not provided, then
<ol class="block">
<li>Let <i>installNeeded</i> be <b>true</b>.</li>
<li>Let <i>prototype</i> be <a href="#sec-objectcreate">ObjectCreate</a>(<span style="font-family:
sans-serif">%ObjectPrototype%</span>).</li>
</ol>
</li>
<li>If the <i>writablePrototype</i> argument was not provided, then
<ol class="block">
<li>Let <i>writablePrototype</i> be <b>true</b>.</li>
</ol>
</li>
<li>If <i>installNeeded</i>, then
<ol class="block">
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>prototype</i>,
<code>"constructor"</code>, PropertyDescriptor{[[Value]]: <i>F</i>, [[Writable]]: <i>writablePrototype</i>,
[[Enumerable]]: <b>false</b>, [[Configurable]]: <i>writablePrototype</i> }).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>F</i>,
<code>"prototype"</code>, PropertyDescriptor{[[Value]]: <i>prototype</i>, [[Writable]]: <i>writablePrototype</i>,
[[Enumerable]]: <b>false</b>, [[Configurable]]: <b>false</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</section>
<section id="sec-makeclassconstructor">
<h1><span class="secnum" id="sec-9.2.9"><a href="#sec-makeclassconstructor" title="link to this section">9.2.9</a></span>
MakeClassConstructor ( F)</h1>
<p>The abstract operation MakeClassConstructor with argument <var>F</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an <a href="#sec-ecmascript-function-objects">ECMAScript
function object</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i>’s [[FunctionKind]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is <code>"normal"</code>.</li>
<li>Set <i>F</i>’s [[FunctionKind]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<code>"classConstructor"</code>.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</section>
<section id="sec-makemethod">
<h1><span class="secnum" id="sec-9.2.10"><a href="#sec-makemethod" title="link to this section">9.2.10</a></span> MakeMethod
( F, homeObject)</h1>
<p>The abstract operation MakeMethod with arguments <var>F</var> and <var>homeObject</var> configures <var>F</var> as a
method by performing the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an <a href="#sec-ecmascript-function-objects">ECMAScript
function object</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>homeObject</i> ) is Object.</li>
<li>Set the [[HomeObject]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>F</i> to
<i>homeObject</i>.</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</section>
<section id="sec-setfunctionname">
<h1><span class="secnum" id="sec-9.2.11"><a href="#sec-setfunctionname" title="link to this section">9.2.11</a></span>
SetFunctionName (F, name, prefix)</h1>
<p>The abstract operation SetFunctionName requires a Function argument <var>F</var>, a String or Symbol argument
<var>name</var> and optionally a String argument <var>prefix</var>. This operation adds a <code>name</code> property to
<var>F</var> by performing the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>F</i> is an extensible object that does not have a
<code>name</code> own property.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>name</i>)
is either Symbol or String.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: If <i>prefix</i> was passed then <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>prefix</i>) is String.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>name</i>) is Symbol, then
<ol class="block">
<li>Let <i>description</i> be <i>name</i>’s [[Description]] value.</li>
<li>If <i>description</i> is <b>undefined</b>, let <i>name</i> be the empty String.</li>
<li>Else, let <i>name</i> be the concatenation of <code>"["</code>, <i>description</i>, and <code>"]"</code>.</li>
</ol>
</li>
<li>If <i>prefix</i> was passed, then
<ol class="block">
<li>Let <i>name</i> be the concatenation of <i>prefix</i>, code unit 0x0020 (SPACE), and <i>name</i>.</li>
</ol>
</li>
<li>Return <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>F</i>, <code>"name"</code>,
PropertyDescriptor{[[Value]]: <i>name</i>, [[Writable]]: <b>false</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>true</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: the result is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</section>
<section id="sec-functiondeclarationinstantiation">
<h1><span class="secnum" id="sec-9.2.12"><a href="#sec-functiondeclarationinstantiation"
title="link to this section">9.2.12</a></span> FunctionDeclarationInstantiation(func, argumentsList)</h1>
<div class="note">
<p><span class="nh">NOTE</span> When an <a href="#sec-execution-contexts">execution context</a> is established for
evaluating an ECMAScript function a new function <a href="#sec-environment-records">Environment Record</a> is created and
bindings for each formal parameter are instantiated in that <a href="#sec-environment-records">Environment Record</a>.
Each declaration in the function body is also instantiated. If the function’s formal parameters do not include any
default value initializers then the body declarations are instantiated in the same <a
href="#sec-environment-records">Environment Record</a> as the parameters. If default value parameter initializers exist, a
second <a href="#sec-environment-records">Environment Record</a> is created for the body declarations. Formal parameters
and functions are initialized as part of FunctionDeclarationInstantiation. All other bindings are initialized during
evaluation of the function body.</p>
</div>
<p>FunctionDeclarationInstantiation is performed as follows using arguments <var>func</var> and <var>argumentsList</var>.
<var>func</var> is the function object for which the <a href="#sec-execution-contexts">execution context</a> is being
established.</p>
<ol class="proc">
<li>Let <i>calleeContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>env</i> be the <a href="#sec-execution-contexts">LexicalEnvironment</a> of <i>calleeContext</i>.</li>
<li>Let <i>envRec</i> be <i>env</i>’s <a href="#sec-environment-records">Environment Record</a>.</li>
<li>Let <i>code</i> be the value of the [[ECMAScriptCode]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>func</i>.</li>
<li>Let <i>strict</i> be the value of the [[Strict]] <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> of <i>func</i>.</li>
<li>Let <i>formals</i> be the value of the [[FormalParameters]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>func</i>.</li>
<li>Let <i>parameterNames</i> be the BoundNames of <i>formals</i>.</li>
<li>If <i>parameterNames</i> has any duplicate entries, let <i>hasDuplicates</i> be <b>true</b>. Otherwise, let
<i>hasDuplicates</i> be <b>false</b>.</li>
<li>Let <i>simpleParameterList</i> be IsSimpleParameterList of <i>formals</i>.</li>
<li>Let <i>hasParameterExpressions</i> be ContainsExpression of <i>formals.</i></li>
<li>Let <i>varNames</i> be the VarDeclaredNames of <i>code</i>.</li>
<li>Let <i>varDeclarations</i> be the VarScopedDeclarations of <i>code</i>.</li>
<li>Let <i>lexicalNames</i> be the LexicallyDeclaredNames of <i>code</i>.</li>
<li>Let <i>functionNames</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>functionsToInitialize</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>For each <i>d</i> in <i>varDeclarations</i>, in reverse list order do
<ol class="block">
<li>If <i>d</i> is neither a <i>VariableDeclaration</i> or a <i>ForBinding</i>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>d</i> is either a <i>FunctionDeclaration</i> or a
<i>GeneratorDeclaration</i>.</li>
<li>Let <i>fn</i> be the sole element of the BoundNames of <i>d.</i></li>
<li>If <i>fn</i> is not an element of <i>functionNames</i>, then
<ol class="block">
<li>Insert <i>fn</i> as the first element of <i>functionNames</i>.</li>
<li>NOTE If there are multiple <span style="font-family: Times New Roman"><i>FunctionDeclarations</i> or
<i>GeneratorDeclarations</i></span> for the same name, the last declaration is used.</li>
<li>Insert <i>d</i> as the first element of <i>functionsToInitialize</i>.</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Let <i>argumentsObjectNeeded</i> be <b>true</b>.</li>
<li>If the value of the [[ThisMode]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of
<i>func</i> is <span style="font-family: sans-serif">lexical</span>, then
<ol class="block">
<li>NOTE Arrow functions never have an arguments objects.</li>
<li>Let <i>argumentsObjectNeeded</i> be <b>false</b>.</li>
</ol>
</li>
<li>Else if <code>"arguments"</code> is an element of <i>parameterNames</i>, then
<ol class="block">
<li>Let <i>argumentsObjectNeeded</i> be <b>false</b>.</li>
</ol>
</li>
<li>Else if <i>hasParameterExpressions</i> is <b>false</b>, then
<ol class="block">
<li>If <code>"arguments"</code> is an element of <i>functionNames</i> or if <code>"arguments"</code> is an element of
<i>lexicalNames</i>, then
<ol class="block">
<li>Let <i>argumentsObjectNeeded</i> be <b>false</b>.</li>
</ol>
</li>
</ol>
</li>
<li>For each String <i>paramName</i> in <i>parameterNames</i>, do
<ol class="block">
<li>Let <i>alreadyDeclared</i> be <i>envRec</i>.HasBinding(<i>paramName</i>).</li>
<li>NOTE Early errors ensure that duplicate parameter names can only occur in non-strict functions that do not have
parameter default values or rest parameters.</li>
<li>If <i>alreadyDeclared</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>envRec</i>.CreateMutableBinding(<i>paramName</i>).</li>
<li>If <i>hasDuplicates</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>envRec</i>.InitializeBinding(<i>paramName</i>, <b>undefined</b>).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a> for either of the above
operations.</li>
</ol>
</li>
</ol>
</li>
<li>If <i>argumentsObjectNeeded</i> is <b>true</b>, then
<ol class="block">
<li>If <i>strict</i> is <b>true</b> or if <i>simpleParameterList</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>ao</i> be <a
href="#sec-createunmappedargumentsobject">CreateUnmappedArgumentsObject</a>(<i>argumentsList</i>)<i>.</i></li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>NOTE mapped argument object is only provided for non-strict functions that don’t have a rest parameter,
any parameter default value initializers, or any destructured parameters .</li>
<li>Let <i>ao</i> be <a href="#sec-createmappedargumentsobject">CreateMappedArgumentsObject</a>(<i>func</i>,
<i>formals</i>, <i>argumentsList</i>, <i>env</i>).</li>
</ol>
</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>ao</i>).</li>
<li>If <i>strict</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>envRec</i>.CreateImmutableBinding(<code>"arguments"</code>).</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>status</i> be <i>envRec</i>.CreateMutableBinding(<code>"arguments"</code>).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li><a href="#sec-call">Call</a> <i>envRec</i>.InitializeBinding(<code>"arguments"</code>, <i>ao</i>).</li>
<li>Append <code>"arguments"</code> to <i>parameterNames</i>.</li>
</ol>
</li>
<li>Let <i>iteratorRecord</i> be Record {[[iterator]]: <a
href="#sec-createlistiterator">CreateListIterator</a>(<i>argumentsList</i>), [[done]]: <b>false</b>}.</li>
<li>If <i>hasDuplicates</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>formalStatus</i> be IteratorBindingInitialization for <i>formals</i> with <i>iteratorRecord</i> and
<b>undefined</b> as arguments.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>formalStatus</i> be IteratorBindingInitialization for <i>formals</i> with <i>iteratorRecord</i> and
<i>envRec</i> as arguments.</li>
</ol>
</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>formalStatus</i>).</li>
<li>If <i>hasParameterExpressions</i> is <b>false</b>, then
<ol class="block">
<li>NOTE Only a single <a href="#sec-lexical-environments">lexical environment</a> is needed for the parameters and
top-level vars.</li>
<li>Let <i>instantiatedVarNames</i> be a copy of the <a href="#sec-list-and-record-specification-type">List</a>
<i>parameterNames</i>.</li>
<li>For each <i>n</i> in <i>varNames</i>, do
<ol class="block">
<li>If <i>n</i> is not an element of <i>instantiatedVarNames</i>, then
<ol class="block">
<li>Append <i>n</i> to <i>instantiatedVarNames</i>.</li>
<li>Let <i>status</i> be <i>envRec</i>.CreateMutableBinding(<i>n</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li><a href="#sec-call">Call</a> <i>envRec</i>.InitializeBinding(<i>n</i>, <b>undefined</b>).</li>
</ol>
</li>
</ol>
</li>
<li>Let <i>varEnv</i> be <i>env</i>.</li>
<li>Let <i>varEnvRec</i> be <i>envRec</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>NOTE A separate <a href="#sec-environment-records">Environment Record</a> is needed to ensure that closures
created by expressions in the formal parameter list do not have visibility of declarations in the function
body.</li>
<li>Let <i>varEnv</i> be <a href="#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a>(<i>env</i>).</li>
<li>Let <i>varEnvRec</i> be <i>varEnv</i>’s EnvironmentRecord.</li>
<li>Set the <a href="#sec-execution-contexts">VariableEnvironment</a> of <i>calleeContext</i> to <i>varEnv</i>.</li>
<li>Let <i>instantiatedVarNames</i> be a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>For each <i>n</i> in <i>varNames</i>, do
<ol class="block">
<li>If <i>n</i> is not an element of <i>instantiatedVarNames</i>, then
<ol class="block">
<li>Append <i>n</i> to <i>instantiatedVarNames</i>.</li>
<li>Let <i>status</i> be <i>varEnvRec</i>.CreateMutableBinding(<i>n</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>n</i> is not an element of <i>parameterNames</i> or if <i>n</i> is an element of
<i>functionNames</i>, let <i>initialValue</i> be <b>undefined</b>.</li>
<li>else,
<ol class="block">
<li>Let <i>initialValue</i> be <i>envRec.</i>GetBindingValue(<i>n</i>, <b>false</b>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>initialValue</i>).</li>
</ol>
</li>
<li><a href="#sec-call">Call</a> <i>varEnvRec</i>.InitializeBinding(<i>n</i>, <i>initialValue</i>).</li>
<li>NOTE vars whose names are the same as a formal parameter, initially have the same value as the
corresponding initialized parameter.</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>NOTE: Annex <a href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics">B.3.3</a> adds
additional steps at this point.</li>
<li>If <i>strict</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>lexEnv</i> be <a href="#sec-newdeclarativeenvironment">NewDeclarativeEnvironment</a>(<i>varEnv</i>).</li>
<li>NOTE: Non-strict functions use a separate lexical <a href="#sec-environment-records">Environment Record</a> for
top-level lexical declarations so that a direct <code>eval</code> (<a
href="#sec-function-calls-runtime-semantics-evaluation">see 12.3.4.1</a>) can determine whether any var scoped
declarations introduced by the eval code conflict with pre-existing top-level lexically scoped declarations. This
is not needed for strict functions because a strict direct <code>eval</code> always places all declarations into a
new <a href="#sec-environment-records">Environment Record</a>.</li>
</ol>
</li>
<li>Else, let <i>lexEnv</i> be <i>varEnv</i>.</li>
<li>Let <i>lexEnvRec</i> be <i>lexEnv</i>’s EnvironmentRecord.</li>
<li>Set the <a href="#sec-execution-contexts">LexicalEnvironment</a> of <i>calleeContext</i> to <i>lexEnv</i>.</li>
<li>Let <i>lexDeclarations</i> be the LexicallyScopedDeclarations of <i>code</i>.</li>
<li>For each element <i>d</i> in <i>lexDeclarations</i> do
<ol class="block">
<li>NOTE A lexically declared name cannot be the same as a function/generator declaration, formal parameter, or a var
name. Lexically declared names are only instantiated here but not initialized.</li>
<li>For each element <i>dn</i> of the BoundNames of <i>d</i> do
<ol class="block">
<li>If IsConstantDeclaration of <i>d</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>status</i> be <i>lexEnvRec</i>.CreateImmutableBinding(<i>dn</i>, <b>true</b>).</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>status</i> be <i>lexEnvRec</i>.CreateMutableBinding(<i>dn</i>, <b>false</b>).</li>
</ol>
</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</li>
<li>For each parsed grammar phrase <i>f</i> in <i>functionsToInitialize</i>, do
<ol class="block">
<li>Let <i>fn</i> be the sole element of the BoundNames of <i>f.</i></li>
<li>Let <i>fo</i> be the result of performing InstantiateFunctionObject for <i>f</i> with argument <i>lexEnv</i>.</li>
<li>Let <i>status</i> be <i>varEnvRec</i>.SetMutableBinding(<i>fn</i>, <i>fo</i>, <b>false</b>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<span style="font-family: sans-serif">empty</span>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> <a
href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics">B.3.3</a> provides an extension to the
above algorithm that is necessary for backwards compatibility with web browser implementations of ECMAScript that predate
the sixth edition of ECMA-262.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> Parameter <i>Initializers</i> may contain direct eval expressions (<a
href="#sec-function-calls-runtime-semantics-evaluation">12.3.4.1</a>). Any top level declarations of such evals are only
visible to the eval code (<a href="#sec-types-of-source-code">10.2</a>). The creation of the environment for such
declarations is described in <a
href="#sec-function-definitions-runtime-semantics-iteratorbindinginitialization">14.1.18</a>.</p>
</div>
</section>
</section>
<section id="sec-built-in-function-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.3"><a href="#sec-built-in-function-objects" title="link to this section">9.3</a></span>
Built-in Function Objects</h1>
<p>The built-in function objects defined in this specification may be implemented as either ECMAScript function objects (<a
href="#sec-ecmascript-function-objects">9.2</a>) whose behaviour is provided using ECMAScript code or as implementation
provided exotic function objects whose behaviour is provided in some other manner. In either case, the effect of calling
such functions must conform to their specifications. An implementation may also provide additional built-in function objects
that are not defined in this specification.</p>
<p>If a built-in function object is implemented as an exotic object it must have the ordinary object behaviour specified in
<a href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>. All such exotic function objects also have
[[Prototype]], [[Extensible]], and [[Realm]] internal slots.</p>
<p>Unless otherwise specified every built-in function object has the %FunctionPrototype% object (<a
href="#sec-properties-of-the-function-prototype-object">19.2.3</a>) as the initial value of its [[Prototype]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</p>
<p>The behaviour specified for each built-in function via algorithm steps or other means is the specification of the
function body behaviour for both [[Call]] and [[Construct]] invocations of the function. However, [[Construct]] invocation
is not supported by all built-in functions. For each built-in function, when invoked with [[Call]], the [[Call]]
<var>thisArgument</var> provides the <span class="value">this</span> value, the [[Call]] <var>argumentsList</var> provides
the named parameters, and the NewTarget value is <span class="value">undefined</span>. When invoked with [[Construct]], the
<span class="value">this</span> value is uninitialized, the [[Construct]] <var>argumentsList</var> provides the named
parameters, and the [[Construct]] <var>newTarget</var> parameter provides the NewTarget value. If the built-in function is
implemented as an <a href="#sec-ecmascript-function-objects">ECMAScript function object</a> then this specified behaviour
must be implemented by the ECMAScript code that is the body of the function. Built-in functions that are ECMAScript function
objects must be strict mode functions. If a built-in constructor has any [[Call]] behaviour other than throwing a <span
class="value">TypeError</span> exception, an ECMAScript implementation of the function must be done in a manner that does
not cause the function’s [[FunctionKind]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>
to have the value <code>"classConstructor"</code>.</p>
<p>Built-in function objects that are not identified as constructors do not implement the [[Construct]] internal method
unless otherwise specified in the description of a particular function. When a built-in constructor is called as part of a
<code>new</code> expression the <var>argumentsList</var> parameter of the invoked [[Construct]] internal method provides the
values for the built-in constructor’s named parameters.</p>
<p>Built-in functions that are not constructors do not have a <code>prototype</code> property unless otherwise specified in
the description of a particular function.</p>
<p>If a built-in function object is not implemented as an ECMAScript function it must provide [[Call]] and [[Construct]]
internal methods that conform to the following definitions:</p>
</div>
<section id="sec-built-in-function-objects-call-thisargument-argumentslist">
<h1><span class="secnum" id="sec-9.3.1"><a href="#sec-built-in-function-objects-call-thisargument-argumentslist"
title="link to this section">9.3.1</a></span> [[Call]] ( thisArgument, argumentsList)</h1>
<p>The [[Call]] internal method for a built-in function object <var>F</var> is called with parameters
<var>thisArgument</var> and <var>argumentsList</var>, a <a href="#sec-list-and-record-specification-type">List</a> of <a
href="#sec-ecmascript-language-types">ECMAScript language values</a>. The following steps are taken:</p>
<ol class="proc">
<li>Let <i>callerContext</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>If <i>callerContext</i> is not already <a href="#sec-execution-contexts">suspended</a>, <a
href="#sec-execution-contexts">Suspend</a> <i>callerContext</i>.</li>
<li>Let <i>calleeContext</i> be a new <a href="#sec-execution-contexts">ECMAScript code execution context</a>.</li>
<li>Set the Function of <i>calleeContext</i> to <i>F</i>.</li>
<li>Let <i>calleeRealm</i> be the value of <i>F’s</i> [[Realm]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Set the <a href="#sec-code-realms">Realm</a> of <i>calleeContext</i> to <i>calleeRealm</i>.</li>
<li>Perform any necessary implementation defined initialization of <i>calleeContext</i>.</li>
<li>Push <i>calleeContext</i> onto <a href="#sec-execution-contexts">the execution context stack</a>; <i>calleeContext</i>
is now <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>result</i> be the <a href="#sec-completion-record-specification-type">Completion Record</a> that is the result
of evaluating <i>F</i> in an implementation defined manner that conforms to the specification of <i>F</i>.
<i>thisArgument</i> is the <b>this</b> value, <i>argumentsList</i> provides the named parameters, and the NewTarget
value is <b>undefined</b>.</li>
<li>Remove <i>calleeContext</i> from <a href="#sec-execution-contexts">the execution context stack</a> and restore
<i>callerContext</i> as <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Return <i>result</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> When <i>calleeContext</i> is removed from <a href="#sec-execution-contexts">the
execution context stack</a> it must not be destroyed if it has been <a href="#sec-execution-contexts">suspended</a> and
retained by an accessible generator object for later resumption<i>.</i></p>
</div>
</section>
<section id="sec-built-in-function-objects-construct-argumentslist-newtarget">
<h1><span class="secnum" id="sec-9.3.2"><a href="#sec-built-in-function-objects-construct-argumentslist-newtarget"
title="link to this section">9.3.2</a></span> [[Construct]] (argumentsList, newTarget)</h1>
<p>The [[Construct]] internal method for built-in function object <var>F</var> is called with parameters
<var>argumentsList</var> and <var>newTarget</var>. The steps performed are the same as [[Call]] (<a
href="#sec-built-in-function-objects-call-thisargument-argumentslist">see 9.3.1</a>) except that step 9 is replaced by:</p>
<ol class="proc">
<li>Let <i>result</i> be the <a href="#sec-completion-record-specification-type">Completion Record</a> that is the result
of evaluating <i>F</i> in an implementation defined manner that conforms to the specification of <i>F</i>. The
<b>this</b> value is uninitialized, <i>argumentsList</i> provides the named parameters, and <i>newTarget</i> provides
the NewTarget value.</li>
</ol>
</section>
<section id="sec-createbuiltinfunction">
<h1><span class="secnum" id="sec-9.3.3"><a href="#sec-createbuiltinfunction" title="link to this section">9.3.3</a></span>
CreateBuiltinFunction(realm, steps, prototype, internalSlotsList)</h1>
<p>The abstract operation CreateBuiltinFunction takes arguments <span style="font-family: Times New Roman"><i>realm</i>,
<i>prototype</i>,</span> and <var>steps</var>. The optional argument <var>internalSlotsList</var> is a <a
href="#sec-list-and-record-specification-type">List</a> of the names of additional internal slots that must be defined as
part of the object. If the list is not provided, an empty <a href="#sec-list-and-record-specification-type">List</a> is
used. CreateBuiltinFunction returns a built-in function object created by the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>realm</i> is a <a href="#sec-code-realms">Realm</a> Record.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>steps</i> is either a set of algorithm steps or other definition
of a functions behaviour provided in this specification.</li>
<li>Let <i>func</i> be a new built-in function object that when called performs the action described by <i>steps</i>. The
new function object has internal slots whose names are the elements of <i>internalSlotsList</i>. The initial value of
each of those internal slots is <b>undefined<i>.</i></b></li>
<li>Set the [[Realm]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>func</i> to
<i>realm</i>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>func</i> to
<i>prototype</i>.</li>
<li>Return <i>func</i>.</li>
</ol>
<p>Each built-in function defined in this specification is created as if by calling the CreateBuiltinFunction abstract
operation, unless otherwise specified.</p>
</section>
</section>
<section id="sec-built-in-exotic-object-internal-methods-and-slots">
<div class="front">
<h1><span class="secnum" id="sec-9.4"><a href="#sec-built-in-exotic-object-internal-methods-and-slots"
title="link to this section">9.4</a></span> Built-in Exotic Object Internal Methods and Slots</h1>
<p>This specification defines several kinds of built-in exotic objects. These objects generally behave similar to ordinary
objects except for a few specific situations. The following exotic objects use the ordinary object internal methods except
where it is explicitly specified otherwise below:</p>
</div>
<section id="sec-bound-function-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.1"><a href="#sec-bound-function-exotic-objects"
title="link to this section">9.4.1</a></span> Bound Function Exotic Objects</h1>
<p>A <i>bound function</i> is an exotic object that wraps another function object. A bound function is callable (it has a
[[Call]] internal method and may have a [[Construct]] internal method). Calling a bound function generally results in a
call of its wrapped function.</p>
<p>Bound function objects do not have the internal slots of ECMAScript function objects defined in <a
href="#table-27">Table 27</a>. Instead they have the internal slots defined in <a href="#table-28">Table 28</a>.</p>
<figure>
<figcaption><span id="table-28">Table 28</span> — Internal Slots of Exotic Bound Function Objects</figcaption>
<table class="real-table">
<tr>
<th>Internal Slot</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>[[BoundTargetFunction]]</td>
<td>Callable Object</td>
<td>The wrapped function object.</td>
</tr>
<tr>
<td>[[BoundThis]]</td>
<td>Any</td>
<td>The value that is always passed as the <b>this</b> value when calling the wrapped function.</td>
</tr>
<tr>
<td>[[BoundArguments]]</td>
<td><a href="#sec-list-and-record-specification-type">List</a> of Any</td>
<td>A list of values whose elements are used as the first arguments to any call to the wrapped function.</td>
</tr>
</table>
</figure>
<p>Unlike ECMAScript function objects, bound function objects do not use an alternative definition of the
[[GetOwnProperty]] internal methods. Bound function objects provide all of the essential internal methods as specified in
<a href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>. However, they use the following definitions
for the essential internal methods of function objects.</p>
</div>
<section id="sec-bound-function-exotic-objects-call-thisargument-argumentslist">
<h1><span class="secnum" id="sec-9.4.1.1"><a href="#sec-bound-function-exotic-objects-call-thisargument-argumentslist"
title="link to this section">9.4.1.1</a></span> [[Call]] ( thisArgument, argumentsList)</h1>
<p>When the [[Call]] internal method of an exotic <a href="#sec-bound-function-exotic-objects">bound function</a> object,
<var>F</var>, which was created using the bind function is called with parameters <var>thisArgument</var> and
<var>argumentsList</var>, a <a href="#sec-list-and-record-specification-type">List</a> of <a
href="#sec-ecmascript-language-types">ECMAScript language values</a>, the following steps are taken:</p>
<ol class="proc">
<li>Let <i>target</i> be the value of <i>F’s</i> <a
href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>boundThis</i> be the value of <i>F’s</i> <a href="#sec-bound-function-exotic-objects">[[BoundThis]]</a>
<a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>boundArgs</i> be the value of <i>F’s</i> <a
href="#sec-bound-function-exotic-objects">[[BoundArguments]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>args</i> be a new list containing the same values as the list <i>boundArgs</i> in the same order followed by
the same values as the list <i>argumentsList</i> in the same order.</li>
<li>Return <a href="#sec-call">Call</a>(<i>target</i>, <i>boundThis</i>, <i>args</i>).</li>
</ol>
</section>
<section id="sec-bound-function-exotic-objects-construct-argumentslist-newtarget">
<h1><span class="secnum" id="sec-9.4.1.2"><a href="#sec-bound-function-exotic-objects-construct-argumentslist-newtarget"
title="link to this section">9.4.1.2</a></span> [[Construct]] (argumentsList, newTarget)</h1>
<p>When the [[Construct]] internal method of an exotic <a href="#sec-bound-function-exotic-objects">bound function</a>
object, <var>F</var> that was created using the bind function is called with a list of arguments <span style="font-family:
Times New Roman"><i>argumentsList</i> and <i>newTarget</i></span>, the following steps are taken:</p>
<ol class="proc">
<li>Let <i>target</i> be the value of <i>F’s</i> <a
href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>target</i> has a [[Construct]] internal method.</li>
<li>Let <i>boundArgs</i> be the value of <i>F’s</i> <a
href="#sec-bound-function-exotic-objects">[[BoundArguments]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>args</i> be a new list containing the same values as the list <i>boundArgs</i> in the same order followed by
the same values as the list <i>argumentsList</i> in the same order.</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>F</i>, <i>newTarget</i>) is <b>true</b>, let <i>newTarget</i> be
<i>target</i>.</li>
<li>Return <a href="#sec-construct">Construct</a>(<i>target</i>, <i>args</i>, <i>newTarget</i>).</li>
</ol>
</section>
<section id="sec-boundfunctioncreate">
<h1><span class="secnum" id="sec-9.4.1.3"><a href="#sec-boundfunctioncreate"
title="link to this section">9.4.1.3</a></span> BoundFunctionCreate (targetFunction, boundThis, boundArgs)</h1>
<p>The abstract operation BoundFunctionCreate with arguments <var>targetFunction</var>, <var>boundThis</var> and
<var>boundArgs</var> is used to specify the creation of new <a href="#sec-bound-function-exotic-objects">Bound
Function</a> exotic objects. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>targetFunction</i>) is Object.</li>
<li>Let <i>proto</i> be <i>targetFunction</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>proto</i>).</li>
<li>Let <i>obj</i> be a newly created object.</li>
<li>Set <i>obj</i>’s essential internal methods to the default ordinary object definitions specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[Call]] internal method of <i>obj</i> as described in <a
href="#sec-bound-function-exotic-objects-call-thisargument-argumentslist">9.4.1.1</a>.</li>
<li>If <i>targetFunction</i> has a [[Construct]] internal method, then
<ol class="block">
<li>Set the [[Construct]] internal method of <i>obj</i> as described in <a
href="#sec-bound-function-exotic-objects-construct-argumentslist-newtarget">9.4.1.2</a>.</li>
</ol>
</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
<i>proto</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
<b>true</b>.</li>
<li>Set the <a href="#sec-bound-function-exotic-objects">[[BoundTargetFunction]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
<i>targetFunction</i>.</li>
<li>Set the <a href="#sec-bound-function-exotic-objects">[[BoundThis]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to the value of
<i>boundThis</i>.</li>
<li>Set the <a href="#sec-bound-function-exotic-objects">[[BoundArguments]]</a> <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to <i>boundArgs</i>.</li>
<li>Return <i>obj</i>.</li>
</ol>
</section>
</section>
<section id="sec-array-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.2"><a href="#sec-array-exotic-objects" title="link to this section">9.4.2</a></span>
Array Exotic Objects</h1>
<p>An <i>Array object</i> is an exotic object that gives special treatment to array index property keys (<a
href="#sec-object-type">see 6.1.7</a>). A property whose property name is an array index is also called an <i>element</i>.
Every Array object has a <code>length</code> property whose value is always a nonnegative integer less than <span
style="font-family: Times New Roman">2<sup>32</sup></span>. The value of the <code>length</code> property is numerically
greater than the name of every own property whose name is an array index; whenever an own property of an Array object is
created or changed, other properties are adjusted as necessary to maintain this invariant. Specifically, whenever an own
property is added whose name is an array index, the value of the <code>length</code> property is changed, if necessary, to
be one more than the numeric value of that array index; and whenever the value of the <code>length</code> property is
changed, every own property whose name is an array index whose value is not smaller than the new length is deleted. This
constraint applies only to own properties of an Array object and is unaffected by <code>length</code> or array index
properties that may be inherited from its prototypes.</p>
<div class="note">
<p><span class="nh">NOTE</span> A String property name <i>P</i> is an <i>array index</i> if and only if <a
href="#sec-tostring">ToString</a>(<a href="#sec-touint32">ToUint32</a>(<i>P</i>)) is equal to <i>P</i> and <a
href="#sec-touint32">ToUint32</a>(<i>P</i>) is not equal to 2<sup>32</sup>−1.</p>
</div>
<p>Array exotic objects always have a non-configurable property named <code>"length"</code>.</p>
<p>Array exotic objects provide an alternative definition for the [[DefineOwnProperty]] internal method. Except for that
internal method, Array exotic objects provide all of the other essential internal methods as specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</p>
</div>
<section id="sec-array-exotic-objects-defineownproperty-p-desc">
<h1><span class="secnum" id="sec-9.4.2.1"><a href="#sec-array-exotic-objects-defineownproperty-p-desc"
title="link to this section">9.4.2.1</a></span> [[DefineOwnProperty]] ( P, Desc)</h1>
<p>When the [[DefineOwnProperty]] internal method of an <a href="#sec-array-exotic-objects">Array exotic object</a>
<var>A</var> is called with <a href="#sec-object-type">property key</a> <var>P</var>, and <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span> the following
steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>If <i>P</i> is <code>"length"</code>, then
<ol class="block">
<li>Return <a href="#sec-arraysetlength">ArraySetLength</a>(<i>A</i>, <i>Desc</i>).</li>
</ol>
</li>
<li>Else if <i>P</i> is an array index, then
<ol class="block">
<li>Let <i>oldLenDesc</i> be <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>A</i>,
<code>"length"</code>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>oldLenDesc</i> will never be <b>undefined</b> or an accessor
descriptor because Array objects are created with a length data property that cannot be deleted or
reconfigured.</li>
<li>Let <i>oldLen</i> be <i>oldLenDesc</i>.[[Value]].</li>
<li>Let <i>index</i> be <a href="#sec-touint32">ToUint32</a>(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>index</i> will never be an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>index</i> ≥ <i>oldLen</i> and <i>oldLenDesc</i>.[[Writable]] is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>succeeded</i> be <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>,
<i>P</i>, <i>Desc</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>succeeded</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>succeeded</i> is <b>false</b>, return <b>false</b>.</li>
<li>If <i>index</i> ≥ <i>oldLen</i>
<ol class="block">
<li>Set <i>oldLenDesc</i>.[[Value]] to <i>index</i> + 1.</li>
<li>Let <i>succeeded</i> be <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>,
<code>"length"</code>, <i>oldLenDesc</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>succeeded</i> is <b>true</b>.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>, <i>P</i>, <i>Desc</i>).</li>
</ol>
</section>
<section id="sec-arraycreate">
<h1><span class="secnum" id="sec-9.4.2.2"><a href="#sec-arraycreate" title="link to this section">9.4.2.2</a></span>
ArrayCreate(length, proto)</h1>
<p>The abstract operation ArrayCreate with argument <var>length</var> (a positive integer) and optional argument
<var>proto</var> is used to specify the creation of new Array exotic objects. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>length</i> is an integer Number ≥ 0.</li>
<li>If <i>length</i> is −0, let <i>length</i> be +0.</li>
<li>If <i>length</i>>2<sup>32</sup>-1, throw a <b>RangeError</b> exception.</li>
<li>If the <i>proto</i> argument was not passed, let <i>proto</i> be the intrinsic object <span style="font-family:
sans-serif">%ArrayPrototype%</span>.</li>
<li>Let <i>A</i> be a newly created <a href="#sec-array-exotic-objects">Array exotic object</a>.</li>
<li>Set <i>A</i>’s essential internal methods except for [[DefineOwnProperty]] to the default ordinary object
definitions specified in <a href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[DefineOwnProperty]] internal method of <i>A</i> as specified in <a
href="#sec-array-exotic-objects-defineownproperty-p-desc">9.4.2.1</a>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>A</i> to
<i>proto</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>A</i> to
<b>true</b>.</li>
<li>Perform <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>, <code>"length"</code>,
PropertyDescriptor{[[Value]]: <i>length</i>, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>false</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: the preceding step never produces an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <i>A</i>.</li>
</ol>
</section>
<section id="sec-arrayspeciescreate">
<h1><span class="secnum" id="sec-9.4.2.3"><a href="#sec-arrayspeciescreate"
title="link to this section">9.4.2.3</a></span> ArraySpeciesCreate(originalArray, length)</h1>
<p>The abstract operation ArraySpeciesCreate with arguments <var>originalArray</var> and <var>length</var> is used to
specify the creation of a new Array object using a constructor function that is derived from <var>originalArray</var>. It
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>length</i> is an integer Number ≥ 0.</li>
<li>If <i>length</i> is −0, let <i>length</i> be +0.</li>
<li>Let <i>C</i> be <b>undefined</b>.</li>
<li>Let <i>isArray</i> be <a href="#sec-isarray">IsArray</a>(<i>originalArray</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>isArray</i>).</li>
<li>If <i>isArray</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>C</i> be <a href="#sec-get-o-p">Get</a>(<i>originalArray</i>, <code>"constructor"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>C</i>).</li>
<li>If <a href="#sec-isconstructor">IsConstructor</a>(<i>C</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>thisRealm</i> be <a href="#sec-execution-contexts">the running execution context</a>’s <a
href="#sec-code-realms">Realm</a>.</li>
<li>Let <i>realmC</i> be <a href="#sec-getfunctionrealm">GetFunctionRealm</a>(<i>C</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>realmC</i>).</li>
<li>If <i>thisRealm</i> and <i>realmC</i> are not the same <a href="#sec-code-realms">Realm</a> Record, then
<ol class="block">
<li>If <a href="#sec-samevalue">SameValue</a>(<i>C</i>, <i>realmC</i>.[[intrinsics]].[[%Array%]]) is
<b>true</b>, let <i>C</i> be <b>undefined</b>.</li>
</ol>
</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>C</i>) is Object, then
<ol class="block">
<li>Let <i>C</i> be <a href="#sec-get-o-p">Get</a>(<i>C</i>, @@species).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>C</i>).</li>
<li>If <i>C</i> is <b>null</b>, let <i>C</i> be <b>undefined</b>.</li>
</ol>
</li>
</ol>
</li>
<li>If <i>C</i> is <b>undefined</b>, return <a href="#sec-arraycreate">ArrayCreate</a>(<i>length</i>).</li>
<li>If <a href="#sec-isconstructor">IsConstructor</a>(<i>C</i>) is <b>false</b>, throw a <b>TypeError</b>
exception<i>.</i></li>
<li>Return <a href="#sec-construct">Construct</a>(<i>C</i>, «<i>length</i>»).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> If <i>originalArray</i> was created using the standard built-in Array constructor for a
<a href="#sec-code-realms">Realm</a> that is not the <a href="#sec-code-realms">Realm</a> of <a
href="#sec-execution-contexts">the running execution context</a>, then a new Array is created using the <a
href="#sec-code-realms">Realm</a> of <a href="#sec-execution-contexts">the running execution context</a>. This maintains
compatibility with Web browsers that have historically had that behaviour for the Array.prototype methods that now are
defined using ArraySpeciesCreate.</p>
</div>
</section>
<section id="sec-arraysetlength">
<h1><span class="secnum" id="sec-9.4.2.4"><a href="#sec-arraysetlength" title="link to this section">9.4.2.4</a></span>
ArraySetLength(A, Desc)</h1>
<p>When the abstract operation ArraySetLength is called with an <a href="#sec-array-exotic-objects">Array exotic
object</a> <span style="font-family: Times New Roman"><i>A</i>,</span> and <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> <span class="nt">Desc</span> the following
steps are taken:</p>
<ol class="proc">
<li>If the [[Value]] field of <i>Desc</i> is absent, then
<ol class="block">
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>, <code>"length"</code>,
<i>Desc</i>).</li>
</ol>
</li>
<li>Let <i>newLenDesc</i> be a copy of <i>Desc</i>.</li>
<li>Let <i>newLen</i> be <a href="#sec-touint32">ToUint32</a>(<i>Desc</i>.[[Value]]).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>newLen</i>).</li>
<li>Let <i>numberLen</i> be <a href="#sec-tonumber">ToNumber</a>(<i>Desc</i>.[[Value]]).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>newLen</i>).</li>
<li>If <i>newLen</i> ≠ <i>numberLen</i>, throw a <b>RangeError</b> exception.</li>
<li>Set <i>newLenDesc</i>.[[Value]] to <i>newLen</i>.</li>
<li>Let <i>oldLenDesc</i> be <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>A</i>,
<code>"length"</code>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>oldLenDesc</i> will never be <b>undefined</b> or an accessor
descriptor because Array objects are created with a length data property that cannot be deleted or
reconfigured.</li>
<li>Let <i>oldLen</i> be <i>oldLenDesc</i>.[[Value]].</li>
<li>If <i>newLen</i> ≥<i>oldLen</i>, then
<ol class="block">
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>, <code>"length"</code>,
<i>newLenDesc</i>).</li>
</ol>
</li>
<li>If <i>oldLenDesc</i>.[[Writable]] is <b>false</b>, return <b>false</b>.</li>
<li>If <i>newLenDesc</i>.[[Writable]] is absent or has the value <b>true</b>, let <i>newWritable</i> be
<b>true</b>.</li>
<li>Else,
<ol class="block">
<li>Need to defer setting the [[Writable]] attribute to <b>false</b> in case any elements cannot be deleted.</li>
<li>Let <i>newWritable</i> be <b>false</b>.</li>
<li>Set <i>newLenDesc</i>.[[Writable]] to <b>true</b>.</li>
</ol>
</li>
<li>Let <i>succeeded</i> be <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>,
<code>"length"</code>, <i>newLenDesc</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>succeeded</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>succeeded</i> is <b>false</b>, return <b>false</b>.</li>
<li>While <i>newLen</i> < <i>oldLen</i> repeat,
<ol class="block">
<li>Set <i>oldLen</i> to <i>oldLen</i> – 1.</li>
<li>Let <i>deleteSucceeded</i> be <i>A</i>.[[Delete]](<a href="#sec-tostring">ToString</a>(<i>oldLen</i>)).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>deleteSucceeded</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>deleteSucceeded</i> is <b>false</b>, then
<ol class="block">
<li>Set <i>newLenDesc</i>.[[Value]] to <i>oldLen</i> <i>+</i> 1.</li>
<li>If <i>newWritable</i> is <b>false</b>, set <i>newLenDesc</i>.[[Writable]] to <b>false</b>.</li>
<li>Let <i>succeeded</i> be <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>,
<code>"length"</code>, <i>newLenDesc</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>succeeded</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <b>false</b>.</li>
</ol>
</li>
</ol>
</li>
<li>If <i>newWritable</i> is <b>false</b>, then
<ol class="block">
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>A</i>, <code>"length"</code>,
PropertyDescriptor{[[Writable]]: <b>false</b>}). This call will always return <b>true</b>.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> In steps 3 and 4, if <i>Desc</i>.[[Value]] is an object then its <code>valueOf</code>
method is called twice. This is legacy behaviour that was specified with this effect starting with the 2<sup>nd</sup>
Edition of this specification.</p>
</div>
</section>
</section>
<section id="sec-string-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.3"><a href="#sec-string-exotic-objects" title="link to this section">9.4.3</a></span>
String Exotic Objects</h1>
<p>A <i>String object</i> is an exotic object that encapsulates a String value and exposes virtual integer indexed data
properties corresponding to the individual code unit elements of the string value. Exotic String objects always have a
data property named <code>"length"</code> whose value is the number of code unit elements in the encapsulated String
value. Both the code unit data properties and the <code>"length"</code> property are non-writable and
non-configurable.</p>
<p>Exotic String objects have the same internal slots as ordinary objects. They also have a [[StringData]] internal
slot.</p>
<p>Exotic String objects provide alternative definitions for the following internal methods. All of the other exotic
String object essential internal methods that are not defined below are as specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</p>
</div>
<section id="sec-string-exotic-objects-getownproperty-p">
<div class="front">
<h1><span class="secnum" id="sec-9.4.3.1"><a href="#sec-string-exotic-objects-getownproperty-p"
title="link to this section">9.4.3.1</a></span> [[GetOwnProperty]] ( P )</h1>
<p>When the [[GetOwnProperty]] internal method of an exotic String object <var>S</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>desc</i> be <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>S</i>, <i>P</i>).</li>
<li>If <i>desc</i> is not <b>undefined</b> return <i>desc</i>.</li>
<li>Return <a href="#sec-stringgetindexproperty">StringGetIndexProperty</a>(<i>S</i>, <i>P</i>).</li>
</ol>
</div>
<section id="sec-stringgetindexproperty">
<h1><span class="secnum" id="sec-9.4.3.1.1"><a href="#sec-stringgetindexproperty"
title="link to this section">9.4.3.1.1</a></span> StringGetIndexProperty (S, P)</h1>
<p>When the abstract operation StringGetIndexProperty is called with an exotic String object <var>S</var> and with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is not String, return <b>undefined</b>.</li>
<li>Let <i>index</i> be <a href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a> (<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>index</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>index</i> is <b>undefined</b>, return <b>undefined</b>.</li>
<li>If <a href="#sec-isinteger">IsInteger</a>(<i>index</i>) is <b>false</b>, return <b>undefined</b>.</li>
<li>If <i>index</i> = −0, return <b>undefined</b>.</li>
<li>Let <i>str</i> be the String value of the [[StringData]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>S</i>.</li>
<li>Let <i>len</i> be the number of elements in <i>str</i>.</li>
<li>If <i>index</i> < 0 or <i>len</i> ≤ <i>index</i>, return <b>undefined</b>.</li>
<li>Let <i>resultStr</i> be a String value of length 1, containing one code unit from <i>str</i>, specifically the
code unit at index <i>index</i>.</li>
<li>Return a PropertyDescriptor{ [[Value]]: <i>resultStr</i>, [[Enumerable]]: <b>true</b>, [[Writable]]: <b>false</b>,
[[Configurable]]: <b>false</b> }.</li>
</ol>
</section>
</section>
<section id="sec-string-exotic-objects-hasproperty-p">
<h1><span class="secnum" id="sec-9.4.3.2"><a href="#sec-string-exotic-objects-hasproperty-p"
title="link to this section">9.4.3.2</a></span> [[HasProperty]](P)</h1>
<p>When the [[HasProperty]] internal method of an exotic String object <var>S</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>Let <i>elementDesc</i> be <a href="#sec-stringgetindexproperty">StringGetIndexProperty</a>(<i>S</i>, <i>P</i>).</li>
<li>If <i>elementDesc</i> is not <b>undefined</b>, return <b>true</b>.</li>
<li>Return <a href="#sec-ordinaryhasproperty">OrdinaryHasProperty</a>(<i>S</i>, <i>P</i>)..</li>
</ol>
</section>
<section id="sec-string-exotic-objects-ownpropertykeys">
<h1><span class="secnum" id="sec-9.4.3.3"><a href="#sec-string-exotic-objects-ownpropertykeys"
title="link to this section">9.4.3.3</a></span> [[OwnPropertyKeys]] ( )</h1>
<p>When the [[OwnPropertyKeys]] internal method of a <a href="#sec-string-exotic-objects">String exotic object</a>
<var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Let <i>keys</i> be a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>str</i> be the String value of the [[StringData]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>len</i> be the number of elements in <i>str</i>.</li>
<li>For each integer <i>i</i> starting with 0 such that <i>i</i> < <i>len</i>, in ascending order,
<ol class="block">
<li>Add <a href="#sec-tostring">ToString</a>(<i>i</i>) as the last element of <i>keys</i></li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> such that <i>P</i> is an integer index
and <a href="#sec-tointeger">ToInteger</a>(<i>P</i>) ≥ <i>len</i>, in ascending numeric index order,
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> such that <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String and <i>P</i> is not an integer index, in
property creation order,
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> such that <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is Symbol, in property creation order,
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>Return <i>keys</i>.</li>
</ol>
</section>
<section id="sec-stringcreate">
<h1><span class="secnum" id="sec-9.4.3.4"><a href="#sec-stringcreate" title="link to this section">9.4.3.4</a></span>
StringCreate( value, prototype)</h1>
<p>The abstract operation StringCreate with arguments <var>value</var> and <var>prototype</var> is used to specify the
creation of new exotic String objects. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>prototype</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>value</i>) is String.</li>
<li>Let <i>S</i> be a newly created <a href="#sec-string-exotic-objects">String exotic object</a>.</li>
<li>Set the [[StringData]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>S</i> to
<i>value</i>.</li>
<li>Set <i>S</i>’s essential internal methods to the default ordinary object definitions specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[GetOwnProperty]] internal method of <i>S</i> as specified in <a
href="#sec-string-exotic-objects-getownproperty-p">9.4.3.1</a>.</li>
<li>Set the [[HasProperty]] internal method of <i>S</i> as specified in <a
href="#sec-string-exotic-objects-hasproperty-p">9.4.3.2</a>.</li>
<li>Set the [[OwnPropertyKeys]] internal method of <i>S</i> as specified in <a
href="#sec-string-exotic-objects-ownpropertykeys">9.4.3.3</a>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>S</i> to
<i>prototype</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>S</i> to
<b>true</b>.</li>
<li>Let <i>length</i> be the number of code unit elements in <i>value.</i></li>
<li>Let <i>status</i> be <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>S</i>, <code>"length"</code>,
PropertyDescriptor{[[Value]]: <i>length</i>, [[Writable]]: <b>false</b>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>false</b> }).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <i>S</i>.</li>
</ol>
</section>
</section>
<section id="sec-arguments-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.4"><a href="#sec-arguments-exotic-objects"
title="link to this section">9.4.4</a></span> Arguments Exotic Objects</h1>
<p>Most ECMAScript functions make an arguments objects available to their code. Depending upon the characteristics of the
function definition, its argument object is either an ordinary object or an <i>arguments exotic object</i>. An arguments
exotic object is an exotic object whose array index properties map to the formal parameters bindings of an invocation of
its associated ECMAScript function.</p>
<p>Arguments exotic objects have the same internal slots as ordinary objects. They also have a [[ParameterMap]] internal
slot. Ordinary arguments objects also have a [[ParameterMap]] internal slot whose value is always undefined. For ordinary
argument objects the [[ParameterMap]] internal slot is only used by <code><a
href="#sec-object.prototype.tostring">Object.prototype.toString</a></code> (<a
href="#sec-object.prototype.tostring">19.1.3.6</a>) to identify them as such.</p>
<p>Arguments exotic objects provide alternative definitions for the following internal methods. All of the other exotic
arguments object essential internal methods that are not defined below are as specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a></p>
<div class="note">
<p><span class="nh">NOTE 1</span> For non-strict functions the integer indexed data properties of an arguments object
whose numeric name values are less than the number of formal parameters of the corresponding function object initially
share their values with the corresponding argument bindings in the function’s <a
href="#sec-execution-contexts">execution context</a>. This means that changing the property changes the corresponding
value of the argument binding and vice-versa. This correspondence is broken if such a property is deleted and then
redefined or if the property is changed into an accessor property. For strict mode functions, the values of the
arguments object’s properties are simply a copy of the arguments passed to the function and there is no dynamic
linkage between the property values and the formal parameter values.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> The ParameterMap object and its property values are used as a device for specifying
the arguments object correspondence to argument bindings. The ParameterMap object and the objects that are the values of
its properties are not directly observable from ECMAScript code. An ECMAScript implementation does not need to actually
create or use such objects to implement the specified semantics.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 3</span> Arguments objects for strict mode functions define non-configurable accessor
properties named <code>"caller"</code> and <code>"callee"</code> which throw a <b>TypeError</b> exception on access. The
<code>"callee"</code> property has a more specific meaning for non-strict functions and a <code>"caller"</code> property
has historically been provided as an implementation-defined extension by some ECMAScript implementations. The strict
mode definition of these properties exists to ensure that neither of them is defined in any other manner by conforming
ECMAScript implementations.</p>
</div>
</div>
<section id="sec-arguments-exotic-objects-getownproperty-p">
<h1><span class="secnum" id="sec-9.4.4.1"><a href="#sec-arguments-exotic-objects-getownproperty-p"
title="link to this section">9.4.4.1</a></span> [[GetOwnProperty]] (P)</h1>
<p>The [[GetOwnProperty]] internal method of an arguments exotic object when called with a <a
href="#sec-object-type">property key</a> <var>P</var> performs the following steps:</p>
<ol class="proc">
<li>Let <i>args</i> be the arguments object.</li>
<li>Let <i>desc</i> be <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>args</i>, <i>P</i>).</li>
<li>If <i>desc</i> is <b>undefined</b>, return <i>desc</i>.</li>
<li>Let <i>map</i> be the value of the [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of the arguments object.</li>
<li>Let <i>isMapped</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>map</i>, <i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>isMapped</i> is never an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If the value of <i>isMapped</i> is <b>true</b>, then
<ol class="block">
<li>Set <i>desc</i>.[[Value]] to <a href="#sec-get-o-p">Get</a>(<i>map</i>, <i>P</i>).</li>
</ol>
</li>
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>desc</i>) is <b>true</b> and <i>P</i> is
<code>"caller"</code> and <i>desc</i>.[[Value]] is a strict mode Function object, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>desc</i>.</li>
</ol>
<p>If an implementation does not provide a built-in <code>caller</code> property for argument exotic objects then step 8
of this algorithm is must be skipped.</p>
</section>
<section id="sec-arguments-exotic-objects-defineownproperty-p-desc">
<h1><span class="secnum" id="sec-9.4.4.2"><a href="#sec-arguments-exotic-objects-defineownproperty-p-desc"
title="link to this section">9.4.4.2</a></span> [[DefineOwnProperty]] (P, Desc)</h1>
<p>The [[DefineOwnProperty]] internal method of an arguments exotic object when called with a <a
href="#sec-object-type">property key</a> <var>P</var> and <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a> <span class="nt">Desc</span> performs the following steps:</p>
<ol class="proc">
<li>Let <i>args</i> be the arguments object.</li>
<li>Let <i>map</i> be the value of the [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of the arguments object.</li>
<li>Let <i>isMapped</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>map</i>, <i>P</i>).</li>
<li>Let <i>allowed</i> be <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>args</i>, <i>P</i>,
<i>Desc</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>allowed</i>).</li>
<li>If <i>allowed</i> is <b>false</b>, return <b>false</b>.</li>
<li>If the value of <i>isMapped</i> is <b>true</b>, then
<ol class="block">
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>Desc</i>) is <b>true</b>, then
<ol class="block">
<li><a href="#sec-call">Call</a> <i>map</i>.[[Delete]](<i>P</i>).</li>
</ol>
</li>
<li>Else
<ol class="block">
<li>If <i>Desc</i>.[[Value]] is present, then
<ol class="block">
<li>Let <i>setStatus</i> be <a href="#sec-set-o-p-v-throw">Set</a>(<i>map</i>, <i>P</i>,
<i>Desc</i>.[[Value]], <b>false</b>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>setStatus</i> is <b>true</b> because formal
parameters mapped by argument objects are always writable.</li>
</ol>
</li>
<li>If <i>Desc</i>.[[Writable]] is present and its value is <b>false</b>, then
<ol class="block">
<li><a href="#sec-call">Call</a> <i>map</i>.[[Delete]](<i>P</i>).</li>
</ol>
</li>
</ol>
</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-arguments-exotic-objects-get-p-receiver">
<h1><span class="secnum" id="sec-9.4.4.3"><a href="#sec-arguments-exotic-objects-get-p-receiver"
title="link to this section">9.4.4.3</a></span> [[Get]] (P, Receiver)</h1>
<p>The [[Get]] internal method of an arguments exotic object when called with a <a href="#sec-object-type">property
key</a> <var>P</var> and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span
class="nt">Receiver</span> performs the following steps:</p>
<ol class="proc">
<li>Let <i>args</i> be the arguments object.</li>
<li>Let <i>map</i> be the value of the [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of the arguments object.</li>
<li>Let <i>isMapped</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>map</i>, <i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>isMapped</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If the value of <i>isMapped</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>v</i> be the result of calling the default ordinary object [[Get]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver">9.1.8</a>) on <i>args</i> passing
<i>P</i> and <i>Receiver</i> as the arguments.</li>
</ol>
</li>
<li>Else <i>map</i> contains a formal parameter mapping for <i>P</i>,
<ol class="block">
<li>Let <i>v</i> be <a href="#sec-get-o-p">Get</a>(<i>map</i>, <i>P</i>).</li>
</ol>
</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>v</i>).</li>
<li>Return <i>v</i>.</li>
</ol>
</section>
<section id="sec-arguments-exotic-objects-set-p-v-receiver">
<h1><span class="secnum" id="sec-9.4.4.4"><a href="#sec-arguments-exotic-objects-set-p-v-receiver"
title="link to this section">9.4.4.4</a></span> [[Set]] ( P, V, Receiver)</h1>
<p>The [[Set]] internal method of an arguments exotic object when called with <a href="#sec-object-type">property key</a>
<var>P</var>, value <var>V</var>, and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span
class="nt">Receiver</span> performs the following steps:</p>
<ol class="proc">
<li>Let <i>args</i> be the arguments object.</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>args</i>, <i>Receiver</i>) is <b>false</b>, then
<ol class="block">
<li>Let <i>isMapped</i> be <b>false</b>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>map</i> be the value of the [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of the arguments object.</li>
<li>Let <i>isMapped</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>map</i>, <i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>isMapped</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
</ol>
</li>
<li>If the value of <i>isMapped</i> is <b>false</b>, then
<ol class="block">
<li>Return the result of calling the default ordinary object [[Set]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver">9.1.9</a>) on <i>args</i>
passing <i>P</i>, <i>V</i> and <i>Receiver</i> as the arguments.</li>
</ol>
</li>
<li>Else <i>map</i> contains a formal parameter mapping for <i>P</i>,
<ol class="block">
<li>Return <a href="#sec-set-o-p-v-throw">Set</a>(<i>map</i>, <i>P</i>, <i>V</i>, <b>false</b>).</li>
</ol>
</li>
</ol>
</section>
<section id="sec-arguments-exotic-objects-delete-p">
<h1><span class="secnum" id="sec-9.4.4.5"><a href="#sec-arguments-exotic-objects-delete-p"
title="link to this section">9.4.4.5</a></span> [[Delete]] (P)</h1>
<p>The [[Delete]] internal method of an arguments exotic object when called with a <a href="#sec-object-type">property
key</a> <var>P</var> performs the following steps:</p>
<ol class="proc">
<li>Let <i>map</i> be the value of the [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of the arguments object.</li>
<li>Let <i>isMapped</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>map</i>, <i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>isMapped</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Let <i>result</i> be the result of calling the default [[Delete]] internal method for ordinary objects (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-delete-p">9.1.10</a>) on the arguments object passing
<i>P</i> as the argument.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>If <i>result</i> is <b>true</b> and the value of <i>isMapped</i> is <b>true</b>, then
<ol class="block">
<li><a href="#sec-call">Call</a> <i>map</i>.[[Delete]](<i>P</i>).</li>
</ol>
</li>
<li>Return <i>result</i>.</li>
</ol>
</section>
<section id="sec-createunmappedargumentsobject">
<h1><span class="secnum" id="sec-9.4.4.6"><a href="#sec-createunmappedargumentsobject"
title="link to this section">9.4.4.6</a></span> CreateUnmappedArgumentsObject(argumentsList)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateUnmappedArgumentsObject</span> called with an
argument <var>argumentsList</var> performs the following steps:</p>
<ol class="proc">
<li>Let <i>len</i> be the number of elements in <i>argumentsList</i>.</li>
<li>Let <i>obj</i> be <a href="#sec-objectcreate">ObjectCreate</a>(%ObjectPrototype%,
«‍[[ParameterMap]]»).</li>
<li>Set <i>obj</i>’s [[ParameterMap]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a>
to <b>undefined</b>.</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, <code>"length"</code>,
PropertyDescriptor{[[Value]]: <i>len</i>, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>true</b>}).</li>
<li>Let <i>index</i> be 0.</li>
<li>Repeat while <i>index</i> < <i>len</i>,
<ol class="block">
<li>Let <i>val</i> be <i>argumentsList</i>[<i>index</i>].</li>
<li>Perform <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>, <a
href="#sec-tostring">ToString</a>(<i>index</i>), <i>val</i>).</li>
<li>Let <i>index</i> be <i>index</i> + 1</li>
</ol>
</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, @@iterator, PropertyDescriptor
{[[Value]]:%ArrayProto_values%, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>true</b>}).</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, <code>"caller"</code>,
PropertyDescriptor {[[Get]]: <a href="#sec-%throwtypeerror%">%ThrowTypeError%</a>, [[Set]]: <a
href="#sec-%throwtypeerror%">%ThrowTypeError%</a>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>false</b>}).</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, <code>"callee"</code>,
PropertyDescriptor {[[Get]]: <a href="#sec-%throwtypeerror%">%ThrowTypeError%</a>, [[Set]]: <a
href="#sec-%throwtypeerror%">%ThrowTypeError%</a>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>false</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: the above property definitions will not produce an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <i>obj</i></li>
</ol>
</section>
<section id="sec-createmappedargumentsobject">
<div class="front">
<h1><span class="secnum" id="sec-9.4.4.7"><a href="#sec-createmappedargumentsobject"
title="link to this section">9.4.4.7</a></span> CreateMappedArgumentsObject ( func, formals, argumentsList, env
)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">CreateMappedArgumentsObject</span> is called with
object <var>func</var>, parsed grammar phrase <var>formals</var>, <a
href="#sec-list-and-record-specification-type">List</a> <var>argumentsList</var>, and <a
href="#sec-environment-records">Environment Record</a> <span style="font-family: Times New Roman"><i>env</i>.</span> The
following steps are performed:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>formals</i> does not contain a rest parameter, any binding
patterns, or any initializers. It may contain duplicate identifiers.</li>
<li>Let <i>len</i> be the number of elements in <i>argumentsList</i>.</li>
<li>Let <i>obj</i> be a newly created arguments exotic object with a [[ParameterMap]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Set the [[GetOwnProperty]] internal method of <i>obj</i> as specified in <a
href="#sec-arguments-exotic-objects-getownproperty-p">9.4.4.1</a>.</li>
<li>Set the [[DefineOwnProperty]] internal method of <i>obj</i> as specified in <a
href="#sec-arguments-exotic-objects-defineownproperty-p-desc">9.4.4.2</a>.</li>
<li>Set the [[Get]] internal method of <i>obj</i> as specified in <a
href="#sec-arguments-exotic-objects-get-p-receiver">9.4.4.3</a>.</li>
<li>Set the [[Set]] internal method of <i>obj</i> as specified in <a
href="#sec-arguments-exotic-objects-set-p-v-receiver">9.4.4.4</a>.</li>
<li>Set the [[Delete]] internal method of <i>obj</i> as specified in <a
href="#sec-arguments-exotic-objects-delete-p">9.4.4.5</a>.</li>
<li>Set the remainder of <i>obj</i>’s essential internal methods to the default ordinary object definitions
specified in <a href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i> to
%ObjectPrototype%.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i>
to <b>true</b>.</li>
<li>Let <i>parameterNames</i> be the BoundNames of <i>formals</i>.</li>
<li>Let <i>numberOfParameters</i> be the number of elements in <i>parameterNames</i></li>
<li>Let <i>index</i> be 0.</li>
<li>Repeat while <i>index</i> < <i>len</i> ,
<ol class="block">
<li>Let <i>val</i> be <i>argumentsList</i>[<i>index</i>].</li>
<li>Perform <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>obj</i>, <a
href="#sec-tostring">ToString</a>(<i>index</i>), <i>val</i>).</li>
<li>Let <i>index</i> be <i>index</i> + 1</li>
</ol>
</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, <code>"length"</code>,
PropertyDescriptor{[[Value]]: <i>len</i>, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>true</b>}).</li>
<li>Let <i>map</i> be <a href="#sec-objectcreate">ObjectCreate</a>(<b>null</b>).</li>
<li>Let <i>mappedNames</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>index</i> be <i>numberOfParameters</i> − 1.</li>
<li>Repeat while <i>index</i> ≥ 0 ,
<ol class="block">
<li>Let <i>name</i> be <i>parameterNames</i>[<i>index</i>].</li>
<li>If <i>name</i> is not an element of <i>mappedNames</i>, then
<ol class="block">
<li>Add <i>name</i> as an element of the list <i>mappedNames</i>.</li>
<li>If <i>index</i> < <i>len</i>, then
<ol class="block">
<li>Let <i>g</i> be <a href="#sec-makearggetter">MakeArgGetter</a>(<i>name</i>, <i>env</i>).</li>
<li>Let <i>p</i> be <a href="#sec-makeargsetter">MakeArgSetter</a>(<i>name</i>, <i>env</i>).</li>
<li><a href="#sec-call">Call</a> <i>map</i>.[[DefineOwnProperty]](<a
href="#sec-tostring">ToString</a>(<i>index</i>), PropertyDescriptor{[[Set]]: <i>p</i>, [[Get]]:
<i>g,</i> [[Enumerable]]: <b>false</b>, [[Configurable]]: <b>true</b>}).</li>
</ol>
</li>
</ol>
</li>
<li>Let <i>index</i> be <i>index</i> − 1</li>
</ol>
</li>
<li>Set the [[ParameterMap]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>obj</i>
to <i>map</i>.</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, @@iterator, PropertyDescriptor
{[[Value]]:%ArrayProto_values%, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>true</b>}).</li>
<li>Perform <a href="#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(<i>obj</i>, <code>"callee"</code>,
PropertyDescriptor {[[Value]]: <i>func</i>, [[Writable]]: <b>true</b>, [[Enumerable]]: <b>false</b>,
[[Configurable]]: <b>true</b>}).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: the above property definitions will not produce an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>Return <i>obj</i></li>
</ol>
</div>
<section id="sec-makearggetter">
<h1><span class="secnum" id="sec-9.4.4.7.1"><a href="#sec-makearggetter"
title="link to this section">9.4.4.7.1</a></span> MakeArgGetter ( name, env)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">MakeArgGetter</span> called with String
<var>name</var> and <a href="#sec-environment-records">Environment Record</a> <var>env</var> creates a built-in function
object that when executed returns the value bound for <var>name</var> in <var>env</var>. It performs the following
steps:</p>
<ol class="proc">
<li>Let <i>realm</i> be <a href="#sec-execution-contexts">the current Realm</a>.</li>
<li>Let <i>steps</i> be the steps of an ArgGetter function as specified below.</li>
<li>Let <i>getter</i> be <a href="#sec-createbuiltinfunction">CreateBuiltinFunction</a>(<i>realm</i>, <i>steps</i>,
%FunctionPrototype%, «‍[[name]], [[env]]» ).</li>
<li>Set <i>getter’s</i> [[name]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>name</i>.</li>
<li>Set <i>getter’s</i> [[env]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>env</i>.</li>
<li>Return <i>getter</i>.</li>
</ol>
<p>An ArgGetter function is an anonymous built-in function with [[name]] and [[env]] internal slots. When an ArgGetter
function <var>f</var> that expects no arguments is called it performs the following steps:</p>
<ol class="proc">
<li>Let <i>name</i> be the value of <i>f’s</i> [[name]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>env</i> be the value of <i>f’s</i> [[env]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a></li>
<li>Return <i>env</i>.GetBindingValue(<i>name</i>, <b>false</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> ArgGetter functions are never directly accessible to ECMAScript code.</p>
</div>
</section>
<section id="sec-makeargsetter">
<h1><span class="secnum" id="sec-9.4.4.7.2"><a href="#sec-makeargsetter"
title="link to this section">9.4.4.7.2</a></span> MakeArgSetter ( name, env)</h1>
<p>The abstract operation <span style="font-family: Times New Roman">MakeArgSetter</span> called with String
<var>name</var> and <a href="#sec-environment-records">Environment Record</a> <var>env</var> creates a built-in function
object that when executed sets the value bound for <var>name</var> in <var>env</var>. It performs the following
steps:</p>
<ol class="proc">
<li>Let <i>realm</i> be <a href="#sec-execution-contexts">the current Realm</a>.</li>
<li>Let <i>steps</i> be the steps of an ArgSetter function as specified below.</li>
<li>Let <i>setter</i> be <a href="#sec-createbuiltinfunction">CreateBuiltinFunction</a>(<i>realm</i>, <i>steps</i>,
%FunctionPrototype%, «‍[[name]], [[env]]» ).</li>
<li>Set <i>setter’s</i> [[name]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>name</i>.</li>
<li>Set <i>setter’s</i> [[env]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>env</i>.</li>
<li>Return <i>setter</i>.</li>
</ol>
<p>An ArgSetter function is an anonymous built-in function with [[name]] and [[env]] internal slots. When an ArgSetter
function <var>f</var> is called with argument <var>value</var> it performs the following steps:</p>
<ol class="proc">
<li>Let <i>name</i> be the value of <i>f’s</i> [[name]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>env</i> be the value of <i>f’s</i> [[env]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a></li>
<li>Return <i>env</i>.SetMutableBinding(<i>name</i>, <i>value</i>, <b>false</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> ArgSetter functions are never directly accessible to ECMAScript code.</p>
</div>
</section>
</section>
</section>
<section id="sec-integer-indexed-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.5"><a href="#sec-integer-indexed-exotic-objects"
title="link to this section">9.4.5</a></span> Integer Indexed Exotic Objects</h1>
<p>An <i>Integer Indexed object</i> is an exotic object that performs special handling of integer index property keys.</p>
<p>Integer Indexed exotic objects have the same internal slots as ordinary objects additionally [[ViewedArrayBuffer]],
[[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.</p>
<p>Integer Indexed Exotic objects provide alternative definitions for the following internal methods. All of the other
Integer Indexed exotic object essential internal methods that are not defined below are as specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</p>
</div>
<section id="sec-integer-indexed-exotic-objects-getownproperty-p">
<h1><span class="secnum" id="sec-9.4.5.1"><a href="#sec-integer-indexed-exotic-objects-getownproperty-p"
title="link to this section">9.4.5.1</a></span> [[GetOwnProperty]] ( P )</h1>
<p>When the [[GetOwnProperty]] internal method of an Integer Indexed exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has a [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String, then
<ol class="block">
<li>Let <i>numericIndex</i> be <a
href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>numericIndex</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>numericIndex</i> is not <b>undefined</b>, then
<ol class="block">
<li>Let <i>value</i> be <a href="#sec-integerindexedelementget">IntegerIndexedElementGet</a> (<i>O</i>,
<i>numericIndex</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>value</i>).</li>
<li>If <i>value</i> is <b>undefined</b>, return <b>undefined</b>.</li>
<li>Return a PropertyDescriptor{ [[Value]]: <i>value</i>, [[Enumerable]]: <b>true</b>, [[Writable]]:
<b>true</b>, [[Configurable]]: <b>false</b> }.</li>
</ol>
</li>
</ol>
</li>
<li>Return <a href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>O</i>, <i>P</i>).</li>
</ol>
</section>
<section id="sec-integer-indexed-exotic-objects-hasproperty-p">
<h1><span class="secnum" id="sec-9.4.5.2"><a href="#sec-integer-indexed-exotic-objects-hasproperty-p"
title="link to this section">9.4.5.2</a></span> [[HasProperty]](P)</h1>
<p>When the [[HasProperty]] internal method of an Integer Indexed exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has a [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String, then
<ol class="block">
<li>Let <i>numericIndex</i> be <a
href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>numericIndex</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>numericIndex</i> is not <b>undefined</b>, then
<ol class="block">
<li>Let <i>buffer</i> be the value of <i>O</i>’s [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-isdetachedbuffer">IsDetachedBuffer</a>(<i>buffer</i>) is <b>true</b>, throw a
<b>TypeError</b> exception.</li>
<li>If <a href="#sec-isinteger">IsInteger</a>(<i>numericIndex</i>) is <b>false</b>, return <b>false</b></li>
<li>If <i>numericIndex</i> = −0, return <b>false</b>.</li>
<li>If <i>numericIndex</i> < 0, return <b>false</b>.</li>
<li>If <i>numericIndex</i> ≥ the value of <i>O</i>’s [[ArrayLength]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
</ol>
</li>
<li>Return <a href="#sec-ordinaryhasproperty">OrdinaryHasProperty</a>(<i>O</i>, <i>P</i>).</li>
</ol>
</section>
<section id="sec-integer-indexed-exotic-objects-defineownproperty-p-desc">
<h1><span class="secnum" id="sec-9.4.5.3"><a href="#sec-integer-indexed-exotic-objects-defineownproperty-p-desc"
title="link to this section">9.4.5.3</a></span> [[DefineOwnProperty]] ( P, Desc)</h1>
<p>When the [[DefineOwnProperty]] internal method of an Integer Indexed exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, and <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a> <span class="nt">Desc</span> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has a [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String, then
<ol class="block">
<li>Let <i>numericIndex</i> be <a href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>
(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>numericIndex</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>numericIndex</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <a href="#sec-isinteger">IsInteger</a>(<i>numericIndex</i>) is <b>false</b>, return <b>false</b></li>
<li>Let <i>intIndex</i> be <i>numericIndex</i>.</li>
<li>If <i>intIndex</i> = −0, return <b>false</b>.</li>
<li>If <i>intIndex</i> < 0, return <b>false</b>.</li>
<li>Let <i>length</i> be the value of <i>O</i>’s [[ArrayLength]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>intIndex</i> ≥ <i>length</i>, return <b>false</b>.</li>
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>Desc</i>) is <b>true</b>, return
<b>false.</b></li>
<li>If <i>Desc</i> has a [[Configurable]] field and if <i>Desc</i>.[[Configurable]] is <b>true</b>, return
<b>false<i>.</i></b></li>
<li>If <i>Desc</i> has an [[Enumerable]] field and if <i>Desc</i>.[[Enumerable]] is <b>false</b>, return
<b>false<i>.</i></b></li>
<li>If <i>Desc</i> has a [[Writable]] field and if <i>Desc</i>.[[Writable]] is <b>false</b>, return
<b>false</b>.</li>
<li>If <i>Desc</i> has a [[Value]] field, then
<ol class="block">
<li>Let <i>value</i> be <i>Desc</i>.[[Value]].</li>
<li>Return <a href="#sec-integerindexedelementset">IntegerIndexedElementSet</a> (<i>O</i>, <i>intIndex</i>,
<i>value</i>).</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
</ol>
</li>
<li>Return <a href="#sec-ordinarydefineownproperty">OrdinaryDefineOwnProperty</a>(<i>O</i>, <i>P</i>, <i>Desc</i>).</li>
</ol>
</section>
<section id="sec-integer-indexed-exotic-objects-get-p-receiver">
<h1><span class="secnum" id="sec-9.4.5.4"><a href="#sec-integer-indexed-exotic-objects-get-p-receiver"
title="link to this section">9.4.5.4</a></span> [[Get]] (P, Receiver)</h1>
<p>When the [[Get]] internal method of an Integer Indexed exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> and <a href="#sec-ecmascript-language-types">ECMAScript language
value</a> <span class="nt">Receiver</span> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String and if <a
href="#sec-samevalue">SameValue</a>(<i>O</i>, <i>Receiver</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>numericIndex</i> be <a href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>
(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>numericIndex</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>numericIndex</i> is not <b>undefined</b>, then
<ol class="block">
<li>Return <a href="#sec-integerindexedelementget">IntegerIndexedElementGet</a> (<i>O</i>,
<i>numericIndex</i>).</li>
</ol>
</li>
</ol>
</li>
<li>Return the result of calling the default ordinary object [[Get]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver">9.1.8</a>) on <i>O</i> passing
<i>P</i> and <i>Receiver</i> as arguments.</li>
</ol>
</section>
<section id="sec-integer-indexed-exotic-objects-set-p-v-receiver">
<h1><span class="secnum" id="sec-9.4.5.5"><a href="#sec-integer-indexed-exotic-objects-set-p-v-receiver"
title="link to this section">9.4.5.5</a></span> [[Set]] ( P, V, Receiver)</h1>
<p>When the [[Set]] internal method of an Integer Indexed exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, value <var>V</var>, and <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> <span class="nt">Receiver</span>, the following steps
are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String and if <a
href="#sec-samevalue">SameValue</a>(<i>O</i>, <i>Receiver</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>numericIndex</i> be <a href="#sec-canonicalnumericindexstring">CanonicalNumericIndexString</a>
(<i>P</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>numericIndex</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</li>
<li>If <i>numericIndex</i> is not <b>undefined</b>, then
<ol class="block">
<li>Return <a href="#sec-integerindexedelementset">IntegerIndexedElementSet</a> (<i>O</i>, <i>numericIndex</i>,
<i>V</i>).</li>
</ol>
</li>
</ol>
</li>
<li>Return the result of calling the default ordinary object [[Set]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver">9.1.8</a>) on <i>O</i> passing
<i>P</i>, <i>V</i>, and <i>Receiver</i> as arguments.</li>
</ol>
</section>
<section id="sec-integer-indexed-exotic-objects-ownpropertykeys">
<h1><span class="secnum" id="sec-9.4.5.6"><a href="#sec-integer-indexed-exotic-objects-ownpropertykeys"
title="link to this section">9.4.5.6</a></span> [[OwnPropertyKeys]] ()</h1>
<p>When the [[OwnPropertyKeys]] internal method of an Integer Indexed exotic object <var>O</var> is called the following
steps are taken:</p>
<ol class="proc">
<li>Let <i>keys</i> be a new empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has [[ViewedArrayBuffer]],
[[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.</li>
<li>Let <i>len</i> be the value of <i>O</i>’s [[ArrayLength]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>For each integer <i>i</i> starting with 0 such that <i>i</i> < <i>len</i>, in ascending order,
<ol class="block">
<li>Add <a href="#sec-tostring">ToString</a>(<i>i</i>) as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> such that <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is String and <i>P</i> is not an integer index, in
property creation order
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>For each own <a href="#sec-object-type">property key</a> <i>P</i> of <i>O</i> such that <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is Symbol, in property creation order
<ol class="block">
<li>Add <i>P</i> as the last element of <i>keys</i>.</li>
</ol>
</li>
<li>Return <i>keys</i>.</li>
</ol>
</section>
<section id="sec-integerindexedobjectcreate">
<h1><span class="secnum" id="sec-9.4.5.7"><a href="#sec-integerindexedobjectcreate"
title="link to this section">9.4.5.7</a></span> IntegerIndexedObjectCreate <span style="font-family:
sans-serif">(prototype, internalSlotsList)</span></h1>
<p>The abstract operation IntegerIndexedObjectCreate with arguments <var>prototype</var> and <var>internalSlotsList</var>
is used to specify the creation of new Integer Indexed exotic objects. The argument <var>internalSlotsList</var> is a <a
href="#sec-list-and-record-specification-type">List</a> of the names of additional internal slots that must be defined as
part of the object. IntegerIndexedObjectCreate performs the following steps:</p>
<ol class="proc">
<li>Let <i>A</i> be a newly created object with an <a href="#sec-object-internal-methods-and-internal-slots">internal
slot</a> for each name in <i>internalSlotsList</i>.</li>
<li>Set <i>A</i>’s essential internal methods to the default ordinary object definitions specified in <a
href="#sec-ordinary-object-internal-methods-and-internal-slots">9.1</a>.</li>
<li>Set the [[GetOwnProperty]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-getownproperty-p">9.4.5.1</a>.</li>
<li>Set the [[HasProperty]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-hasproperty-p">9.4.5.2</a>.</li>
<li>Set the [[DefineOwnProperty]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-defineownproperty-p-desc">9.4.5.3</a>.</li>
<li>Set the [[Get]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-get-p-receiver">9.4.5.4</a>.</li>
<li>Set the [[Set]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-set-p-v-receiver">9.4.5.5</a>.</li>
<li>Set the [[OwnPropertyKeys]] internal method of <i>A</i> as specified in <a
href="#sec-integer-indexed-exotic-objects-ownpropertykeys">9.4.5.6</a>.</li>
<li>Set the [[Prototype]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>A</i> to
<i>prototype</i>.</li>
<li>Set the [[Extensible]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>A</i> to
<b>true</b>.</li>
<li>Return <i>A</i>.</li>
</ol>
</section>
<section id="sec-integerindexedelementget">
<h1><span class="secnum" id="sec-9.4.5.8"><a href="#sec-integerindexedelementget"
title="link to this section">9.4.5.8</a></span> IntegerIndexedElementGet ( O, index )</h1>
<p>The abstract operation IntegerIndexedElementGet with arguments <var>O</var> and <var>index</var> performs the following
steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>index</i>) is Number.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has [[ViewedArrayBuffer]],
[[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.</li>
<li>Let <i>buffer</i> be the value of <i>O</i>’s [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-isdetachedbuffer">IsDetachedBuffer</a>(<i>buffer</i>) is <b>true</b>, throw a <b>TypeError</b>
exception.</li>
<li>If <a href="#sec-isinteger">IsInteger</a>(<i>index</i>) is <b>false</b>, return <b>undefined</b></li>
<li>If <i>index</i> = −0, return <b>undefined</b>.</li>
<li>Let <i>length</i> be the value of <i>O</i>’s [[ArrayLength]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>index</i> < 0 or <i>index</i> ≥ <i>length</i>, return <b>undefined</b>.</li>
<li>Let <i>offset</i> be the value of <i>O</i>’s [[ByteOffset]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>arrayTypeName</i> be the string value of <i>O</i>’s [[TypedArrayName]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>elementSize</i> be the Number value of the Element Size value specified in <a href="#table-49">Table 49</a>
for <i>arrayTypeName</i>.</li>
<li>Let <i>indexedPosition</i> = (<i>index</i> × <i>elementSize</i>) + <i>offset</i>.</li>
<li>Let <i>elementType</i> be the string value of the Element Type value in <a href="#table-49">Table 49</a> for
<i>arrayTypeName</i>.</li>
<li>Return <a href="#sec-getvaluefrombuffer">GetValueFromBuffer</a>(<i>buffer</i>, <i>indexedPosition</i>,
<i>elementType</i>).</li>
</ol>
</section>
<section id="sec-integerindexedelementset">
<h1><span class="secnum" id="sec-9.4.5.9"><a href="#sec-integerindexedelementset"
title="link to this section">9.4.5.9</a></span> IntegerIndexedElementSet ( O, index, value )</h1>
<p>The abstract operation IntegerIndexedElementSet with arguments <var>O</var>, <var>index</var>, and <var>value</var>
performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>index</i>) is Number.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>O</i> is an Object that has [[ViewedArrayBuffer]],
[[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.</li>
<li>Let <i>numValue</i> be <a href="#sec-tonumber">ToNumber</a>(<i>value</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>numValue</i>).</li>
<li>Let <i>buffer</i> be the value of <i>O</i>’s [[ViewedArrayBuffer]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <a href="#sec-isdetachedbuffer">IsDetachedBuffer</a>(<i>buffer</i>) is <b>true</b>, throw a <b>TypeError</b>
exception.</li>
<li>If <a href="#sec-isinteger">IsInteger</a>(<i>index</i>) is <b>false</b>, return <b>false</b></li>
<li>If <i>index</i> = −0, return <b>false</b>.</li>
<li>Let <i>length</i> be the value of <i>O</i>’s [[ArrayLength]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>index</i> < 0 or <i>index</i> ≥ <i>length</i>, return <b>false</b>.</li>
<li>Let <i>offset</i> be the value of <i>O</i>’s [[ByteOffset]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>arrayTypeName</i> be the string value of <i>O</i>’s [[TypedArrayName]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>elementSize</i> be the Number value of the Element Size value specified in <a href="#table-49">Table 49</a>
for <i>arrayTypeName</i>.</li>
<li>Let <i>indexedPosition</i> = (<i>index</i> × <i>elementSize</i>) + <i>offset</i>.</li>
<li>Let <i>elementType</i> be the string value of the Element Type value in <a href="#table-49">Table 49</a> for
<i>arrayTypeName</i>.</li>
<li>Let <i>status</i> be <a href="#sec-setvalueinbuffer">SetValueInBuffer</a>(<i>buffer</i>, <i>indexedPosition</i>,
<i>elementType</i>, <i>numValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
</section>
<section id="sec-module-namespace-exotic-objects">
<div class="front">
<h1><span class="secnum" id="sec-9.4.6"><a href="#sec-module-namespace-exotic-objects"
title="link to this section">9.4.6</a></span> Module Namespace Exotic Objects</h1>
<p>A <i>module namespace object</i> is an exotic object that exposes the bindings exported from an ECMAScript <span
class="nt">Module</span> <var>(See <a href="#sec-exports">15.2.3</a>)</var>. There is a one-to-one correspondence between
the String-keyed own properties of a module namespace exotic object and the binding names exported by the <span
class="nt">Module</span>. The exported bindings include any bindings that are indirectly exported using <code>export
*</code> export items. Each String-valued own <a href="#sec-object-type">property key</a> is the StringValue of the
corresponding exported binding name. These are the only String-keyed properties of a module namespace exotic object. Each
such property has the attributes {[[Configurable]]: <span class="value">false</span>, [[Enumerable]]: <span
class="value">true</span>}. Module namespace objects are not extensible.</p>
<p>Module namespace objects have the internal slots defined in <a href="#table-29">Table 29</a>.</p>
<figure>
<figcaption><span id="table-29">Table 29</span> — Internal Slots of Module Namespace Exotic Objects</figcaption>
<table class="real-table">
<tr>
<th>Internal Slot</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>[[Module]]</td>
<td>Module Record</td>
<td>The Module Record whose exports this namespace exposes.</td>
</tr>
<tr>
<td>[[Exports]]</td>
<td><a href="#sec-list-and-record-specification-type">List</a> of String</td>
<td>A <a href="#sec-list-and-record-specification-type">List</a> containing the String values of the exported names exposed as own properties of this object. The list is ordered as if an Array of those string values had been sorted using <code><a href="#sec-array.prototype.sort">Array.prototype.sort</a></code> using <a href="#sec-sortcompare">SortCompare</a> as <i><span style="font-family: Times New Roman">comparefn</span>.</i></td>
</tr>
</table>
</figure>
<p>Module namespace exotic objects provide alternative definitions for all of the internal methods.</p>
</div>
<section id="sec-module-namespace-exotic-objects-getprototypeof">
<h1><span class="secnum" id="sec-9.4.6.1"><a href="#sec-module-namespace-exotic-objects-getprototypeof"
title="link to this section">9.4.6.1</a></span> [[GetPrototypeOf]] ( )</h1>
<p>When the [[GetPrototypeOf]] internal method of a module namespace exotic object <var>O</var> is called the following
steps are taken:</p>
<ol class="proc">
<li>Return <b>null</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-setprototypeof-v">
<h1><span class="secnum" id="sec-9.4.6.2"><a href="#sec-module-namespace-exotic-objects-setprototypeof-v"
title="link to this section">9.4.6.2</a></span> [[SetPrototypeOf]] (V)</h1>
<p>When the [[SetPrototypeOf]] internal method of a module namespace exotic object <var>O</var> is called with argument
<var>V</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: Either <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Object or <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Null.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-isextensible">
<h1><span class="secnum" id="sec-9.4.6.3"><a href="#sec-module-namespace-exotic-objects-isextensible"
title="link to this section">9.4.6.3</a></span> [[IsExtensible]] ( )</h1>
<p>When the [[IsExtensible]] internal method of a module namespace exotic object <var>O</var> is called the following
steps are taken:</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-preventextensions">
<h1><span class="secnum" id="sec-9.4.6.4"><a href="#sec-module-namespace-exotic-objects-preventextensions"
title="link to this section">9.4.6.4</a></span> [[PreventExtensions]] ( )</h1>
<p>When the [[PreventExtensions]] internal method of a module namespace exotic object <var>O</var> is called the following
steps are taken:</p>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-getownproperty-p">
<h1><span class="secnum" id="sec-9.4.6.5"><a href="#sec-module-namespace-exotic-objects-getownproperty-p"
title="link to this section">9.4.6.5</a></span> [[GetOwnProperty]] (P)</h1>
<p>When the [[GetOwnProperty]] internal method of a module namespace exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is Symbol, return <a
href="#sec-ordinarygetownproperty">OrdinaryGetOwnProperty</a>(<i>O</i>, <i>P</i>).</li>
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-defineownproperty-p-desc">
<h1><span class="secnum" id="sec-9.4.6.6"><a href="#sec-module-namespace-exotic-objects-defineownproperty-p-desc"
title="link to this section">9.4.6.6</a></span> [[DefineOwnProperty]] (P, Desc)</h1>
<p>When the [[DefineOwnProperty]] internal method of a module namespace exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> and <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a> <span class="nt">Desc</span>, the following steps are taken:</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-hasproperty-p">
<h1><span class="secnum" id="sec-9.4.6.7"><a href="#sec-module-namespace-exotic-objects-hasproperty-p"
title="link to this section">9.4.6.7</a></span> [[HasProperty]] (P)</h1>
<p>When the [[HasProperty]] internal method of a module namespace exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is Symbol, return <a
href="#sec-ordinaryhasproperty">OrdinaryHasProperty</a>(<i>O</i>, <i>P</i>).</li>
<li>Let <i>exports</i> be the value of <i>O</i>’s [[Exports]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>P</i> is an element of <i>exports</i>, return <b>true</b>.</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-get-p-receiver">
<h1><span class="secnum" id="sec-9.4.6.8"><a href="#sec-module-namespace-exotic-objects-get-p-receiver"
title="link to this section">9.4.6.8</a></span> [[Get]] (P, Receiver)</h1>
<p>When the [[Get]] internal method of a module namespace exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> and <a href="#sec-ecmascript-language-types">ECMAScript language
value</a> <span class="nt">Receiver</span> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>P</i>) is Symbol, then
<ol class="block">
<li>Return the result of calling the default ordinary object [[Get]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver">9.1.8</a>) on <i>O</i> passing
<i>P</i> and <i>Receiver</i> as arguments.</li>
</ol>
</li>
<li>Let <i>exports</i> be the value of <i>O</i>’s [[Exports]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>P</i> is not an element of <i>exports</i>, return <b>undefined</b>.</li>
<li>Let <i>m</i> be the value of <i>O</i>’s [[Module]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>binding</i> be <i>m</i>.<a href="#sec-resolveexport">ResolveExport</a>(<i>P</i>, «»,
«»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>binding</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>binding</i> is neither <b>null</b> nor
<code>"ambiguous"</code>.</li>
<li>Let <i>targetModule</i> be <i>binding</i>.[[module]],</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>targetModule</i> is not <b>undefined</b>.</li>
<li>Let <i>targetEnv</i> be <i>targetModule</i>.[[Environment]].</li>
<li>If <i>targetEnv</i> is <b>undefined</b>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>targetEnvRec</i> be <i>targetEnv</i>’s EnvironmentRecord.</li>
<li>Return <i>targetEnvRec</i>.GetBindingValue(<i>binding.</i>[[bindingName]], <b>true</b>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> <a href="#sec-resolveexport">ResolveExport</a> is idempotent and side-effect free. An
implementation might choose to pre-compute or cache the <a href="#sec-resolveexport">ResolveExport</a> results for the
[[Exports]] of each module namespace exotic object.</p>
</div>
</section>
<section id="sec-module-namespace-exotic-objects-set-p-v-receiver">
<h1><span class="secnum" id="sec-9.4.6.9"><a href="#sec-module-namespace-exotic-objects-set-p-v-receiver"
title="link to this section">9.4.6.9</a></span> [[Set]] ( P, V, Receiver)</h1>
<p>When the [[Set]] internal method of <span style="font-family: Times New Roman">a</span> module namespace exotic object
<var>O</var> is called with <a href="#sec-object-type">property key</a> <var>P</var>, value <var>V</var>, and <a
href="#sec-ecmascript-language-types">ECMAScript language value</a> <span class="nt">Receiver</span>, the following steps
are taken:</p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-delete-p">
<h1><span class="secnum" id="sec-9.4.6.10"><a href="#sec-module-namespace-exotic-objects-delete-p"
title="link to this section">9.4.6.10</a></span> [[Delete]] (P)</h1>
<p>When the [[Delete]] internal method of a module namespace exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>exports</i> be the value of <i>O</i>’s [[Exports]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>If <i>P</i> is an element of <i>exports</i>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-enumerate">
<h1><span class="secnum" id="sec-9.4.6.11"><a href="#sec-module-namespace-exotic-objects-enumerate"
title="link to this section">9.4.6.11</a></span> [[Enumerate]] ()</h1>
<p>When the [[Enumerate]] internal method of a module namespace exotic object <var>O</var> is called the following steps
are taken:</p>
<ol class="proc">
<li>Let <i>exports</i> be the value of <i>O</i>’s [[Exports]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Return <a href="#sec-createlistiterator">CreateListIterator</a>(<i>exports</i>).</li>
</ol>
</section>
<section id="sec-module-namespace-exotic-objects-ownpropertykeys">
<h1><span class="secnum" id="sec-9.4.6.12"><a href="#sec-module-namespace-exotic-objects-ownpropertykeys"
title="link to this section">9.4.6.12</a></span> [[OwnPropertyKeys]] ( )</h1>
<p>When the [[OwnPropertyKeys]] internal method of a module namespace exotic object <var>O</var> is called the following
steps are taken:</p>
<ol class="proc">
<li>Let <i>exports</i> be a copy of the value of <i>O</i>’s [[Exports]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a>.</li>
<li>Let <i>symbolKeys</i> be the result of calling the default ordinary object [[OwnPropertyKeys]] internal method (<a
href="#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys">9.1.12</a>) on <i>O</i> passing no
arguments.</li>
<li>Append all the entries of <i>symbolKeys</i> to the end of <i>exports</i>.</li>
<li>Return <i>exports</i>.</li>
</ol>
</section>
<section id="sec-modulenamespacecreate">
<h1><span class="secnum" id="sec-9.4.6.13"><a href="#sec-modulenamespacecreate"
title="link to this section">9.4.6.13</a></span> ModuleNamespaceCreate (module, exports)</h1>
<p>The abstract operation ModuleNamespaceCreate with arguments <var>module</var>, and <var>exports</var> is used to
specify the creation of new module namespace exotic objects. It performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>module</i> is a Module Record (<a
href="#sec-abstract-module-records">see 15.2.1.14</a>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>module</i>.[[Namespace]] is <b>undefined</b>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>exports</i> is a <a
href="#sec-list-and-record-specification-type">List</a> of string values.</li>
<li>Let <i>M</i> be a newly created object.</li>
<li>Set <i>M</i>’s essential internal methods to the definitions specified in <a
href="#sec-module-namespace-exotic-objects">9.4.6</a>.</li>
<li>Set <i>M</i>’s [[Module]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>module</i>.</li>
<li>Set <i>M</i>’s [[Exports]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> to
<i>exports</i>.</li>
<li>Create own properties of <i>M</i> corresponding to the definitions in <a
href="#sec-module-namespace-objects">26.3</a>.</li>
<li>Set <i>module</i>.[[Namespace]] to <i>M</i>.</li>
<li>Return <i>M</i>.</li>
</ol>
</section>
</section>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots">
<div class="front">
<h1><span class="secnum" id="sec-9.5"><a href="#sec-proxy-object-internal-methods-and-internal-slots"
title="link to this section">9.5</a></span> Proxy Object Internal Methods and Internal Slots</h1>
<p>A proxy object is an exotic object whose essential internal methods are partially implemented using ECMAScript code.
Every proxy objects has an <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> called
[[ProxyHandler]]. The value of [[ProxyHandler]] is an object, called the proxy’s <i>handler object</i>, or <span
class="value">null</span>. Methods (see <a href="#table-30">Table 30</a>) of a handler object may be used to augment the
implementation for one or more of the proxy object’s internal methods. Every proxy object also has an <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> called [[ProxyTarget]] whose value is either an
object or the <b>null</b> value. This object is called the proxy’s <i>target object</i>.</p>
<figure>
<figcaption><span id="table-30">Table 30</span> — Proxy Handler Methods</figcaption>
<table class="real-table">
<tr>
<th>Internal Method</th>
<th>Handler Method</th>
</tr>
<tr>
<td>[[GetPrototypeOf]]</td>
<td><code>getPrototypeOf</code></td>
</tr>
<tr>
<td>[[SetPrototypeOf]]</td>
<td><code>setPrototypeOf</code></td>
</tr>
<tr>
<td>[[IsExtensible]]</td>
<td><code>isExtensible</code></td>
</tr>
<tr>
<td>[[PreventExtensions]]</td>
<td><code>preventExtensions</code></td>
</tr>
<tr>
<td>[[GetOwnProperty]]</td>
<td><code>getOwnPropertyDescriptor</code></td>
</tr>
<tr>
<td>[[HasProperty]]</td>
<td><code>has</code></td>
</tr>
<tr>
<td>[[Get]]</td>
<td><code>get</code></td>
</tr>
<tr>
<td>[[Set]]</td>
<td><code>set</code></td>
</tr>
<tr>
<td>[[Delete]]</td>
<td><code>deleteProperty</code></td>
</tr>
<tr>
<td>[[DefineOwnProperty]]</td>
<td><code>defineProperty</code></td>
</tr>
<tr>
<td>[[Enumerate]]</td>
<td><code>enumerate</code></td>
</tr>
<tr>
<td>[[OwnPropertyKeys]]</td>
<td><code>ownKeys</code></td>
</tr>
<tr>
<td>[[Call]]</td>
<td><code>apply</code></td>
</tr>
<tr>
<td>[[Construct]]</td>
<td><code>construct</code></td>
</tr>
</table>
</figure>
<p>When a handler method is called to provide the implementation of a proxy object internal method, the handler method is
passed the proxy’s target object as a parameter. A proxy’s handler object does not necessarily have a method
corresponding to every essential internal method. Invoking an internal method on the proxy results in the invocation of the
corresponding internal method on the proxy’s target object if the handler object does not have a method corresponding
to the internal trap.</p>
<p>The [[ProxyHandler]] and [[ProxyTarget]] internal slots of a proxy object are always initialized when the object is
created and typically may not be modified. Some proxy objects are created in a manner that permits them to be subsequently
<i>revoked</i>. When a proxy is revoked, its [[ProxyHander]] and [[ProxyTarget]] internal slots are set to <b>null</b>
causing subsequent invocations of internal methods on that proxy object to throw a <span class="value">TypeError</span>
exception.</p>
<p>Because proxy objects permit the implementation of internal methods to be provided by arbitrary ECMAScript code, it is
possible to define a proxy object whose handler methods violates the invariants defined in <a
href="#sec-invariants-of-the-essential-internal-methods">6.1.7.3</a>. Some of the internal method invariants defined in <a
href="#sec-invariants-of-the-essential-internal-methods">6.1.7.3</a> are essential integrity invariants. These invariants
are explicitly enforced by the proxy object internal methods specified in this section. An ECMAScript implementation must be
robust in the presence of all possible invariant violations.</p>
<p>In the following algorithm descriptions, assume <var>O</var> is an ECMAScript proxy object, <var>P</var> is a <a
href="#sec-object-type">property key value</a>, <var>V</var> is any <a href="#sec-ecmascript-language-types">ECMAScript
language value</a> and <span style="font-family: Times New Roman">Desc</span> is a <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> record.</p>
</div>
<section id="sec-proxy-object-internal-methods-and-internal-slots-getprototypeof">
<h1><span class="secnum" id="sec-9.5.1"><a href="#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof"
title="link to this section">9.5.1</a></span> [[GetPrototypeOf]] ( )</h1>
<p>When the [[GetPrototypeOf]] internal method of a Proxy exotic object <var>O</var> is called the following steps are
taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"getPrototypeOf"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[GetPrototypeOf]]().</li>
</ol>
</li>
<li>Let <i>handlerProto</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>,
«<i>target</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>handlerProto</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handlerProto</i>) is neither Object nor Null, throw a
<b>TypeError</b> exception.</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>If <i>extensibleTarget</i> is <b>true</b>, return <i>handlerProto</i>.</li>
<li>Let <i>targetProto</i> be <i>target</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetProto</i>).</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>handlerProto</i>, <i>targetProto</i>) is <b>false</b>, throw a
<b>TypeError</b> exception.</li>
<li>Return <i>handlerProto</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[GetPrototypeOf]] for proxy objects enforces the following invariant:</p>
<ul>
<li>
<p>The result of [[GetPrototypeOf]] must be either an Object or <b>null</b>.</p>
</li>
<li>
<p>If the target object is not extensible, [[GetPrototypeOf]] applied to the proxy object must return the same value
as [[GetPrototypeOf]] applied to the proxy object’s target object.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v">
<h1><span class="secnum" id="sec-9.5.2"><a href="#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v"
title="link to this section">9.5.2</a></span> [[SetPrototypeOf]] (V)</h1>
<p>When the [[SetPrototypeOf]] internal method of a Proxy exotic object <var>O</var> is called with argument <var>V</var>
the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: Either <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Object or <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>V</i>) is Null.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"setPrototypeOf"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[SetPrototypeOf]](<i>V</i>).</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>, <i>V</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>If <i>extensibleTarget</i> is <b>true</b>, return <i>booleanTrapResult</i>.</li>
<li>Let <i>targetProto</i> be <i>target</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetProto</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>true</b> and <a href="#sec-samevalue">SameValue</a>(<i>V</i>, <i>targetProto</i>) is
<b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <i>booleanTrapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[SetPrototypeOf]] for proxy objects enforces the following invariant:</p>
<ul>
<li>
<p>The result of [[SetPrototypeOf]] is a Boolean value.</p>
</li>
<li>
<p>If the target object is not extensible, the argument value must be the same as the result of [[GetPrototypeOf]]
applied to target object.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-isextensible">
<h1><span class="secnum" id="sec-9.5.3"><a href="#sec-proxy-object-internal-methods-and-internal-slots-isextensible"
title="link to this section">9.5.3</a></span> [[IsExtensible]] ( )</h1>
<p>When the [[IsExtensible]] internal method of a Proxy exotic object <var>O</var> is called the following steps are
taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"isExtensible"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[IsExtensible]]().</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>Let <i>targetResult</i> be <i>target</i>.[[IsExtensible]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetResult</i>).</li>
<li>If <a href="#sec-samevalue">SameValue</a>(<i>booleanTrapResult</i>, <i>targetResult</i>) is <b>false</b>, throw a
<b>TypeError</b> exception.</li>
<li>Return <i>booleanTrapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[IsExtensible]] for proxy objects enforces the following invariant:</p>
<ul>
<li>
<p>The result of [[IsExtensible]] is a Boolean value.</p>
</li>
<li>
<p>[[IsExtensible]] applied to the proxy object must return the same value as [[IsExtensible]] applied to the proxy
object’s target object with the same argument.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-preventextensions">
<h1><span class="secnum" id="sec-9.5.4"><a href="#sec-proxy-object-internal-methods-and-internal-slots-preventextensions"
title="link to this section">9.5.4</a></span> [[PreventExtensions]] ( )</h1>
<p>When the [[PreventExtensions]] internal method of a Proxy exotic object <var>O</var> is called the following steps are
taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"preventExtensions"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[PreventExtensions]]().</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>true</b>, then
<ol class="block">
<li>Let <i>targetIsExtensible</i> be <i>target</i>.[[IsExtensible]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetIsExtensible</i>).</li>
<li>If <i>targetIsExtensible</i> is <b>true</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
<li>Return <i>booleanTrapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[PreventExtensions]] for proxy objects enforces the following invariant:</p>
<ul>
<li>
<p>The result of [[PreventExtensions]] is a Boolean value.</p>
</li>
<li>
<p>[[PreventExtensions]] applied to the proxy object only returns <b>true</b> if [[IsExtensible]] applied to the proxy
object’s target object is <b>false</b>.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p">
<h1><span class="secnum" id="sec-9.5.5"><a href="#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p"
title="link to this section">9.5.5</a></span> [[GetOwnProperty]] (P)</h1>
<p>When the [[GetOwnProperty]] internal method of a Proxy exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>,
<code>"getOwnPropertyDescriptor"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
</ol>
</li>
<li>Let <i>trapResultObj</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>, «<i>target</i>,
<i>P</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trapResultObj</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>trapResultObj</i>) is neither Object nor Undefined,
throw a <b>TypeError</b> exception.</li>
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>If <i>trapResultObj</i> is <b>undefined</b>, then
<ol class="block">
<li>If <i>targetDesc</i> is <b>undefined</b>, return <b>undefined</b>.</li>
<li>If <i>targetDesc</i>.[[Configurable]] is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>If <a href="#sec-toboolean">ToBoolean</a>(<i>extensibleTarget</i>) is <b>false</b>, throw a <b>TypeError</b>
exception.</li>
<li>Return <b>undefined</b>.</li>
</ol>
</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>Let <i>resultDesc</i> be <a href="#sec-topropertydescriptor">ToPropertyDescriptor</a>(<i>trapResultObj</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>resultDesc</i>).</li>
<li><a href="#sec-call">Call</a> <a
href="#sec-completepropertydescriptor">CompletePropertyDescriptor</a>(<i>resultDesc</i>).</li>
<li>Let <i>valid</i> be <a href="#sec-iscompatiblepropertydescriptor">IsCompatiblePropertyDescriptor</a>
(<i>extensibleTarget</i>, <i>resultDesc</i>, <i>targetDesc</i>).</li>
<li>If <i>valid</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>If <i>resultDesc</i>.[[Configurable]] is <b>false</b>, then
<ol class="block">
<li>If <i>targetDesc</i> is <b>undefined</b> or <i>targetDesc</i>.[[Configurable]] is <b>true</b><i>,</i> then
<ol class="block">
<li>Throw a <b>TypeError</b> exception.</li>
</ol>
</li>
</ol>
</li>
<li>Return <i>resultDesc</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[GetOwnProperty]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The result of [[GetOwnProperty]] must be either an Object or <b>undefined</b>.</p>
</li>
<li>
<p>A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target
object.</p>
</li>
<li>
<p>A property cannot be reported as non-existent, if it exists as an own property of the target object and the target
object is not extensible.</p>
</li>
<li>
<p>A property cannot be reported as existent, if it does not exists as an own property of the target object and the
target object is not extensible.</p>
</li>
<li>
<p>A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or
if it exists as a configurable own property of the target object.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc">
<h1><span class="secnum" id="sec-9.5.6"><a
href="#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc"
title="link to this section">9.5.6</a></span> [[DefineOwnProperty]] (P, Desc)</h1>
<p>When the [[DefineOwnProperty]] internal method of a Proxy exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> and <a href="#sec-property-descriptor-specification-type">Property
Descriptor</a> <span class="nt">Desc</span>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"defineProperty"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[DefineOwnProperty]](<i>P</i>, <i>Desc</i>).</li>
</ol>
</li>
<li>Let <i>descObj</i> be <a href="#sec-frompropertydescriptor">FromPropertyDescriptor</a>(<i>Desc</i>).</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>, <i>P</i>, <i>descObj</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>If <i>Desc</i> has a [[Configurable]] field and if <i>Desc</i>.[[Configurable]] is <b>false,</b> then
<ol class="block">
<li>Let <i>settingConfigFalse</i> be <b>true</b>.</li>
</ol>
</li>
<li>Else let <i>settingConfigFalse</i> be <b>false</b>.</li>
<li>If <i>targetDesc</i> is <b>undefined</b>, then
<ol class="block">
<li>If <i>extensibleTarget</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>If <i>settingConfigFalse</i> is <b>true</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
<li>Else <i>targetDesc</i> is not <b>undefined<i>,</i></b>
<ol class="block">
<li>If <a href="#sec-iscompatiblepropertydescriptor">IsCompatiblePropertyDescriptor</a>(<i>extensibleTarget</i>,
<i>Desc</i> , <i>targetDesc</i>) is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>If <i>settingConfigFalse</i> is <b>true</b> and <i>targetDesc</i>.[[Configurable]] is <b>true</b>, throw a
<b>TypeError</b> exception.</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[DefineOwnProperty]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The result of [[DefineOwnProperty]] is a Boolean value.</p>
</li>
<li>
<p>A property cannot be added, if the target object is not extensible.</p>
</li>
<li>
<p>A property cannot be non-configurable, unless there exists a corresponding non-configurable own property of the
target object.</p>
</li>
<li>
<p>If a property has a corresponding target object property then applying the <a
href="#sec-property-descriptor-specification-type">Property Descriptor</a> of the property to the target object using
[[DefineOwnProperty]] will not throw an exception.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p">
<h1><span class="secnum" id="sec-9.5.7"><a href="#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p"
title="link to this section">9.5.7</a></span> [[HasProperty]] (P)</h1>
<p>When the [[HasProperty]] internal method of a Proxy exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"has"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[HasProperty]](<i>P</i>).</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>, <i>P</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>If <i>targetDesc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <i>targetDesc</i>.[[Configurable]] is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>If <i>extensibleTarget</i> is <b>false</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
</ol>
</li>
<li>Return <i>booleanTrapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[HasProperty]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The result of [[HasProperty]] is a Boolean value.</p>
</li>
<li>
<p>A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target
object.</p>
</li>
<li>
<p>A property cannot be reported as non-existent, if it exists as an own property of the target object and the target
object is not extensible.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver">
<h1><span class="secnum" id="sec-9.5.8"><a href="#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver"
title="link to this section">9.5.8</a></span> [[Get]] (P, Receiver)</h1>
<p>When the [[Get]] internal method of a Proxy exotic object <var>O</var> is called with <a href="#sec-object-type">property
key</a> <var>P</var> and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span
class="nt">Receiver</span> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"get"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[Get]](<i>P</i>, <i>Receiver</i>).</li>
</ol>
</li>
<li>Let <i>trapResult</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>, «<i>target</i>, <i>P</i>,
<i>Receiver</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trapResult</i>).</li>
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>If <i>targetDesc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>targetDesc</i>) and <i>targetDesc</i>.[[Configurable]]
is <b>false</b> and <i>targetDesc</i>.[[Writable]] is <b>false</b>, then
<ol class="block">
<li>If <a href="#sec-samevalue">SameValue</a>(<i>trapResult</i>, <i>targetDesc</i>.[[Value]]) is <b>false</b>,
throw a <b>TypeError</b> exception.</li>
</ol>
</li>
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>targetDesc</i>) and
<i>targetDesc</i>.[[Configurable]] is <b>false</b> and <i>targetDesc</i>.[[Get]] is <b>undefined</b>, then
<ol class="block">
<li>If <i>trapResult</i> is not <b>undefined</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
</ol>
</li>
<li>Return <i>trapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[Get]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The value reported for a property must be the same as the value of the corresponding target object property if the
target object property is a non-writable, non-configurable own data property.</p>
</li>
<li>
<p>The value reported for a property must be <b>undefined</b> if the corresponding target object property is a
non-configurable own accessor property that has <b>undefined</b> as its [[Get]] attribute.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver">
<h1><span class="secnum" id="sec-9.5.9"><a href="#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver"
title="link to this section">9.5.9</a></span> [[Set]] ( P, V, Receiver)</h1>
<p>When the [[Set]] internal method of a Proxy exotic object <var>O</var> is called with <a href="#sec-object-type">property
key</a> <var>P</var>, value <var>V</var>, and <a href="#sec-ecmascript-language-types">ECMAScript language value</a> <span
class="nt">Receiver</span>, the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"set"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[Set]](<i>P</i>, <i>V</i>, <i>Receiver</i>).</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>, <i>P</i>, <i>V</i>, <i>Receiver</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>If <i>targetDesc</i> is not <b>undefined</b>, then
<ol class="block">
<li>If <a href="#sec-isdatadescriptor">IsDataDescriptor</a>(<i>targetDesc</i>) and <i>targetDesc</i>.[[Configurable]]
is <b>false</b> and <i>targetDesc</i>.[[Writable]] is <b>false</b>, then
<ol class="block">
<li>If <a href="#sec-samevalue">SameValue</a>(<i>V</i>, <i>targetDesc</i>.[[Value]]) is <b>false</b>, throw a
<b>TypeError</b> exception.</li>
</ol>
</li>
<li>If <a href="#sec-isaccessordescriptor">IsAccessorDescriptor</a>(<i>targetDesc</i>) and
<i>targetDesc</i>.[[Configurable]] is <b>false</b>, then
<ol class="block">
<li>If <i>targetDesc</i>.[[Set]] is <b>undefined</b>, throw a <b>TypeError</b> exception.</li>
</ol>
</li>
</ol>
</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[Set]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The result of [[Set]] is a Boolean value.</p>
</li>
<li>
<p>Cannot change the value of a property to be different from the value of the corresponding target object property if
the corresponding target object property is a non-writable, non-configurable own data property.</p>
</li>
<li>
<p>Cannot set the value of a property if the corresponding target object property is a non-configurable own accessor
property that has <b>undefined</b> as its [[Set]] attribute.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-delete-p">
<h1><span class="secnum" id="sec-9.5.10"><a href="#sec-proxy-object-internal-methods-and-internal-slots-delete-p"
title="link to this section">9.5.10</a></span> [[Delete]] (P)</h1>
<p>When the [[Delete]] internal method of a Proxy exotic object <var>O</var> is called with <a
href="#sec-object-type">property key</a> <var>P</var> the following steps are taken:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a href="#sec-ispropertykey">IsPropertyKey</a>(<i>P</i>) is
<b>true</b>.</li>
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"deleteProperty"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[Delete]](<i>P</i>).</li>
</ol>
</li>
<li>Let <i>booleanTrapResult</i> be <a href="#sec-toboolean">ToBoolean</a>(<a href="#sec-call">Call</a>(<i>trap</i>,
<i>handler</i>, «<i>target</i>, <i>P</i>»)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>booleanTrapResult</i>).</li>
<li>If <i>booleanTrapResult</i> is <b>false</b>, return <b>false</b>.</li>
<li>Let <i>targetDesc</i> be <i>target</i>.[[GetOwnProperty]](<i>P</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetDesc</i>).</li>
<li>If <i>targetDesc</i> is <b>undefined</b>, return <b>true</b>.</li>
<li>If <i>targetDesc</i>.[[Configurable]] is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[Delete]] for proxy objects enforces the following invariant:</p>
<ul>
<li>The result of [[Delete]] is a Boolean value.</li>
<li>A property cannot be reported as deleted, if it exists as a non-configurable own property of the target object.</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-enumerate">
<h1><span class="secnum" id="sec-9.5.11"><a href="#sec-proxy-object-internal-methods-and-internal-slots-enumerate"
title="link to this section">9.5.11</a></span> [[Enumerate]] ()</h1>
<p>When the [[Enumerate]] internal method of a Proxy exotic object <var>O</var> is called the following steps are taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"enumerate"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[Enumerate]]().</li>
</ol>
</li>
<li>Let <i>trapResult</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>, «<i>target</i>»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trapResult</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>trapResult</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>trapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[Enumerate]] for proxy objects enforces the following invariants:</p>
<ul>
<li>The result of [[Enumerate]] must be an Object.</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys">
<h1><span class="secnum" id="sec-9.5.12"><a href="#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys"
title="link to this section">9.5.12</a></span> [[OwnPropertyKeys]] ( )</h1>
<p>When the [[OwnPropertyKeys]] internal method of a Proxy exotic object <var>O</var> is called the following steps are
taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"ownKeys"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <i>target</i>.[[OwnPropertyKeys]]().</li>
</ol>
</li>
<li>Let <i>trapResultArray</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>,
«<i>target</i>»).</li>
<li>Let <i>trapResult</i> be <a href="#sec-createlistfromarraylike">CreateListFromArrayLike</a>(<i>trapResultArray</i>,
«‍String, Symbol»).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trapResult</i>).</li>
<li>Let <i>extensibleTarget</i> be <a href="#sec-isextensible-o">IsExtensible</a>(<i>target</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>extensibleTarget</i>).</li>
<li>Let <i>targetKeys</i> be <i>target</i>.[[OwnPropertyKeys]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>targetKeys</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>targetKeys</i> is a <a
href="#sec-list-and-record-specification-type">List</a> containing only String and Symbol values.</li>
<li>Let <i>targetConfigurableKeys</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>targetNonconfigurableKeys</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Repeat, for each element <i>key</i> of <i>targetKeys</i>,
<ol class="block">
<li>Let <i>desc</i> be <i>target</i>.[[GetOwnProperty]](<i>key</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>desc</i>).</li>
<li>If <i>desc</i> is not <b>undefined</b> and <i>desc.</i>[[Configurable]] is <b>false</b>, then
<ol class="block">
<li>Append <i>key</i> as an element of <i>targetNonconfigurableKeys</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Append <i>key</i> as an element of <i>targetConfigurableKeys</i>.</li>
</ol>
</li>
</ol>
</li>
<li>If <i>extensibleTarget</i> is <b>true</b> and <i>targetNonconfigurableKeys</i> is empty, then
<ol class="block">
<li>Return <i>trapResult</i>.</li>
</ol>
</li>
<li>Let <i>uncheckedResultKeys</i> be a new <a href="#sec-list-and-record-specification-type">List</a> which is a copy of
<i>trapResult</i>.</li>
<li>Repeat, for each <i>key</i> that is an element of <i>targetNonconfigurableKeys</i>,
<ol class="block">
<li>If <i>key</i> is not an element of <i>uncheckedResultKeys</i>, throw a <b>TypeError</b> exception.</li>
<li>Remove <i>key</i> from <i>uncheckedResultKeys</i></li>
</ol>
</li>
<li>If <i>extensibleTarget</i> is <b>true</b>, return <i>trapResult</i>.</li>
<li>Repeat, for each <i>key</i> that is an element of <i>targetConfigurableKeys</i>,
<ol class="block">
<li>If <i>key</i> is not an element of <i>uncheckedResultKeys</i>, throw a <b>TypeError</b> exception.</li>
<li>Remove <i>key</i> from <i>uncheckedResultKeys</i></li>
</ol>
</li>
<li>If <i>uncheckedResultKeys</i> is not empty, throw a <b>TypeError</b> exception.</li>
<li>Return <i>trapResult</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> [[OwnPropertyKeys]] for proxy objects enforces the following invariants:</p>
<ul>
<li>
<p>The result of [[OwnPropertyKeys]] is a <a href="#sec-list-and-record-specification-type">List</a>.</p>
</li>
<li>
<p>The Type of each result <a href="#sec-list-and-record-specification-type">List</a> element is either String or
Symbol.</p>
</li>
<li>
<p>The result <a href="#sec-list-and-record-specification-type">List</a> must contain the keys of all non-configurable
own properties of the target object.</p>
</li>
<li>
<p>If the target object is not extensible, then the result <a href="#sec-list-and-record-specification-type">List</a>
must contain all the keys of the own properties of the target object and no other values.</p>
</li>
</ul>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist">
<h1><span class="secnum" id="sec-9.5.13"><a
href="#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist"
title="link to this section">9.5.13</a></span> [[Call]] (thisArgument, argumentsList)</h1>
<p>The [[Call]] internal method of a Proxy exotic object <var>O</var> is called with parameters <var>thisArgument</var> and
<var>argumentsList</var>, a <a href="#sec-list-and-record-specification-type">List</a> of <a
href="#sec-ecmascript-language-types">ECMAScript language values</a>. The following steps are taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"apply"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li>Return <a href="#sec-call">Call</a>(<i>target</i>, <i>thisArgument</i>, <i>argumentsList</i>).</li>
</ol>
</li>
<li>Let <i>argArray</i> be <a href="#sec-createarrayfromlist">CreateArrayFromList</a>(<i>argumentsList</i>).</li>
<li>Return <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>, «<i>target</i>, <i>thisArgument</i>,
<i>argArray</i>»).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> A Proxy exotic object only has a [[Call]] internal method if the initial value of its
[[ProxyTarget]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is an object that has a
[[Call]] internal method.</p>
</div>
</section>
<section id="sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget">
<h1><span class="secnum" id="sec-9.5.14"><a
href="#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget"
title="link to this section">9.5.14</a></span> [[Construct]] ( argumentsList, newTarget)</h1>
<p>The [[Construct]] internal method of a Proxy exotic object <var>O</var> is called with parameters
<var>argumentsList</var> which is a possibly empty <a href="#sec-list-and-record-specification-type">List</a> of <a
href="#sec-ecmascript-language-types">ECMAScript language values</a> and <var>newTarget</var>. The following steps are
taken:</p>
<ol class="proc">
<li>Let <i>handler</i> be the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>If <i>handler</i> is <b>null</b>, throw a <b>TypeError</b> exception.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is Object.</li>
<li>Let <i>target</i> be the value of the [[ProxyTarget]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>O</i>.</li>
<li>Let <i>trap</i> be <a href="#sec-getmethod">GetMethod</a>(<i>handler</i>, <code>"construct"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>trap</i>).</li>
<li>If <i>trap</i> is <b>undefined</b>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>target</i> has a [[Construct]] internal method.</li>
<li>Return <a href="#sec-construct">Construct</a>(<i>target</i>, <i>argumentsList</i>, <i>newTarget</i>).</li>
</ol>
</li>
<li>Let <i>argArray</i> be <a href="#sec-createarrayfromlist">CreateArrayFromList</a>(<i>argumentsList</i>).</li>
<li>Let <i>newObj</i> be <a href="#sec-call">Call</a>(<i>trap</i>, <i>handler</i>, «<i>target</i>, <i>argArray</i>,
<i>newTarget</i> »).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>newObj</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>newObj</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>newObj</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> A Proxy exotic object only has a [[Construct]] internal method if the initial value of
its [[ProxyTarget]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> is an object that has a
[[Construct]] internal method.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> [[Construct]] for proxy objects enforces the following invariants:</p>
<ul>
<li>The result of [[Construct]] must be an Object.</li>
</ul>
</div>
</section>
<section id="sec-proxycreate">
<h1><span class="secnum" id="sec-9.5.15"><a href="#sec-proxycreate" title="link to this section">9.5.15</a></span>
ProxyCreate(target, handler)</h1>
<p>The abstract operation ProxyCreate with arguments <var>target</var> and <var>handler</var> is used to specify the
creation of new Proxy exotic objects. It performs the following steps:</p>
<ol class="proc">
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>target</i>) is not Object, throw a <b>TypeError</b>
Exception.</li>
<li>If <i>target</i> is a Proxy exotic object and the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>target</i> is <b>null</b>, throw a
<b>TypeError</b> exception.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>handler</i>) is not Object, throw a <b>TypeError</b>
Exception.</li>
<li>If <i>handler</i> is a Proxy exotic object and the value of the [[ProxyHandler]] <a
href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>handler</i> is <b>null</b>, throw a
<b>TypeError</b> exception.</li>
<li>Let <i>P</i> be a newly created object.</li>
<li>Set <i>P</i>’s essential internal methods (except for [[Call]] and [[Construct]]) to the definitions specified
in <a href="#sec-proxy-object-internal-methods-and-internal-slots">9.5</a>.</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>target</i>) is <b>true</b>, then
<ol class="block">
<li>Set the [[Call]] internal method of <i>P</i> as specified in <a
href="#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist">9.5.13</a>.</li>
<li>If <i>target</i> has a [[Construct]] internal method, then
<ol class="block">
<li>Set the [[Construct]] internal method of <i>P</i> as specified in <a
href="#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget">9.5.14</a>.</li>
</ol>
</li>
</ol>
</li>
<li>Set the [[ProxyTarget]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>P</i> to
<i>target</i>.</li>
<li>Set the [[ProxyHandler]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> of <i>P</i> to
<i>handler</i>.</li>
<li>Return <i>P</i>.</li>
</ol>
</section>
</section>
</section>
<section id="sec-ecmascript-language-source-code">
<div class="front">
<h1><span class="secnum" id="sec-10"><a href="#sec-ecmascript-language-source-code" title="link to this section">10</a></span>
ECMAScript Language: Source Code</h1>
</div>
<section id="sec-source-text">
<div class="front">
<h1><span class="secnum" id="sec-10.1"><a href="#sec-source-text" title="link to this section">10.1</a></span> Source
Text</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">SourceCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="gprose">any Unicode code point</span></div>
</div>
<p>ECMAScript code is expressed using Unicode, version 5.1 or later. ECMAScript source text is a sequence of code points.
All Unicode code point values from U+0000 to U+10FFFF, including surrogate code points, may occur in source text where
permitted by the ECMAScript grammars. The actual encodings used to store and interchange ECMAScript source text is not
relevant to this specification. Regardless of the external source text encoding, a conforming ECMAScript implementation
processes the source text as if it was an equivalent sequence of <span class="nt">SourceCharacter</span> values. Each <span
class="nt">SourceCharacter</span> being a Unicode code point. Conforming ECMAScript implementations are not required to
perform any normalization of source text, or behave as though they were performing normalization of source text.</p>
<p>The components of a combining character sequence are treated as individual Unicode code points even though a user might
think of the whole sequence as a single character.</p>
<div class="note">
<p><span class="nh">NOTE</span> In string literals, regular expression literals, template literals and identifiers, any
Unicode code point may also be expressed using Unicode escape sequences that explicitly express a code point’s
numeric value. Within a comment, such an escape sequence is effectively ignored as part of the comment.</p>
<p>ECMAScript differs from the Java programming language in the behaviour of Unicode escape sequences. In a Java program,
if the Unicode escape sequence <code>\u000A</code>, for example, occurs within a single-line comment, it is interpreted as
a line terminator (Unicode code point U+000A is line feed (lf)) and therefore the next code point is not part of the
comment. Similarly, if the Unicode escape sequence <code>\u000A</code> occurs within a string literal in a Java program,
it is likewise interpreted as a line terminator, which is not allowed within a string literal—one must write
<code>\n</code> instead of <code>\u000A</code> to cause a line feed (lf) to be part of the string value of a string
literal. In an ECMAScript program, a Unicode escape sequence occurring within a comment is never interpreted and therefore
cannot contribute to termination of the comment. Similarly, a Unicode escape sequence occurring within a string literal in
an ECMAScript program always contributes to the literal and is never interpreted as a line terminator or as a code point
that might terminate the string literal.</p>
</div>
</div>
<section id="sec-utf16encoding">
<h1><span class="secnum" id="sec-10.1.1"><a href="#sec-utf16encoding" title="link to this section">10.1.1</a></span> Static
Semantics: <i>UTF16Encoding ( cp )</i></h1>
<p>The UTF16Encoding of a numeric code point value, <var>cp</var>, is determined as follows:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: 0 ≤ <i>cp</i> ≤ 0x10FFFF.</li>
<li>If <i>cp</i> ≤ 65535, return <i>cp</i>.</li>
<li>Let <i>cu1</i> be <a href="#sec-algorithm-conventions">floor</a>((<i>cp</i> – 65536) / 1024) + 0xD800.</li>
<li>Let <i>cu2</i> be ((<i>cp</i> – 65536) <a href="#sec-algorithm-conventions">modulo</a> 1024) + 0xDC00.</li>
<li>Return the code unit sequence consisting of <i>cu1</i> followed by <i>cu2</i>.</li>
</ol>
</section>
<section id="sec-utf16decode">
<h1><span class="secnum" id="sec-10.1.2"><a href="#sec-utf16decode" title="link to this section">10.1.2</a></span> Static
Semantics: UTF16Decode( lead, trail )</h1>
<p>Two code units, <var>lead</var> and <var>trail</var>, that form a UTF-16 surrogate pair are converted to a code point by
performing the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: 0xD800 ≤ <i>lead</i> ≤ 0xDBFF and 0xDC00 ≤ <i>trail</i> ≤
0xDFFF.</li>
<li>Let <i>cp</i> be (<i>lead</i> – 0xD800) × 1024 + (<i>trail</i> – 0xDC00) + 0x10000.</li>
<li>Return the code point <i>cp</i>.</li>
</ol>
</section>
</section>
<section id="sec-types-of-source-code">
<div class="front">
<h1><span class="secnum" id="sec-10.2"><a href="#sec-types-of-source-code" title="link to this section">10.2</a></span>
Types of Source Code</h1>
<p>There are four types of ECMAScript code:</p>
<ul>
<li>
<p><i>Global code</i> is source text that is treated as an ECMAScript <i>Script</i>. The global code of a particular
<i>Script</i> does not include any source text that is parsed as part of a <i>FunctionDeclaration</i>,
<i>FunctionExpression</i>, <i>GeneratorDeclaration</i>, <i>GeneratorExpression</i>, <i>MethodDefinition</i>,
<i>ArrowFunction, ClassDeclaration</i>, or <i>ClassExpression</i>.</p>
</li>
<li>
<p><i>Eval code</i> is the source text supplied to the built-in <code>eval</code> function. More precisely, if the
parameter to the built-in <code>eval</code> function is a String, it is treated as an ECMAScript <i>Script</i>. The eval
code for a particular invocation of <code>eval</code> is the global code portion of that <i>Script</i>.</p>
</li>
<li>
<p><i>Function code</i> is source text that is parsed to supply the value of the [[ECMAScriptCode]] and
[[FormalParameters]] internal slots (<a href="#sec-ecmascript-function-objects">see 9.2</a>) of an <a
href="#sec-ecmascript-function-objects">ECMAScript function object</a>. The function code of a particular ECMAScript
function does not include any source text that is parsed as the function code of a nested <i>FunctionDeclaration</i>,
<i>FunctionExpression</i>, <i>GeneratorDeclaration</i>, <i>GeneratorExpression</i>, <i>MethodDefinition</i>,
<i>ArrowFunction, ClassDeclaration</i>, or <i>ClassExpression</i>.</p>
</li>
<li>
<p><i>Module code</i> is source text that is code that is provided as a <i>ModuleBody</i>. It is the code that is
directly evaluated when a module is initialized. The module code of a particular module does not include any source text
that is parsed as part of a nested <i>FunctionDeclaration</i>, <i>FunctionExpression</i>, <i>GeneratorDeclaration</i>,
<i>GeneratorExpression</i>, <i>MethodDefinition</i>, <i>ArrowFunction, ClassDeclaration</i>, or
<i>ClassExpression</i>.</p>
</li>
</ul>
<div class="note">
<p><span class="nh">NOTE</span> Function code is generally provided as the bodies of Function Definitions (<a
href="#sec-function-definitions">14.1</a>), Arrow Function Definitions (<a
href="#sec-arrow-function-definitions">14.2</a>), Method Definitions (<a href="#sec-method-definitions">14.3</a>) and
Generator Definitions (<a href="#sec-generator-function-definitions">14.4</a>). Function code is also derived from the
arguments to the <code>Function</code> constructor (<a href="#sec-function-p1-p2-pn-body">19.2.1.1</a>) and the
GeneratorFunction constructor (<a href="#sec-generatorfunction">25.2.1.1</a>).</p>
</div>
</div>
<section id="sec-strict-mode-code">
<h1><span class="secnum" id="sec-10.2.1"><a href="#sec-strict-mode-code" title="link to this section">10.2.1</a></span>
Strict Mode Code</h1>
<p>An ECMAScript <span class="nt">Script</span> syntactic unit may be processed using either unrestricted or strict mode
syntax and semantics. Code is interpreted as <i>strict mode code</i> in the following situations:</p>
<ul>
<li>
<p>Global code is strict mode code if it begins with a <a
href="#sec-directive-prologues-and-the-use-strict-directive">Directive Prologue</a> that contains a <a
href="#sec-directive-prologues-and-the-use-strict-directive">Use Strict Directive</a> (see <a
href="#sec-directive-prologues-and-the-use-strict-directive">14.1.1</a>).</p>
</li>
<li>
<p>Module code is always strict mode code.</p>
</li>
<li>
<p>All parts of a <span class="nt">ClassDeclaration</span> or a <span class="nt">ClassExpression</span> are strict mode
code.</p>
</li>
<li>
<p>Eval code is strict mode code if it begins with a <a
href="#sec-directive-prologues-and-the-use-strict-directive">Directive Prologue</a> that contains a <a
href="#sec-directive-prologues-and-the-use-strict-directive">Use Strict Directive</a> or if the call to eval is a direct
eval (<a href="#sec-function-calls-runtime-semantics-evaluation">see 12.3.4.1</a>) that is contained in strict mode
code.</p>
</li>
<li>
<p>Function code is strict mode code if the associated <span class="nt">FunctionDeclaration</span>, <span
class="nt">FunctionExpression</span>, <span class="nt">GeneratorDeclaration</span>, <span
class="nt">GeneratorExpression</span>, <span class="nt">MethodDefinition</span>, or <span
class="nt">ArrowFunction</span> is contained in strict mode code or if the code that produces the value of the
function’s [[ECMAScriptCode]] <a href="#sec-object-internal-methods-and-internal-slots">internal slot</a> begins
with a <a href="#sec-directive-prologues-and-the-use-strict-directive">Directive Prologue</a> that contains a <a
href="#sec-directive-prologues-and-the-use-strict-directive">Use Strict Directive</a>.</p>
</li>
<li>
<p>Function code that is supplied as the arguments to the built-in <code>Function</code> and <code>Generator</code>
constructors is strict mode code if the last argument is a String that when processed has a <span
class="nt">FunctionBody</span> begins with a <a href="#sec-directive-prologues-and-the-use-strict-directive">Directive
Prologue</a> that contains a <a href="#sec-directive-prologues-and-the-use-strict-directive">Use Strict
Directive</a>.</p>
</li>
</ul>
<p>ECMAScript code that is not strict mode code is called <i>non-strict code</i>.</p>
</section>
<section id="sec-non-ecmascript-functions">
<h1><span class="secnum" id="sec-10.2.2"><a href="#sec-non-ecmascript-functions"
title="link to this section">10.2.2</a></span> Non-ECMAScript Functions</h1>
<p>An ECMAScript implementation may support the evaluation of exotic function objects whose evaluative behaviour is
expressed in some implementation defined form of executable code other than via ECMAScript code. Whether a function object
is an ECMAScript code function or a non-ECMAScript function is not semantically observable from the perspective of an
ECMAScript code function that calls or is called by such a non-ECMAScript function.</p>
</section>
</section>
</section>
<section id="sec-ecmascript-language-lexical-grammar">
<div class="front">
<h1><span class="secnum" id="sec-11"><a href="#sec-ecmascript-language-lexical-grammar"
title="link to this section">11</a></span> ECMAScript Language: Lexical Grammar</h1>
<p>The source text of an ECMAScript <span class="nt">Script</span> or <span class="nt">Module</span> is first converted into a
sequence of input elements, which are tokens, line terminators, comments, or white space. The source text is scanned from left
to right, repeatedly taking the longest possible sequence of code points as the next input element.</p>
<p>There are several situations where the identification of lexical input elements is sensitive to the syntactic grammar
context that is consuming the input elements. This requires multiple goal symbols for the lexical grammar. The <span
class="nt">InputElementRegExpOrTemplateTail</span> goal is used in syntactic grammar contexts where a
<var>RegularExpressionLiteral,</var> a <var>TemplateMiddle,</var> or a <span class="nt">TemplateTail</span> is permitted. The
<span class="nt">InputElementRegExp</span> goal symbol is used in all syntactic grammar contexts where a <span
class="nt">RegularExpressionLiteral</span> is permitted but neither a <var>TemplateMiddle,</var> nor a <span
class="nt">TemplateTail</span> is permitted. The <span class="nt">InputElementTemplateTail</span> goal is used in all
syntactic grammar contexts where a <span class="nt">TemplateMiddle</span> or a <span class="nt">TemplateTail</span> is
permitted but a <span class="nt">RegularExpressionLiteral</span> is not permitted. In all other contexts, <span
class="nt">InputElementDiv</span> is used as the lexical goal symbol.</p>
<div class="note">
<p><span class="nh">NOTE</span> The use of multiple lexical goals ensures that there are no lexical ambiguities that would
affect <a href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a>. For example, there are no syntactic
grammar contexts where both a leading division or division-assignment, and a leading <i>RegularExpressionLiteral</i> are
permitted. This is not affected by semicolon insertion (<a href="#sec-automatic-semicolon-insertion">see 11.9</a>); in
examples such as the following:</p>
<pre>a = b<br>/hi/g.exec(c).map(d);</pre>
<p>where the first non-whitespace, non-comment code point after a <i>LineTerminator</i> is U+002F (SOLIDUS) and the
syntactic context allows division or division-assignment, no semicolon is inserted at the <i>LineTerminator</i>. That is,
the above example is interpreted in the same way as:</p>
<pre>a = b / hi / g.exec(c).map(d);</pre>
</div>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">InputElementDiv</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">WhiteSpace</span></div>
<div class="rhs"><span class="nt">LineTerminator</span></div>
<div class="rhs"><span class="nt">Comment</span></div>
<div class="rhs"><span class="nt">CommonToken</span></div>
<div class="rhs"><span class="nt">DivPunctuator</span></div>
<div class="rhs"><span class="nt">RightBracePunctuator</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">InputElementRegExp</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">WhiteSpace</span></div>
<div class="rhs"><span class="nt">LineTerminator</span></div>
<div class="rhs"><span class="nt">Comment</span></div>
<div class="rhs"><span class="nt">CommonToken</span></div>
<div class="rhs"><span class="nt">RightBracePunctuator</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">InputElementRegExpOrTemplateTail</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">WhiteSpace</span></div>
<div class="rhs"><span class="nt">LineTerminator</span></div>
<div class="rhs"><span class="nt">Comment</span></div>
<div class="rhs"><span class="nt">CommonToken</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
<div class="rhs"><span class="nt">TemplateSubstitutionTail</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">InputElementTemplateTail</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">WhiteSpace</span></div>
<div class="rhs"><span class="nt">LineTerminator</span></div>
<div class="rhs"><span class="nt">Comment</span></div>
<div class="rhs"><span class="nt">CommonToken</span></div>
<div class="rhs"><span class="nt">DivPunctuator</span></div>
<div class="rhs"><span class="nt">TemplateSubstitutionTail</span></div>
</div>
</div>
<section id="sec-unicode-format-control-characters">
<h1><span class="secnum" id="sec-11.1"><a href="#sec-unicode-format-control-characters"
title="link to this section">11.1</a></span> Unicode Format-Control Characters</h1>
<p>The Unicode format-control characters (i.e., the characters in category “Cf” in the Unicode Character Database
such as left-to-right mark or right-to-left mark) are control codes used to control the formatting of a range of text in the
absence of higher-level protocols for this (such as mark-up languages).</p>
<p>It is useful to allow format-control characters in source text to facilitate editing and display. All format control
characters may be used within comments, and within string literals, template literals, and regular expression literals.</p>
<p>U+200C <span style="font-family: Times New Roman">(</span>Zero width non-joiner<span style="font-family: Times New
Roman">)</span> and U+200D <span style="font-family: Times New Roman">(</span>Zero width joiner<span style="font-family: Times
New Roman">)</span> are format-control characters that are used to make necessary distinctions when forming words or phrases
in certain languages. In ECMAScript source text these code points may also be used in an <span
class="nt">IdentifierName</span> (<a href="#sec-identifier-names">see 11.6.1</a>) after the first character.</p>
<p>U+FEFF <span style="font-family: Times New Roman">(</span>Zero Width no-break space<span style="font-family: Times New
Roman">)</span> is a format-control character used primarily at the start of a text to mark it as Unicode and to allow
detection of the text's encoding and byte order. <span style="font-family: Times New Roman"><ZWNBSP></span> characters
intended for this purpose can sometimes also appear after the start of a text, for example as a result of concatenating files.
In ECMAScript source text <ZWNBSP> code points are treated as white space characters (<a href="#sec-white-space">see
11.2</a>).</p>
<p>The special treatment of certain format-control characters outside of comments, string literals, and regular expression
literals is summarized in <a href="#table-31">Table 31</a>.</p>
<figure>
<figcaption><span id="table-31">Table 31</span> — Format-Control Code Point Usage</figcaption>
<table class="real-table">
<tr>
<th>Code Point</th>
<th>Name</th>
<th>Abbreviation</th>
<th>Usage</th>
</tr>
<tr>
<td><code>U+200C</code></td>
<td>Zero width non-joiner</td>
<td><ZWNJ></td>
<td><i>IdentifierPart</i></td>
</tr>
<tr>
<td><code>U+200D</code></td>
<td>Zero width joiner</td>
<td><ZWJ></td>
<td><i>IdentifierPart</i></td>
</tr>
<tr>
<td><code>U+FEFF</code></td>
<td>ZERO WIDTH NO-BREAK SPACE</td>
<td><ZWNBSP></td>
<td><i>WhiteSpace</i></td>
</tr>
</table>
</figure>
</section>
<section id="sec-white-space">
<h1><span class="secnum" id="sec-11.2"><a href="#sec-white-space" title="link to this section">11.2</a></span> White
Space</h1>
<p>White space code points are used to improve source text readability and to separate tokens (indivisible lexical units) from
each other, but are otherwise insignificant. White space code points may occur between any two tokens and at the start or end
of input. White space code points may occur within a <span class="nt">StringLiteral</span>, a <span
class="nt">RegularExpressionLiteral</span>, a <span class="nt">Template</span>, or a <span
class="nt">TemplateSubstitutionTail</span> where they are considered significant code points forming part of a literal value.
They may also occur within a <span class="nt">Comment</span>, but cannot appear within any other kind of token.</p>
<p>The ECMAScript white space code points are listed in <a href="#table-32">Table 32</a>.</p>
<figure>
<figcaption><span id="table-32">Table 32</span> — White Space Code Points</figcaption>
<table class="real-table">
<tr>
<th>Code Point</th>
<th>Name</th>
<th>Abbreviation</th>
</tr>
<tr>
<td><code>U+0009</code></td>
<td>Character Tabulation</td>
<td><TAB></td>
</tr>
<tr>
<td><code>U+000B</code></td>
<td>LINE TABULATION</td>
<td><VT></td>
</tr>
<tr>
<td><code>U+000C</code></td>
<td>Form Feed (ff)</td>
<td><FF></td>
</tr>
<tr>
<td><code>U+0020</code></td>
<td>Space</td>
<td><SP></td>
</tr>
<tr>
<td><code>U+00A0</code></td>
<td>No-break space</td>
<td><NBSP></td>
</tr>
<tr>
<td><code>U+FEFF</code></td>
<td>ZERO wIDTH nO-bREAK SPACE</td>
<td><ZWNBSP></td>
</tr>
<tr>
<td>Other category “Zs”</td>
<td>Any other Unicode “Separator, space” code point</td>
<td><USP></td>
</tr>
</table>
</figure>
<p>ECMAScript implementations must recognize as <span class="nt">WhiteSpace</span> code points listed in the “Separator,
space” (Zs) category by Unicode 5.1. ECMAScript implementations may also recognize as <span class="nt">WhiteSpace</span>
additional category Zs code points from subsequent editions of the Unicode Standard.</p>
<div class="note">
<p><span class="nh">NOTE</span> Other than for the code points listed in <a href="#table-32">Table 32</a>, ECMAScript
<i>WhiteSpace</i> intentionally excludes all code points that have the Unicode “White_Space” property but which
are not classified in category “Zs”.</p>
</div>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">WhiteSpace</span> <span class="geq">::</span></div>
<div class="rhs"><TAB></div>
<div class="rhs"><VT></div>
<div class="rhs"><FF></div>
<div class="rhs"><SP></div>
<div class="rhs"><NBSP></div>
<div class="rhs"><zwnbsp></div>
<div class="rhs"><USP></div>
</div>
</section>
<section id="sec-line-terminators">
<h1><span class="secnum" id="sec-11.3"><a href="#sec-line-terminators" title="link to this section">11.3</a></span> Line
Terminators</h1>
<p>Like white space code points, line terminator code points are used to improve source text readability and to separate
tokens (indivisible lexical units) from each other. However, unlike white space code points, line terminators have some
influence over the behaviour of the syntactic grammar. In general, line terminators may occur between any two tokens, but
there are a few places where they are forbidden by the syntactic grammar. Line terminators also affect the process of <a
href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a> (<a
href="#sec-automatic-semicolon-insertion">11.9</a>). A line terminator cannot occur within any token except a <span
class="nt">StringLiteral</span>, <span class="nt">Template</span>, or <span class="nt">TemplateSubstitutionTail</span>. Line
terminators may only occur within a <span class="nt">StringLiteral</span> token as part of a <span
class="nt">LineContinuation</span>.</p>
<p>A line terminator can occur within a <span class="nt">MultiLineComment</span> (<a href="#sec-comments">11.4</a>) but cannot
occur within a <span class="nt">SingleLineComment</span>.</p>
<p>Line terminators are included in the set of white space code points that are matched by the <code>\s</code> class in
regular expressions.</p>
<p>The ECMAScript line terminator code points are listed in <a href="#table-33">Table 33</a>.</p>
<figure>
<figcaption><span id="table-33">Table 33</span> — Line Terminator Code Points</figcaption>
<table class="real-table">
<tr>
<th>Code Point</th>
<th>Unicode Name</th>
<th>Abbreviation</th>
</tr>
<tr>
<td><code>U+000A</code></td>
<td>Line Feed (LF)</td>
<td><LF></td>
</tr>
<tr>
<td><code>U+000D</code></td>
<td>Carriage Return (CR)</td>
<td><CR></td>
</tr>
<tr>
<td><code>U+2028</code></td>
<td>Line separator</td>
<td><LS></td>
</tr>
<tr>
<td><code>U+2029</code></td>
<td>Paragraph separator</td>
<td><PS></td>
</tr>
</table>
</figure>
<p>Only the Unicode code points in <a href="#table-33">Table 33</a> are treated as line terminators. Other new line or line
breaking Unicode code points are not treated as line terminators but are treated as white space if they meet the requirements
listed in <a href="#table-32">Table 32</a>. The sequence <CR><LF> is commonly used as a line terminator. It should
be considered a single <span class="nt">SourceCharacter</span> for the purpose of reporting line numbers.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">LineTerminator</span> <span class="geq">::</span></div>
<div class="rhs"><LF></div>
<div class="rhs"><CR></div>
<div class="rhs"><LS></div>
<div class="rhs"><PS></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></div>
<div class="rhs"><LF></div>
<div class="rhs"><CR> <span class="grhsannot">[lookahead ≠ <LF> ]</span></div>
<div class="rhs"><LS></div>
<div class="rhs"><PS></div>
<div class="rhs"><CR> <LF></div>
</div>
</section>
<section id="sec-comments">
<h1><span class="secnum" id="sec-11.4"><a href="#sec-comments" title="link to this section">11.4</a></span> Comments</h1>
<p>Comments can be either single or multi-line. Multi-line comments cannot nest.</p>
<p>Because a single-line comment can contain any Unicode code point except a <span class="nt">LineTerminator</span> code
point, and because of the general rule that a token is always as long as possible, a single-line comment always consists of
all code points from the <code>//</code> marker to the end of the line. However, the <span class="nt">LineTerminator</span> at
the end of the line is not considered to be part of the single-line comment; it is recognized separately by the lexical
grammar and becomes part of the stream of input elements for the syntactic grammar. This point is very important, because it
implies that the presence or absence of single-line comments does not affect the process of <a
href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a> (<a href="#sec-automatic-semicolon-insertion">see
11.9</a>).</p>
<p>Comments behave like white space and are discarded except that, if a <span class="nt">MultiLineComment</span> contains a
line terminator code point, then the entire comment is considered to be a <span class="nt">LineTerminator</span> for purposes
of parsing by the syntactic grammar.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">Comment</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">MultiLineComment</span></div>
<div class="rhs"><span class="nt">SingleLineComment</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MultiLineComment</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">/*</code> <span class="nt">MultiLineCommentChars</span><sub class="g-opt">opt</sub> <code class="t">*/</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MultiLineCommentChars</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">MultiLineNotAsteriskChar</span> <span class="nt">MultiLineCommentChars</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><code class="t">*</code> <span class="nt">PostAsteriskCommentChars</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">PostAsteriskCommentChars</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">MultiLineNotForwardSlashOrAsteriskChar</span> <span class="nt">MultiLineCommentChars</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><code class="t">*</code> <span class="nt">PostAsteriskCommentChars</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MultiLineNotAsteriskChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not</span> <code class="t">*</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MultiLineNotForwardSlashOrAsteriskChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">/</code> <span class="grhsmod">or</span> <code class="t">*</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleLineComment</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">//</code> <span class="nt">SingleLineCommentChars</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleLineCommentChars</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SingleLineCommentChar</span> <span class="nt">SingleLineCommentChars</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleLineCommentChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not</span> <span class="nt">LineTerminator</span></div>
</div>
</section>
<section id="sec-tokens">
<h1><span class="secnum" id="sec-11.5"><a href="#sec-tokens" title="link to this section">11.5</a></span> Tokens</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">CommonToken</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">Punctuator</span></div>
<div class="rhs"><span class="nt">NumericLiteral</span></div>
<div class="rhs"><span class="nt">StringLiteral</span></div>
<div class="rhs"><span class="nt">Template</span></div>
</div>
<div class="note">
<p><span class="nh">NOTE</span> The <i>DivPunctuator</i>, <i>RegularExpressionLiteral</i>, <i>RightBracePunctuator,</i> and
<i>TemplateSubstitutionTail</i> productions derive additional tokens that are not included in the <i>CommonToken</i>
production.</p>
</div>
</section>
<section id="sec-names-and-keywords">
<div class="front">
<h1><span class="secnum" id="sec-11.6"><a href="#sec-names-and-keywords" title="link to this section">11.6</a></span> Names
and Keywords</h1>
<p><span class="nt">IdentifierName</span> and <span class="nt">ReservedWord</span> are tokens that are interpreted according
to the Default Identifier Syntax given in Unicode Standard Annex #31, Identifier and Pattern Syntax, with some small
modifications. <span class="nt">ReservedWord</span> is an enumerated subset of <span style="font-family: Times New
Roman"><i>IdentifierName</i>.</span> The syntactic grammar defines <span class="nt">Identifier</span> as an <span
class="nt">IdentifierName</span> that is not a <span class="nt">ReservedWord</span> (<a href="#sec-reserved-words">see
11.6.2</a>). The Unicode identifier grammar is based on character properties specified by the Unicode Standard. The Unicode
code points in the specified categories in version 5.1.0 of the Unicode standard must be treated as in those categories by
all conforming ECMAScript implementations. ECMAScript implementations may recognize identifier code points defined in later
editions of the Unicode Standard.</p>
<div class="note">
<p><span class="nh">NOTE</span> This standard specifies specific code point additions: <span style="font-family:
sans-serif">U+0024</span> (dollar sign) and <span style="font-family: sans-serif">U+005F</span> (<span style="font-family:
sans-serif">LOW LINE</span>) are permitted anywhere in an <i>IdentifierName</i><span style="font-family: sans-serif">, and
the code points</span> <span style="font-family: sans-serif">U+200C (zero-width non-joiner) and U+200D (zero-width joiner)
are permitted anywhere after the first code point</span> <span style="font-family: sans-serif">of an</span>
<i>IdentifierName</i>.</p>
</div>
<p>Unicode escape sequences are permitted in an <span class="nt">IdentifierName</span>, where they contribute a single
Unicode code point to the <span class="nt">IdentifierName</span>. The code point is expressed by the <span
class="nt">HexDigits</span> of the <span class="nt">UnicodeEscapeSequence</span> (<a
href="#sec-literals-string-literals">see 11.8.4</a>). The <code>\</code> preceding the <span
class="nt">UnicodeEscapeSequence</span> and the <code>u</code> and <code>{ }</code> code units, if they appear, do not
contribute code points to the <span class="nt">IdentifierName</span>. A <span class="nt">UnicodeEscapeSequence</span> cannot
be used to put a code point into an <span class="nt">IdentifierName</span> that would otherwise be illegal. In other words,
if a <code>\</code> <span class="nt">UnicodeEscapeSequence</span> sequence were replaced by the <span
class="nt">SourceCharacter</span> it contributes, the result must still be a valid <span class="nt">IdentifierName</span>
that has the exact same sequence of <span class="nt">SourceCharacter</span> elements as the original <span
class="nt">IdentifierName</span>. All interpretations of <span class="nt">IdentifierName</span> within this specification
are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any
particular code point.</p>
<p>Two <span class="nt">IdentifierName</span> that are canonically equivalent according to the Unicode standard are
<i>not</i> equal unless, after replacement of each <span class="nt">UnicodeEscapeSequence</span>, they are represented by
the exact same sequence of code points.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">IdentifierName</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">IdentifierStart</span></div>
<div class="rhs"><span class="nt">IdentifierName</span> <span class="nt">IdentifierPart</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">IdentifierStart</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">UnicodeIDStart</span></div>
<div class="rhs"><code class="t">$</code></div>
<div class="rhs"><code class="t">_</code></div>
<div class="rhs"><code class="t">\</code> <span class="nt">UnicodeEscapeSequence</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">IdentifierPart</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">UnicodeIDContinue</span></div>
<div class="rhs"><code class="t">$</code></div>
<div class="rhs"><code class="t">_</code></div>
<div class="rhs"><code class="t">\</code> <span class="nt">UnicodeEscapeSequence</span></div>
<div class="rhs"><ZWNJ></div>
<div class="rhs"><ZWJ></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">UnicodeIDStart</span> <span class="geq">::</span></div>
<div class="rhs"><span class="gprose">any Unicode code point with the Unicode property “ID_Start”</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">UnicodeIDContinue</span> <span class="geq">::</span></div>
<div class="rhs"><span class="gprose">any Unicode code point with the Unicode property “ID_Continue”</span></div>
</div>
<p>The definitions of the nonterminal <span class="nt">UnicodeEscapeSequence</span> is given in <a
href="#sec-literals-string-literals">11.8.4</a>.</p>
<div class="note">
<p><span class="nh">NOTE</span> The sets of code points with Unicode properties “ID_Start” and
“ID_Continue” include, respectively, the code points with Unicode properties “Other_ID_Start” and
“Other_ID_Continue”.</p>
</div>
</div>
<section id="sec-identifier-names">
<div class="front">
<h1><span class="secnum" id="sec-11.6.1"><a href="#sec-identifier-names" title="link to this section">11.6.1</a></span>
Identifier Names</h1>
</div>
<section id="sec-identifier-names-static-semantics-early-errors">
<h1><span class="secnum" id="sec-11.6.1.1"><a href="#sec-identifier-names-static-semantics-early-errors"
title="link to this section">11.6.1.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">IdentifierStart</span> <span class="geq">::</span> <code class="t">\</code> <span class="nt">UnicodeEscapeSequence</span></div>
<ul>
<li>
<p>It is a Syntax Error if <span style="font-family: Times New Roman">SV(<i>UnicodeEscapeSequence</i>)</span> is none
of <code>"$"</code>, or <code>"_"</code>, or the <a href="#sec-utf16encoding">UTF16Encoding</a> (<a
href="#sec-utf16encoding">10.1.1</a>) of a code point that would be matched by the <span
class="nt">UnicodeIDStart</span> lexical grammar production.</p>
</li>
</ul>
<div class="gp prod"><span class="nt">IdentifierPart</span> <span class="geq">::</span> <code class="t">\</code> <span class="nt">UnicodeEscapeSequence</span></div>
<ul>
<li>
<p>It is a Syntax Error if <span style="font-family: Times New Roman">SV(<i>UnicodeEscapeSequence</i>)</span> is none
of <code>"$"</code>, or <code>"_"</code>, or the <a href="#sec-utf16encoding">UTF16Encoding</a> (<a
href="#sec-utf16encoding">10.1.1</a>) of either <ZWNJ> or <ZWJ>, or the <a
href="#sec-utf16encoding">UTF16Encoding</a> of a Unicode code point that would be matched by the <span
class="nt">UnicodeIDContinue</span> lexical grammar production.</p>
</li>
</ul>
</section>
<section id="sec-identifier-names-static-semantics-stringvalue">
<h1><span class="secnum" id="sec-11.6.1.2"><a href="#sec-identifier-names-static-semantics-stringvalue"
title="link to this section">11.6.1.2</a></span> Static Semantics<span style="font-family: sans-serif">:</span>
<i>StringValue</i></h1>
<p>See also: <a href="#sec-string-literals-static-semantics-stringvalue">11.8.4.2</a>, <a
href="#sec-identifiers-static-semantics-stringvalue">12.1.4</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">IdentifierName</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">IdentifierStart</span></div>
<div class="rhs"><span class="nt">IdentifierName</span> <span class="nt">IdentifierPart</span></div>
</div>
<ol class="proc">
<li>Return the String value consisting of the sequence of code units corresponding to <i>IdentifierName</i>. In
determining the sequence any occurrences of <code>\</code> <i>UnicodeEscapeSequence</i> are first replaced with the
code point represented by the <i>UnicodeEscapeSequence</i> and then the code points of the entire
<i>IdentifierName</i> are converted to code units by <a href="#sec-utf16encoding">UTF16Encoding</a> (<a
href="#sec-utf16encoding">10.1.1</a>) each code point.</li>
</ol>
</section>
</section>
<section id="sec-reserved-words">
<div class="front">
<h1><span class="secnum" id="sec-11.6.2"><a href="#sec-reserved-words" title="link to this section">11.6.2</a></span>
Reserved Words</h1>
<p>A reserved word is an <span class="nt">IdentifierName</span> that cannot be used as an <span
class="nt">Identifier</span>.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">ReservedWord</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">Keyword</span></div>
<div class="rhs"><span class="nt">FutureReservedWord</span></div>
<div class="rhs"><span class="nt">NullLiteral</span></div>
<div class="rhs"><span class="nt">BooleanLiteral</span></div>
</div>
<div class="note">
<p><span class="nh">NOTE</span> The <i>ReservedWord</i> definitions are specified as literal sequences of specific
<i>SourceCharacter</i> elements. A code point in a <i>ReservedWord</i> cannot be expressed by a <code>\</code>
<i>UnicodeEscapeSequence</i>.</p>
</div>
</div>
<section id="sec-keywords">
<h1><span class="secnum" id="sec-11.6.2.1"><a href="#sec-keywords" title="link to this section">11.6.2.1</a></span>
Keywords</h1>
<p>The following tokens are ECMAScript keywords and may not be used as <span class="nt">Identifiers</span> in ECMAScript
programs.</p>
<h2>Syntax</h2>
<div class="gp prod"><span class="nt">Keyword</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>break</code></td>
<td><code>do</code></td>
<td><code>in</code></td>
<td><code>typeof</code></td>
</tr>
<tr>
<td><code>case</code></td>
<td><code>else</code></td>
<td><code>instanceof</code></td>
<td><code>var</code></td>
</tr>
<tr>
<td><code>catch</code></td>
<td><code>export</code></td>
<td><code>new</code></td>
<td><code>void</code></td>
</tr>
<tr>
<td><code>class</code></td>
<td><code>extends</code></td>
<td><code>return</code></td>
<td><code>while</code></td>
</tr>
<tr>
<td><code>const</code></td>
<td><code>finally</code></td>
<td><code>super</code></td>
<td><code>with</code></td>
</tr>
<tr>
<td><code>continue</code></td>
<td><code>for</code></td>
<td><code>switch</code></td>
<td><code>yield</code></td>
</tr>
<tr>
<td><code>debugger</code></td>
<td><code>function</code></td>
<td><code>this</code></td>
<td></td>
</tr>
<tr>
<td><code>default</code></td>
<td><code>if</code></td>
<td><code>throw</code></td>
<td></td>
</tr>
<tr>
<td><code>delete</code></td>
<td><code>import</code></td>
<td><code>try</code></td>
<td></td>
</tr>
</table>
</figure>
<div class="note">
<p><span class="nh">NOTE</span> In some contexts <code>yield</code> is given the semantics of an <i>Identifier</i>. See
<a href="#sec-identifiers-static-semantics-early-errors">12.1.1</a>. In <a href="#sec-strict-mode-code">strict mode
code</a>, <code>let</code> and <code>static</code> are treated as reserved keywords through static semantic restrictions
(see <a href="#sec-identifiers-static-semantics-early-errors">12.1.1</a>, <a
href="#sec-let-and-const-declarations-static-semantics-early-errors">13.2.1.1</a>, <a
href="#sec-for-in-and-for-of-statements-static-semantics-early-errors">13.6.4.1</a>, and <a
href="#sec-class-definitions-static-semantics-early-errors">14.5.1</a>) rather than the lexical grammar.</p>
</div>
</section>
<section id="sec-future-reserved-words">
<h1><span class="secnum" id="sec-11.6.2.2"><a href="#sec-future-reserved-words"
title="link to this section">11.6.2.2</a></span> Future Reserved Words</h1>
<p>The following tokens are reserved for used as keywords in future language extensions.</p>
<h2>Syntax</h2>
<div class="gp prod"><span class="nt">FutureReservedWord</span> <span class="geq">::</span></div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>enum<br>await</code></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</figure>
<p><code>await</code> is only treated as a <span class="nt">FutureReservedWord</span> when <span class="nt">Module</span>
is the goal symbol of the syntactic grammar.</p>
<div class="note">
<p><span class="nh">NOTE</span> Use of the following tokens within <a href="#sec-strict-mode-code">strict mode code</a>
(<a href="#sec-strict-mode-code">see 10.2.1</a>) is also reserved. That usage is restricted using static semantic
restrictions (<a href="#sec-identifiers-static-semantics-early-errors">see 12.1.1</a>) rather than the lexical
grammar:</p>
</div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>implements</code></td>
<td><code>package</code></td>
<td><code>protected</code></td>
<td></td>
</tr>
<tr>
<td><code>interface</code></td>
<td><code>private</code></td>
<td><code>public</code></td>
<td></td>
</tr>
</table>
</figure>
</section>
</section>
</section>
<section id="sec-punctuators">
<h1><span class="secnum" id="sec-11.7"><a href="#sec-punctuators" title="link to this section">11.7</a></span>
Punctuators</h1>
<h2>Syntax</h2>
<div class="gp prod"><span class="nt">Punctuator</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>{</code></td>
<td><code>(</code></td>
<td><code>)</code></td>
<td><code>[</code></td>
<td><code>]</code></td>
<td><code>.</code></td>
</tr>
<tr>
<td><code>...</code></td>
<td><code>;</code></td>
<td><code>,</code></td>
<td><code><</code></td>
<td><code>></code></td>
<td><code><=</code></td>
</tr>
<tr>
<td><code>>=</code></td>
<td><code>==</code></td>
<td><code>!=</code></td>
<td><code>===</code></td>
<td><code>!==</code></td>
<td></td>
</tr>
<tr>
<td><code>+</code></td>
<td><code>-</code></td>
<td><code>*</code></td>
<td><code>%</code></td>
<td><code>++</code></td>
<td><code>--</code></td>
</tr>
<tr>
<td><code><<</code></td>
<td><code>>></code></td>
<td><code>>>></code></td>
<td><code>&</code></td>
<td><code>|</code></td>
<td><code>^</code></td>
</tr>
<tr>
<td><code>!</code></td>
<td><code>~</code></td>
<td><code>&&</code></td>
<td><code>||</code></td>
<td><code>?</code></td>
<td><code>:</code></td>
</tr>
<tr>
<td><code>=</code></td>
<td><code>+=</code></td>
<td><code>-=</code></td>
<td><code>*=</code></td>
<td><code>%=</code></td>
<td><code><<=</code></td>
</tr>
<tr>
<td><code>>>=</code></td>
<td><code>>>>=</code></td>
<td><code>&=</code></td>
<td><code>|=</code></td>
<td><code>^=</code></td>
<td><code>=></code></td>
</tr>
</table>
</figure>
<div class="gp prod"><span class="nt">DivPunctuator</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>/</code></td>
<td><code>/=</code></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</figure>
<div class="gp prod"><span class="nt">RightBracePunctuator</span> <span class="geq">::</span></div>
<figure>
<table class="lightweight-table">
<tr>
<td><code>}</code></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</figure>
</section>
<section id="sec-ecmascript-language-lexical-grammar-literals">
<div class="front">
<h1><span class="secnum" id="sec-11.8"><a href="#sec-ecmascript-language-lexical-grammar-literals"
title="link to this section">11.8</a></span> Literals</h1>
</div>
<section id="sec-null-literals">
<h1><span class="secnum" id="sec-11.8.1"><a href="#sec-null-literals" title="link to this section">11.8.1</a></span> Null
Literals</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">NullLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">null</code></div>
</div>
</section>
<section id="sec-boolean-literals">
<h1><span class="secnum" id="sec-11.8.2"><a href="#sec-boolean-literals" title="link to this section">11.8.2</a></span>
Boolean Literals</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">BooleanLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">true</code></div>
<div class="rhs"><code class="t">false</code></div>
</div>
</section>
<section id="sec-literals-numeric-literals">
<div class="front">
<h1><span class="secnum" id="sec-11.8.3"><a href="#sec-literals-numeric-literals"
title="link to this section">11.8.3</a></span> Numeric Literals</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">NumericLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DecimalLiteral</span></div>
<div class="rhs"><span class="nt">BinaryIntegerLiteral</span></div>
<div class="rhs"><span class="nt">OctalIntegerLiteral</span></div>
<div class="rhs"><span class="nt">HexIntegerLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DecimalIntegerLiteral</span> <code class="t">.</code> <span class="nt">DecimalDigits</span><sub class="g-opt">opt</sub> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><code class="t">.</code> <span class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
<div class="rhs"><span class="nt">DecimalIntegerLiteral</span> <span class="nt">ExponentPart</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalIntegerLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">0</code></div>
<div class="rhs"><span class="nt">NonZeroDigit</span> <span class="nt">DecimalDigits</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DecimalDigit</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span> <span class="nt">DecimalDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NonZeroDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ExponentPart</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">ExponentIndicator</span> <span class="nt">SignedInteger</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ExponentIndicator</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">e</code> <code class="t">E</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SignedInteger</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DecimalDigits</span></div>
<div class="rhs"><code class="t">+</code> <span class="nt">DecimalDigits</span></div>
<div class="rhs"><code class="t">-</code> <span class="nt">DecimalDigits</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">BinaryIntegerLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">0b</code> <span class="nt">BinaryDigits</span></div>
<div class="rhs"><code class="t">0B</code> <span class="nt">BinaryDigits</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">BinaryDigits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">BinaryDigit</span></div>
<div class="rhs"><span class="nt">BinaryDigits</span> <span class="nt">BinaryDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">BinaryDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">OctalIntegerLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">0o</code> <span class="nt">OctalDigits</span></div>
<div class="rhs"><code class="t">0O</code> <span class="nt">OctalDigits</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">OctalDigits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">OctalDigit</span></div>
<div class="rhs"><span class="nt">OctalDigits</span> <span class="nt">OctalDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">OctalDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">HexIntegerLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">0x</code> <span class="nt">HexDigits</span></div>
<div class="rhs"><code class="t">0X</code> <span class="nt">HexDigits</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">HexDigits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">HexDigit</span></div>
<div class="rhs"><span class="nt">HexDigits</span> <span class="nt">HexDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">HexDigit</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">0</code> <code class="t">1</code> <code class="t">2</code> <code class="t">3</code> <code class="t">4</code> <code class="t">5</code> <code class="t">6</code> <code class="t">7</code> <code class="t">8</code> <code class="t">9</code> <code class="t">a</code> <code class="t">b</code> <code class="t">c</code> <code class="t">d</code> <code class="t">e</code> <code class="t">f</code> <code class="t">A</code> <code class="t">B</code> <code class="t">C</code> <code class="t">D</code> <code class="t">E</code> <code class="t">F</code></div>
</div>
<p>The <span class="nt">SourceCharacter</span> immediately following a <span class="nt">NumericLiteral</span> must not be
an <span class="nt">IdentifierStart</span> or <span class="nt">DecimalDigit</span>.</p>
<div class="note">
<p><span class="nh">NOTE</span> For example:</p>
<pre>3in</pre>
<p>is an error and not the two input elements <code>3</code> and <code>in</code>.</p>
</div>
<p>A conforming implementation, when processing <a href="#sec-strict-mode-code">strict mode code</a> (<a
href="#sec-strict-mode-code">see 10.2.1</a>), must not extend, as described in <a
href="#sec-additional-syntax-numeric-literals">B.1.1</a>, the syntax of <span class="nt">NumericLiteral</span> to include
<i>Legacy<span style="font-family: Times New Roman">OctalIntegerLiteral</span></i>, nor extend the syntax of <span
class="nt">DecimalIntegerLiteral</span> to include <span class="nt">NonOctalDecimalIntegerLiteral</span>.</p>
</div>
<section id="sec-static-semantics-mv-s">
<h1><span class="secnum" id="sec-11.8.3.1"><a href="#sec-static-semantics-mv-s"
title="link to this section">11.8.3.1</a></span> Static Semantics: MV’s</h1>
<p>A numeric literal stands for a value of the Number type. This value is determined in two steps: first, a mathematical
value (MV) is derived from the literal; second, this mathematical value is rounded as described below.</p>
<ul>
<li>
<p>The MV of <span class="prod"><span class="nt">NumericLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalLiteral</span></span> is the MV of <i>DecimalLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">NumericLiteral</span> <span class="geq">::</span> <span
class="nt">BinaryIntegerLiteral</span></span> is the MV of <i>BinaryIntegerLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">NumericLiteral</span> <span class="geq">::</span> <span
class="nt">OctalIntegerLiteral</span></span> is the MV of <i>OctalIntegerLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">NumericLiteral</span> <span class="geq">::</span> <span
class="nt">HexIntegerLiteral</span></span> is the MV of <i>HexIntegerLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span> <code class="t">.</code></span> is the MV of <i>DecimalIntegerLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span> <code class="t">.</code> <span class="nt">DecimalDigits</span></span> is the
MV of <i>DecimalIntegerLiteral</i> plus (the MV of <i>DecimalDigits</i> × 10<sup>–<i>n</i></sup>), where
<i>n</i> is the number of code points in <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span> <code class="t">.</code> <span class="nt">ExponentPart</span></span> is the MV
of <i>DecimalIntegerLiteral</i> × 10<sup><i>e</i></sup>, where <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span> <code class="t">.</code> <span class="nt">DecimalDigits</span> <span
class="nt">ExponentPart</span></span> is (the MV of <i>DecimalIntegerLiteral</i> plus (the MV of <i>DecimalDigits</i>
× 10<sup>–<i>n</i></sup>)) × 10<sup><i>e</i></sup>, where <i>n</i> is the number of code points in
<i>DecimalDigits</i> and <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <code
class="t">.</code> <span class="nt">DecimalDigits</span></span> is the MV of <i>DecimalDigits</i> ×
10<sup>–<i>n</i></sup>, where <i>n</i> is the number of code points in <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <code
class="t">.</code> <span class="nt">DecimalDigits</span> <span class="nt">ExponentPart</span></span> is the MV of
<i>DecimalDigits</i> × 10<sup><i>e</i>–<i>n</i></sup>, where <i>n</i> is the number of code points in
<i>DecimalDigits</i> and <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span></span> is the MV of <i>DecimalIntegerLiteral</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalLiteral</span> <span class="geq">::</span> <span
class="nt">DecimalIntegerLiteral</span> <span class="nt">ExponentPart</span></span> is the MV of
<i>DecimalIntegerLiteral</i> × 10<sup><i>e</i></sup>, where <i>e</i> is the MV of <i>ExponentPart</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0</code></span> is 0.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalIntegerLiteral</span> <span class="geq">::</span> <span
class="nt">NonZeroDigit</span></span> is the MV of <i>NonZeroDigit.</i></p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalIntegerLiteral</span> <span class="geq">::</span> <span
class="nt">NonZeroDigit</span> <span class="nt">DecimalDigits</span></span> is (the MV of <i>NonZeroDigit</i> ×
10<sup><i>n</i></sup>) plus the MV of <i>DecimalDigits</i>, where <i>n</i> is the number of code points in
<i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigits</span> <span class="geq">::</span> <span
class="nt">DecimalDigit</span></span> is the MV of <i>DecimalDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigits</span> <span class="geq">::</span> <span
class="nt">DecimalDigits</span> <span class="nt">DecimalDigit</span></span> is (the MV of <i>DecimalDigits</i> ×
10) plus the MV of <i>DecimalDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">ExponentPart</span> <span class="geq">::</span> <span
class="nt">ExponentIndicator</span> <span class="nt">SignedInteger</span></span> is the MV of
<i>SignedInteger</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">SignedInteger</span> <span class="geq">::</span> <span
class="nt">DecimalDigits</span></span> is the MV of <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">SignedInteger</span> <span class="geq">::</span> <code
class="t">+</code> <span class="nt">DecimalDigits</span></span> is the MV of <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">SignedInteger</span> <span class="geq">::</span> <code
class="t">-</code> <span class="nt">DecimalDigits</span></span> is the negative of the MV of <i>DecimalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">0</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">0</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span class="geq">::</span>
<code class="t">0</code></span> or of <span class="prod"><span class="nt">BinaryDigit</span> <span
class="geq">::</span> <code class="t">0</code></span> is 0.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">1</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">1</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">1</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">1</code></span> or<br>of <span class="prod"><span class="nt">BinaryDigit</span>
<span class="geq">::</span> <code class="t">1</code></span> is 1.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">2</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">2</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">2</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">2</code></span> is 2.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">3</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">3</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">3</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">3</code></span> is 3.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">4</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">4</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">4</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">4</code></span> is 4.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">5</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">5</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">5</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">5</code></span> is 5.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">6</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">6</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">6</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">6</code></span> is 6.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">7</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">7</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">7</code></span> or of <span class="prod"><span class="nt">OctalDigit</span> <span
class="geq">::</span> <code class="t">7</code></span> is 7.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">8</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">8</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">8</code></span> is 8.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">DecimalDigit</span> <span class="geq">::</span> <code
class="t">9</code></span> or of <span class="prod"><span class="nt">NonZeroDigit</span> <span class="geq">::</span>
<code class="t">9</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span>
<code class="t">9</code></span> is 9.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">a</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">A</code></span> is 10.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">b</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">B</code></span> is 11.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">c</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">C</code></span> is 12.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">d</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">D</code></span> is 13.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">e</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">E</code></span> is 14.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">f</code></span> or of <span class="prod"><span class="nt">HexDigit</span> <span class="geq">::</span> <code
class="t">F</code></span> is 15.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">BinaryIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0b</code> <span class="nt">BinaryDigits</span></span> is the MV of <i>BinaryDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">BinaryIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0B</code> <span class="nt">BinaryDigits</span></span> is the MV of <i>BinaryDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">BinaryDigits</span> <span class="geq">::</span> <span
class="nt">BinaryDigit</span></span> is the MV of <i>BinaryDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">BinaryDigits</span> <span class="geq">::</span> <span
class="nt">BinaryDigits</span> <span class="nt">BinaryDigit</span></span> is (the MV of <i>BinaryDigits</i> × 2)
plus the MV of <i>BinaryDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">OctalIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0o</code> <span class="nt">OctalDigits</span></span> is the MV of <i>OctalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">OctalIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0O</code> <span class="nt">OctalDigits</span></span> is the MV of <i>OctalDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">OctalDigits</span> <span class="geq">::</span> <span
class="nt">OctalDigit</span></span> is the MV of <i>OctalDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">OctalDigits</span> <span class="geq">::</span> <span
class="nt">OctalDigits</span> <span class="nt">OctalDigit</span></span> is (the MV of <i>OctalDigits</i> × 8)
plus the MV of <i>OctalDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0x</code> <span class="nt">HexDigits</span></span> is the MV of <i>HexDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexIntegerLiteral</span> <span class="geq">::</span> <code
class="t">0X</code> <span class="nt">HexDigits</span></span> is the MV of <i>HexDigits</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigits</span> <span class="geq">::</span> <span
class="nt">HexDigit</span></span> is the MV of <i>HexDigit</i>.</p>
</li>
<li>
<p>The MV of <span class="prod"><span class="nt">HexDigits</span> <span class="geq">::</span> <span
class="nt">HexDigits</span> <span class="nt">HexDigit</span></span> is (the MV of <i>HexDigits</i> × 16) plus
the MV of <i>HexDigit</i>.</p>
</li>
</ul>
<p>Once the exact MV for a numeric literal has been determined, it is then rounded to a value of the Number type. If the
MV is 0, then the rounded value is <span class="value">+0</span>; otherwise, the rounded value must be the Number value
for the MV (as specified in <a href="#sec-ecmascript-language-types-number-type">6.1.6</a>), unless the literal is a <span
class="nt">DecimalLiteral</span> and the literal has more than 20 significant digits, in which case the Number value may
be either the Number value for the MV of a literal produced by replacing each significant digit after the 20th with a
<code>0</code> digit or the Number value for the MV of a literal produced by replacing each significant digit after the
20th with a <code>0</code> digit and then incrementing the literal at the 20th significant digit position. A digit is
<i>significant</i> if it is not part of an <span class="nt">ExponentPart</span> and</p>
<ul>
<li>it is not <code>0</code>; or</li>
<li>there is a nonzero digit to its left and there is a nonzero digit, not in the <i>ExponentPart</i>, to its
right.</li>
</ul>
</section>
</section>
<section id="sec-literals-string-literals">
<div class="front">
<h1><span class="secnum" id="sec-11.8.4"><a href="#sec-literals-string-literals"
title="link to this section">11.8.4</a></span> String Literals</h1>
<div class="note">
<p><span class="nh">NOTE</span> A string literal is zero or more Unicode code points enclosed in single or double
quotes. Unicode code points may also be represented by an escape sequence. All <span style="font-family:
sans-serif">code points</span> may appear literally in a string literal except for the closing quote <span
style="font-family: sans-serif">code points</span>, U+005C (REVERSE SOLIDUS), U+000D (carriage return), U+2028 (line
separator), U+2029 (paragraph separator), and U+000A (line feed). Any <span style="font-family: sans-serif">code
points</span> may appear in the form of an escape sequence. String literals evaluate to ECMAScript String values. When
generating these string values Unicode code points are UTF-16 encoded as defined in <a
href="#sec-utf16encoding">10.1.1</a>. Code points belonging to the Basic Multilingual Plane are encoded as a single code
unit element of the string. All other code points are encoded as two code unit elements of the string.</p>
</div>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">StringLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">"</code> <span class="nt">DoubleStringCharacters</span><sub class="g-opt">opt</sub> <code class="t">"</code></div>
<div class="rhs"><code class="t">'</code> <span class="nt">SingleStringCharacters</span><sub class="g-opt">opt</sub> <code class="t">'</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DoubleStringCharacters</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">DoubleStringCharacter</span> <span class="nt">DoubleStringCharacters</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleStringCharacters</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SingleStringCharacter</span> <span class="nt">SingleStringCharacters</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">DoubleStringCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">"</code> <span class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <span class="nt">LineTerminator</span></div>
<div class="rhs"><code class="t">\</code> <span class="nt">EscapeSequence</span></div>
<div class="rhs"><span class="nt">LineContinuation</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleStringCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">'</code> <span class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <span class="nt">LineTerminator</span></div>
<div class="rhs"><code class="t">\</code> <span class="nt">EscapeSequence</span></div>
<div class="rhs"><span class="nt">LineContinuation</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">LineContinuation</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">\</code> <span class="nt">LineTerminatorSequence</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">EscapeSequence</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">CharacterEscapeSequence</span></div>
<div class="rhs"><code class="t">0</code> <span class="grhsannot">[lookahead ∉ <span class="nt">DecimalDigit</span>]</span></div>
<div class="rhs"><span class="nt">HexEscapeSequence</span></div>
<div class="rhs"><span class="nt">UnicodeEscapeSequence</span></div>
</div>
<p>A conforming implementation, when processing <a href="#sec-strict-mode-code">strict mode code</a> (<a
href="#sec-strict-mode-code">see 10.2.1</a>), must not extend the syntax of <span class="nt">EscapeSequence</span> to
include <i>Legacy<span style="font-family: Times New Roman">OctalEscapeSequence</span></i> as described in <a
href="#sec-additional-syntax-string-literals">B.1.2</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">CharacterEscapeSequence</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SingleEscapeCharacter</span></div>
<div class="rhs"><span class="nt">NonEscapeCharacter</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SingleEscapeCharacter</span> <span class="geq">::</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">'</code> <code class="t">"</code> <code class="t">\</code> <code class="t">b</code> <code class="t">f</code> <code class="t">n</code> <code class="t">r</code> <code class="t">t</code> <code class="t">v</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NonEscapeCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <span class="nt">EscapeCharacter</span> <span class="grhsmod">or</span> <span class="nt">LineTerminator</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">EscapeCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SingleEscapeCharacter</span></div>
<div class="rhs"><span class="nt">DecimalDigit</span></div>
<div class="rhs"><code class="t">x</code></div>
<div class="rhs"><code class="t">u</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">HexEscapeSequence</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">x</code> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">u</code> <span class="nt">Hex4Digits</span></div>
<div class="rhs"><code class="t">u{</code> <span class="nt">HexDigits</span> <code class="t">}</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">Hex4Digits</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span></div>
</div>
<p>The definition of the nonterminal <span class="nt">HexDigit</span> is given in <a
href="#sec-literals-numeric-literals">11.8.3</a>. <span class="nt">SourceCharacter</span> is defined in <a
href="#sec-source-text">10.1</a>.</p>
<div class="note">
<p><span class="nh">NOTE</span> A line terminator <span style="font-family: sans-serif">code point</span> cannot appear
in a string literal, except as part of a <i>LineContinuation</i> to produce the empty <span style="font-family:
sans-serif">code points</span> sequence. The proper way to cause a line terminator <span style="font-family:
sans-serif">code point</span> to be part of the String value of a string literal is to use an escape sequence such as
<code>\n</code> or <code>\u000A</code>.</p>
</div>
</div>
<section id="sec-string-literals-static-semantics-early-errors">
<h1><span class="secnum" id="sec-11.8.4.1"><a href="#sec-string-literals-static-semantics-early-errors"
title="link to this section">11.8.4.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span> <code class="t">u{</code> <span class="nt">HexDigits</span> <code class="t">}</code></div>
<ul>
<li>It is a Syntax Error if the MV of <span class="nt">HexDigits</span> > <span style="font-family: Times New
Roman">1114111<i>.</i></span></li>
</ul>
</section>
<section id="sec-string-literals-static-semantics-stringvalue">
<h1><span class="secnum" id="sec-11.8.4.2"><a href="#sec-string-literals-static-semantics-stringvalue"
title="link to this section">11.8.4.2</a></span> Static Semantics<span style="font-family: sans-serif">:</span>
<i>StringValue</i></h1>
<p>See also: <a href="#sec-identifier-names-static-semantics-stringvalue">11.6.1.2</a>, <a
href="#sec-identifiers-static-semantics-stringvalue">12.1.4</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">StringLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">"</code> <span class="nt">DoubleStringCharacters</span><sub class="g-opt">opt</sub> <code class="t">"</code></div>
<div class="rhs"><code class="t">'</code> <span class="nt">SingleStringCharacters</span><sub class="g-opt">opt</sub> <code class="t">'</code></div>
</div>
<ol class="proc">
<li>Return the String value whose elements are the SV of this <i>StringLiteral</i>.</li>
</ol>
</section>
<section id="sec-static-semantics-sv-s">
<h1><span class="secnum" id="sec-11.8.4.3"><a href="#sec-static-semantics-sv-s"
title="link to this section">11.8.4.3</a></span> Static Semantics: <i>SV’s</i></h1>
<p>A string literal stands for a value of the String type. The String value (SV) of the literal is described in terms of
code unit values contributed by the various parts of the string literal. As part of this process, some Unicode code points
within the string literal are interpreted as having a mathematical value (MV), as described below or in <a
href="#sec-literals-numeric-literals">11.8.3</a>.</p>
<ul>
<li>
<p>The SV of <span class="prod"><span class="nt">StringLiteral</span> <span class="geq">::</span> <code
class="t">""</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">StringLiteral</span> <span class="geq">::</span> <code
class="t">''</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">StringLiteral</span> <span class="geq">::</span> <code
class="t">"</code> <span class="nt">DoubleStringCharacters</span> <code class="t">"</code></span> is the SV of
<i>DoubleStringCharacters</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">StringLiteral</span> <span class="geq">::</span> <code
class="t">'</code> <span class="nt">SingleStringCharacters</span> <code class="t">'</code></span> is the SV of
<i>SingleStringCharacters</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">DoubleStringCharacters</span> <span class="geq">::</span> <span
class="nt">DoubleStringCharacter</span></span> is a sequence of one or two code units that is the SV of
<i>DoubleStringCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">DoubleStringCharacters</span> <span class="geq">::</span> <span
class="nt">DoubleStringCharacter</span> <span class="nt">DoubleStringCharacters</span></span> is a sequence of one or
two code units that is the SV of <i>DoubleStringCharacter</i> followed by all the code units in the SV of
<i>DoubleStringCharacters</i> in order.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">SingleStringCharacters</span> <span class="geq">::</span> <span
class="nt">SingleStringCharacter</span></span> is a sequence of one or two code units that is the SV of
<i>SingleStringCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">SingleStringCharacters</span> <span class="geq">::</span> <span
class="nt">SingleStringCharacter</span> <span class="nt">SingleStringCharacters</span></span> is a sequence of one or
two code units that is the SV of <i>SingleStringCharacter</i> followed by all the code units in the SV of
<i>SingleStringCharacters</i> in order.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">DoubleStringCharacter</span> <span class="geq">::</span> <span
class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">"</code> <span
class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <span
class="nt">LineTerminator</span></span> is the <a href="#sec-utf16encoding">UTF16Encoding</a> (<a
href="#sec-utf16encoding">10.1.1</a>) of the code point value of <i>SourceCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">DoubleStringCharacter</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">EscapeSequence</span></span> is the SV of the <i>EscapeSequence</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">DoubleStringCharacter</span> <span class="geq">::</span> <span
class="nt">LineContinuation</span></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">SingleStringCharacter</span> <span class="geq">::</span> <span
class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">'</code> <span
class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <span
class="nt">LineTerminator</span></span> is the <a href="#sec-utf16encoding">UTF16Encoding</a> (<a
href="#sec-utf16encoding">10.1.1</a>) of the code point value of <i>SourceCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">SingleStringCharacter</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">EscapeSequence</span></span> is the SV of the <i>EscapeSequence</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">SingleStringCharacter</span> <span class="geq">::</span> <span
class="nt">LineContinuation</span></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">CharacterEscapeSequence</span></span> is the SV of the <i>CharacterEscapeSequence</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <code
class="t">0</code></span> is the code unit value 0.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">HexEscapeSequence</span></span> is the SV of the <i>HexEscapeSequence</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">UnicodeEscapeSequence</span></span> is the SV of the <i>UnicodeEscapeSequence</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">CharacterEscapeSequence</span> <span class="geq">::</span> <span
class="nt">SingleEscapeCharacter</span></span> is the code unit whose value is determined by the
<i>SingleEscapeCharacter</i> according to { REF _Ref365803173 \h }<a href="#table-34">Table 34</a>.</p>
</li>
</ul>
<figure>
<figcaption><span id="table-34">Table 34</span> — String Single Character Escape Sequences</figcaption>
<table class="real-table">
<tr>
<th>Escape Sequence</th>
<th>Code Unit Value</th>
<th>Unicode Character Name</th>
<th>Symbol</th>
</tr>
<tr>
<td><code>\b</code></td>
<td><code>0x0008</code></td>
<td>BACKSPACE</td>
<td><BS></td>
</tr>
<tr>
<td><code>\t</code></td>
<td><code>0x0009</code></td>
<td>CHARACTER TABULATION</td>
<td><HT></td>
</tr>
<tr>
<td><code>\n</code></td>
<td><code>0x000A</code></td>
<td>line feed (lf)</td>
<td><LF></td>
</tr>
<tr>
<td><code>\v</code></td>
<td><code>0x000B</code></td>
<td>LINE TABULATION</td>
<td><VT></td>
</tr>
<tr>
<td><code>\f</code></td>
<td><code>0x000C</code></td>
<td>form feed (ff)</td>
<td><FF></td>
</tr>
<tr>
<td><code>\r</code></td>
<td><code>0x000D</code></td>
<td>carriage return (cr)</td>
<td><CR></td>
</tr>
<tr>
<td><code>\"</code></td>
<td><code>0x0022</code></td>
<td>quotation Mark</td>
<td><code>"</code></td>
</tr>
<tr>
<td><code>\'</code></td>
<td><code>0x0027</code></td>
<td>apostrophe</td>
<td><code>'</code></td>
</tr>
<tr>
<td><code>\\</code></td>
<td><code>0x005C</code></td>
<td>REverse Solidus</td>
<td><code>\</code></td>
</tr>
</table>
</figure>
<ul>
<li>
<p>The SV of <span class="prod"><span class="nt">CharacterEscapeSequence</span> <span class="geq">::</span> <span
class="nt">NonEscapeCharacter</span></span> is the SV of the <i>NonEscapeCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">NonEscapeCharacter</span> <span class="geq">::</span> <span
class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <span class="nt">EscapeCharacter</span>
<span class="grhsmod">or</span> <span class="nt">LineTerminator</span></span> is the <a
href="#sec-utf16encoding">UTF16Encoding</a> (<a href="#sec-utf16encoding">10.1.1</a>) of the code point value of
<i>SourceCharacter</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">HexEscapeSequence</span> <span class="geq">::</span> <code
class="t">x</code> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span></span> is the code unit value
that is (16 times the MV of the first <i>HexDigit</i>) plus the MV of the second <i>HexDigit</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span> <code
class="t">u</code> <span class="nt">Hex4Digits</span></span> is the SV of <var>Hex4Digits.</var></p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">Hex4Digits</span> <span class="geq">::</span> <span
class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span
class="nt">HexDigit</span></span> is the code unit value that is (4096 times the MV of the first <i>HexDigit</i>) plus
(256 times the MV of the second <i>HexDigit</i>) plus (16 times the MV of the third <i>HexDigit</i>) plus the MV of
the fourth <i>HexDigit</i>.</p>
</li>
<li>
<p>The SV of <span class="prod"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span> <code
class="t">u{</code> <span class="nt">HexDigits</span> <code class="t">}</code></span> is the <a
href="#sec-utf16encoding">UTF16Encoding</a> (<a href="#sec-utf16encoding">10.1.1</a>) of the MV of
<i>HexDigits</i>.</p>
</li>
</ul>
</section>
</section>
<section id="sec-literals-regular-expression-literals">
<div class="front">
<h1><span class="secnum" id="sec-11.8.5"><a href="#sec-literals-regular-expression-literals"
title="link to this section">11.8.5</a></span> Regular Expression Literals</h1>
<div class="note">
<p><span class="nh">NOTE</span> A regular expression literal is an input element that is converted to a RegExp object
(<a href="#sec-regexp-regular-expression-objects">see 21.2</a>) each time the literal is evaluated. Two regular
expression literals in a program evaluate to regular expression objects that never compare as <code>===</code> to each
other even if the two literals' contents are identical. A RegExp object may also be created at runtime by <code>new
RegExp</code> or calling the <code>RegExp</code> constructor as a function (<a href="#sec-regexp-constructor">see
21.2.3</a>).</p>
</div>
<p>The productions below describe the syntax for a regular expression literal and are used by the input element scanner to
find the end of the regular expression literal. The source text comprising the <span
class="nt">RegularExpressionBody</span> and the <span class="nt">RegularExpressionFlags</span> are subsequently parsed
again using the more stringent ECMAScript Regular Expression grammar (<a href="#sec-patterns">21.2.1</a>).</p>
<p>An implementation may extend the ECMAScript Regular Expression grammar defined in <a href="#sec-patterns">21.2.1</a>,
but it must not extend the <span class="nt">RegularExpressionBody</span> and <span
class="nt">RegularExpressionFlags</span> productions defined below or the productions used by these productions.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionLiteral</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">/</code> <span class="nt">RegularExpressionBody</span> <code class="t">/</code> <span class="nt">RegularExpressionFlags</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionBody</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">RegularExpressionFirstChar</span> <span class="nt">RegularExpressionChars</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionChars</span> <span class="geq">::</span></div>
<div class="rhs"><span class="grhsannot">[empty]</span></div>
<div class="rhs"><span class="nt">RegularExpressionChars</span> <span class="nt">RegularExpressionChar</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionFirstChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">RegularExpressionNonTerminator</span> <span class="grhsmod">but not one of</span> <code class="t">*</code> <span class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <code class="t">/</code> <span class="grhsmod">or</span> <code class="t">[</code></div>
<div class="rhs"><span class="nt">RegularExpressionBackslashSequence</span></div>
<div class="rhs"><span class="nt">RegularExpressionClass</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">RegularExpressionNonTerminator</span> <span class="grhsmod">but not one of</span> <code class="t">\</code> <span class="grhsmod">or</span> <code class="t">/</code> <span class="grhsmod">or</span> <code class="t">[</code></div>
<div class="rhs"><span class="nt">RegularExpressionBackslashSequence</span></div>
<div class="rhs"><span class="nt">RegularExpressionClass</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionBackslashSequence</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">\</code> <span class="nt">RegularExpressionNonTerminator</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionNonTerminator</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not</span> <span class="nt">LineTerminator</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionClass</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">[</code> <span class="nt">RegularExpressionClassChars</span> <code class="t">]</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionClassChars</span> <span class="geq">::</span></div>
<div class="rhs"><span class="grhsannot">[empty]</span></div>
<div class="rhs"><span class="nt">RegularExpressionClassChars</span> <span class="nt">RegularExpressionClassChar</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionClassChar</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">RegularExpressionNonTerminator</span> <span class="grhsmod">but not one of</span> <code class="t">]</code> <span class="grhsmod">or</span> <code class="t">\</code></div>
<div class="rhs"><span class="nt">RegularExpressionBackslashSequence</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">RegularExpressionFlags</span> <span class="geq">::</span></div>
<div class="rhs"><span class="grhsannot">[empty]</span></div>
<div class="rhs"><span class="nt">RegularExpressionFlags</span> <span class="nt">IdentifierPart</span></div>
</div>
<div class="note">
<p><span class="nh">NOTE</span> Regular expression literals may not be empty; instead of representing an empty regular
expression literal, the code unit sequence <code>//</code> starts a single-line comment. To specify an empty regular
expression, use: <code>/(?:)/</code>.</p>
</div>
</div>
<section id="sec-literals-regular-expression-literals-static-semantics-early-errors">
<h1><span class="secnum" id="sec-11.8.5.1"><a
href="#sec-literals-regular-expression-literals-static-semantics-early-errors"
title="link to this section">11.8.5.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">RegularExpressionFlags</span> <span class="geq">::</span> <span class="nt">RegularExpressionFlags</span> <span class="nt">IdentifierPart</span></div>
<ul>
<li>It is a Syntax Error if <span class="nt">IdentifierPart</span> contains a Unicode escape sequence<var>.</var></li>
</ul>
</section>
<section id="sec-static-semantics-bodytext">
<h1><span class="secnum" id="sec-11.8.5.2"><a href="#sec-static-semantics-bodytext"
title="link to this section">11.8.5.2</a></span> Static Semantics: <i>BodyText</i></h1>
<div class="gp prod"><span class="nt">RegularExpressionLiteral</span> <span class="geq">::</span> <code class="t">/</code> <span class="nt">RegularExpressionBody</span> <code class="t">/</code> <span class="nt">RegularExpressionFlags</span></div>
<ol class="proc">
<li>Return the source text that was recognized as <i>RegularExpressionBody</i>.</li>
</ol>
</section>
<section id="sec-static-semantics-flagtext">
<h1><span class="secnum" id="sec-11.8.5.3"><a href="#sec-static-semantics-flagtext"
title="link to this section">11.8.5.3</a></span> Static Semantics: <i>FlagText</i></h1>
<div class="gp prod"><span class="nt">RegularExpressionLiteral</span> <span class="geq">::</span> <code class="t">/</code> <span class="nt">RegularExpressionBody</span> <code class="t">/</code> <span class="nt">RegularExpressionFlags</span></div>
<ol class="proc">
<li>Return the source text that was recognized as <i>RegularExpressionFlags</i>.</li>
</ol>
</section>
</section>
<section id="sec-template-literal-lexical-components">
<div class="front">
<h1><span class="secnum" id="sec-11.8.6"><a href="#sec-template-literal-lexical-components"
title="link to this section">11.8.6</a></span> Template Literal Lexical Components</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">Template</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">NoSubstitutionTemplate</span></div>
<div class="rhs"><span class="nt">TemplateHead</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NoSubstitutionTemplate</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">`</code> <span class="nt">TemplateCharacters</span><sub class="g-opt">opt</sub> <code class="t">`</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateHead</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">`</code> <span class="nt">TemplateCharacters</span><sub class="g-opt">opt</sub> <code class="t">${</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateSubstitutionTail</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">TemplateMiddle</span></div>
<div class="rhs"><span class="nt">TemplateTail</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateMiddle</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">}</code> <span class="nt">TemplateCharacters</span><sub class="g-opt">opt</sub> <code class="t">${</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateTail</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">}</code> <span class="nt">TemplateCharacters</span><sub class="g-opt">opt</sub> <code class="t">`</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateCharacters</span> <span class="geq">::</span></div>
<div class="rhs"><span class="nt">TemplateCharacter</span> <span class="nt">TemplateCharacters</span><sub class="g-opt">opt</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateCharacter</span> <span class="geq">::</span></div>
<div class="rhs"><code class="t">$</code> <span class="grhsannot">[lookahead ≠ { ]</span></div>
<div class="rhs"><code class="t">\</code> <span class="nt">EscapeSequence</span></div>
<div class="rhs"><span class="nt">LineContinuation</span></div>
<div class="rhs"><span class="nt">LineTerminatorSequence</span></div>
<div class="rhs"><span class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">`</code> <span class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <code class="t">$</code> <span class="grhsmod">or</span> <span class="nt">LineTerminator</span></div>
</div>
<p>A conforming implementation must not use the extended definition of <span class="nt">EscapeSequence</span> described in
<a href="#sec-additional-syntax-string-literals">B.1.2</a> when parsing a <span class="nt">TemplateCharacter</span>.</p>
<div class="note">
<p><span class="nh">NOTE</span> <i>TemplateSubstitutionTail</i> is used by the <i>InputElementTemplateTail</i>
alternative lexical goal.</p>
</div>
</div>
<section id="sec-static-semantics-tv-s-and-trv-s">
<h1><span class="secnum" id="sec-11.8.6.1"><a href="#sec-static-semantics-tv-s-and-trv-s"
title="link to this section">11.8.6.1</a></span> Static Semantics: <i>TV’s and TRV’s</i></h1>
<p>A template literal component is interpreted as a sequence of Unicode code points. The Template Value (TV) of a literal
component is described in terms of code unit values (SV, <a href="#sec-literals-string-literals">11.8.4</a>) contributed
by the various parts of the template literal component. As part of this process, some Unicode code points within the
template component are interpreted as having a mathematical value (MV, <a
href="#sec-literals-numeric-literals">11.8.3</a>). In determining a TV, escape sequences are replaced by the UTF-16 code
unit(s) of the Unicode code point represented by the escape sequence. The Template Raw Value (TRV) is similar to a
Template Value with the difference that in TRVs escape sequences are interpreted literally.</p>
<ul>
<li>
<p>The TV and TRV of <span class="prod"><span class="nt">NoSubstitutionTemplate</span> <span class="geq">::</span>
<code class="t">``</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The TV and TRV of <span class="prod"><span class="nt">TemplateHead</span> <span class="geq">::</span> <code
class="t">`${</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The TV and TRV of <span class="prod"><span class="nt">TemplateMiddle</span> <span class="geq">::</span> <code
class="t">}${</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The TV and TRV of <span class="prod"><span class="nt">TemplateTail</span> <span class="geq">::</span> <code
class="t">}`</code></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">NoSubstitutionTemplate</span> <span class="geq">::</span> <code
class="t">`</code> <span class="nt">TemplateCharacters</span> <code class="t">`</code></span> is the TV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateHead</span> <span class="geq">::</span> <code
class="t">`</code> <span class="nt">TemplateCharacters</span> <code class="t">${</code></span> is the TV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateMiddle</span> <span class="geq">::</span> <code
class="t">}</code> <span class="nt">TemplateCharacters</span> <code class="t">${</code></span> is the TV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateTail</span> <span class="geq">::</span> <code
class="t">}</code> <span class="nt">TemplateCharacters</span> <code class="t">`</code></span> is the TV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacters</span> <span class="geq">::</span> <span
class="nt">TemplateCharacter</span></span> is the TV of <i>TemplateCharacter</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacters</span> <span class="geq">::</span> <span
class="nt">TemplateCharacter</span> <span class="nt">TemplateCharacters</span></span> is a sequence consisting of the
code units in the TV of <i>TemplateCharacter</i> followed by all the code units in the TV of <i>TemplateCharacters</i>
in order.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">`</code> <span
class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <code class="t">$</code> <span
class="grhsmod">or</span> <span class="nt">LineTerminator</span></span> is the <a
href="#sec-utf16encoding">UTF16Encoding</a> (<a href="#sec-utf16encoding">10.1.1</a>) of the code point value of
<i>SourceCharacter</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <code
class="t">$</code></span> is the code unit value 0x0024.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">EscapeSequence</span></span> is the SV of <i>EscapeSequence</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">LineContinuation</span></span> is the TV of <i>LineContinuation</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">LineTerminatorSequence</span></span> is the TRV of <i>LineTerminatorSequence</i>.</p>
</li>
<li>
<p>The TV of <span class="prod"><span class="nt">LineContinuation</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">LineTerminatorSequence</span></span> is the empty code unit sequence.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">NoSubstitutionTemplate</span> <span class="geq">::</span> <code
class="t">`</code> <span class="nt">TemplateCharacters</span> <code class="t">`</code></span> is the TRV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateHead</span> <span class="geq">::</span> <code
class="t">`</code> <span class="nt">TemplateCharacters</span> <code class="t">${</code></span> is the TRV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateMiddle</span> <span class="geq">::</span> <code
class="t">}</code> <span class="nt">TemplateCharacters</span> <code class="t">${</code></span> is the TRV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateTail</span> <span class="geq">::</span> <code
class="t">}</code> <span class="nt">TemplateCharacters</span> <code class="t">`</code></span> is the TRV of
<i>TemplateCharacters</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacters</span> <span class="geq">::</span> <span
class="nt">TemplateCharacter</span></span> is the TRV of <i>TemplateCharacter</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacters</span> <span class="geq">::</span> <span
class="nt">TemplateCharacter</span> <span class="nt">TemplateCharacters</span></span> is a sequence consisting of the
code units in the TRV of <i>TemplateCharacter</i> followed by all the code units in the TRV of
<i>TemplateCharacters,</i> in order.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">SourceCharacter</span> <span class="grhsmod">but not one of</span> <code class="t">`</code> <span
class="grhsmod">or</span> <code class="t">\</code> <span class="grhsmod">or</span> <code class="t">$</code> <span
class="grhsmod">or</span> <span class="nt">LineTerminator</span></span> is the <a
href="#sec-utf16encoding">UTF16Encoding</a> (<a href="#sec-utf16encoding">10.1.1</a>) of the code point value of
<i>SourceCharacter</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <code
class="t">$</code></span> is the code unit value 0x0024.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">EscapeSequence</span></span> is the sequence consisting of the code unit value
0x005C followed by the code units of TRV of <i>EscapeSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">LineContinuation</span></span> is the TRV of <i>LineContinuation</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">TemplateCharacter</span> <span class="geq">::</span> <span
class="nt">LineTerminatorSequence</span></span> is the TRV of <i>LineTerminatorSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">CharacterEscapeSequence</span></span> is the TRV of the <i>CharacterEscapeSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <code
class="t">0</code></span> is the code unit value 0x0030.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">HexEscapeSequence</span></span> is the TRV of the <i>HexEscapeSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">EscapeSequence</span> <span class="geq">::</span> <span
class="nt">UnicodeEscapeSequence</span></span> is the TRV of the <i>UnicodeEscapeSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">CharacterEscapeSequence</span> <span class="geq">::</span> <span
class="nt">SingleEscapeCharacter</span></span> is the TRV of the <i>SingleEscapeCharacter</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">CharacterEscapeSequence</span> <span class="geq">::</span> <span
class="nt">NonEscapeCharacter</span></span> is the SV of the <i>NonEscapeCharacter</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">SingleEscapeCharacter</span> <span class="geq">::</span> <span
class="grhsmod">one of</span> <code class="t">'</code> <code class="t">"</code> <code class="t">\</code> <code
class="t">b</code> <code class="t">f</code> <code class="t">n</code> <code class="t">r</code> <code class="t">t</code>
<code class="t">v</code></span> is the SV of the <i>SourceCharacter</i> that is that single code point.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">HexEscapeSequence</span> <span class="geq">::</span> <code
class="t">x</code> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span></span> is the sequence
consisting of code unit value 0x0078 followed by TRV of the first <i>HexDigit</i> followed by the TRV of the second
<i>HexDigit</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span> <code
class="t">u</code> <span class="nt">Hex4Digits</span></span> is the sequence consisting of code unit value 0x0075
followed by TRV of <span class="nt">Hex4Digits</span>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">UnicodeEscapeSequence</span> <span class="geq">::</span> <code
class="t">u{</code> <span class="nt">HexDigits</span> <code class="t">}</code></span> is the sequence consisting of
code unit value 0x0075 followed by code unit value 0x007B followed by TRV of <i>HexDigits</i> followed by code unit
value 0x007D.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">Hex4Digits</span> <span class="geq">::</span> <span
class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span class="nt">HexDigit</span> <span
class="nt">HexDigit</span></span> is the sequence consisting of the TRV of the first <i>HexDigit</i> followed by the
TRV of the second <i>HexDigit</i> followed by the TRV of the third <i>HexDigit</i> followed by the TRV of the fourth
<span class="nt">HexDigit</span>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">HexDigits</span> <span class="geq">::</span> <span
class="nt">HexDigit</span></span> is the TRV of <i>HexDigit</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">HexDigits</span> <span class="geq">::</span> <span
class="nt">HexDigits</span> <span class="nt">HexDigit</span></span> is the sequence consisting of TRV of
<i>HexDigits</i> followed by TRV of <i>HexDigit</i>.</p>
</li>
<li>
<p>The TRV of a <i>HexDigit</i> is the SV of the <i>SourceCharacter</i> that is that <i>HexDigit</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineContinuation</span> <span class="geq">::</span> <code
class="t">\</code> <span class="nt">LineTerminatorSequence</span></span> is the sequence consisting of the code unit
value 0x005C followed by the code units of TRV of <i>LineTerminatorSequence</i>.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></span>
<LF> is the code unit value 0x000A.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></span>
<CR> is the code unit value 0x000A.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></span>
<LS> is the code unit value 0x2028.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></span>
<PS> is the code unit value 0x2029.</p>
</li>
<li>
<p>The TRV of <span class="prod"><span class="nt">LineTerminatorSequence</span> <span class="geq">::</span></span>
<CR><LF> is the sequence consisting of the code unit value 0x000A.</p>
</li>
</ul>
<div class="note">
<p><span class="nh">NOTE</span> TV excludes the code units of <i>LineContinuation</i> while TRV includes them.
<CR><LF> and <CR> <i>LineTerminatorSequences</i> are normalized to <LF> for both TV and TRV. An
explicit <i>EscapeSequence</i> is needed to include a <CR> or <CR><LF> sequence.</p>
</div>
</section>
</section>
</section>
<section id="sec-automatic-semicolon-insertion">
<div class="front">
<h1><span class="secnum" id="sec-11.9"><a href="#sec-automatic-semicolon-insertion"
title="link to this section">11.9</a></span> Automatic Semicolon Insertion</h1>
<p>Certain ECMAScript statements (empty statement, <code>let</code>, <code>const</code>, <code>import</code>, and
<code>export</code> declarations, variable statement, expression statement, <code>debugger</code> statement,
<code>continue</code> statement, <code>break</code> statement, <code>return</code> statement, and <code>throw</code>
statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text. For
convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are
described by saying that semicolons are automatically inserted into the source code token stream in those situations.</p>
</div>
<section id="sec-rules-of-automatic-semicolon-insertion">
<h1><span class="secnum" id="sec-11.9.1"><a href="#sec-rules-of-automatic-semicolon-insertion"
title="link to this section">11.9.1</a></span> Rules of Automatic Semicolon Insertion</h1>
<p>In the following rules, “token” means the actual recognized lexical token determined using the current
lexical goal symbol as described in <a href="#sec-ecmascript-language-lexical-grammar">clause 11</a>.</p>
<p>There are three basic rules of semicolon insertion:</p>
<ol class="proc">
<li>When, as a <span style="font-family: Times New Roman"><i>Script</i> or <i>Module</i></span> is parsed from left to
right, a token (called the <i>offending token</i>) is encountered that is not allowed by any production of the
grammar, then a semicolon is automatically inserted before the offending token if one or more of the following
conditions is true:
<ul>
<li>
<p>The offending token is separated from the previous token by at least one <i>LineTerminator</i>.</p>
</li>
<li>
<p>The offending token is <code>}</code>.</p>
</li>
<li>
<p>The previous token is <code>)</code> and the inserted semicolon would then be parsed as the terminating semicolon
of a do-while statement (<a href="#sec-do-while-statement">13.6.1</a>).</p>
</li>
</ul>
</li>
<li>When, as the <span style="font-family: Times New Roman"><i>Script</i> or <i>Module</i></span> is parsed from left to
right, the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream
as a single complete ECMAScript <span style="font-family: Times New Roman"><i>Script</i> or <i>Module</i></span>, then
a semicolon is automatically inserted at the end of the input stream.</li>
<li>When, as the <span style="font-family: Times New Roman"><i>Script</i> or <i>Module</i></span> is parsed from left to
right, a token is encountered that is allowed by some production of the grammar, but the production is a <i>restricted
production</i> and the token would be the first token for a terminal or nonterminal immediately following the
annotation <span style="font-family: Times New Roman">“</span>[no <span style="font-family: Times New
Roman"><i>LineTerminator</i></span> here]” within the restricted production (and therefore such a token is
called a restricted token), and the restricted token is separated from the previous token by at least one <span
class="nt">LineTerminator</span>, then a semicolon is automatically inserted before the restricted token.</li>
</ol>
<p>However, there is an additional overriding condition on the preceding rules: a semicolon is never inserted automatically
if the semicolon would then be parsed as an empty statement or if that semicolon would become one of the two semicolons in
the header of a <code>for</code> statement (<a href="#sec-for-statement">see 13.6.3</a>).</p>
<div class="note">
<p><span class="nh">NOTE</span> The following are the only restricted productions in the grammar:</p>
</div>
<div class="gp">
<div class="lhs"><span class="nt">PostfixExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[?Yield]</sub> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">++</code></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[?Yield]</sub> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">--</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ContinueStatement</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">continue;</code></div>
<div class="rhs"><code class="t">continue</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">LabelIdentifier</span><sub class="g-params">[?Yield]</sub> <code class="t">;</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">BreakStatement</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">break</code> <code class="t">;</code></div>
<div class="rhs"><code class="t">break</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">LabelIdentifier</span><sub class="g-params">[?Yield]</sub> <code class="t">;</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ReturnStatement</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">return</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">Expression</span> <code class="t">;</code></div>
<div class="rhs"><code class="t">return</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">;</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ThrowStatement</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">throw</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">;</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ArrowFunction</span><sub class="g-params">[In, Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">ArrowParameters</span><sub class="g-params">[?Yield]</sub> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">=></code> <span class="nt">ConciseBody</span><sub class="g-params">[?In]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">YieldExpression</span><sub class="g-params">[In]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">yield</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">*</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[?In, Yield]</sub></div>
<div class="rhs"><code class="t">yield</code> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <span class="nt">AssignmentExpression</span><sub class="g-params">[?In, Yield]</sub></div>
</div>
<p>The practical effect of these restricted productions is as follows:</p>
<p>When a <code>++</code> or <code>--</code> token is encountered where the parser would treat it as a postfix operator, and
at least one <span class="nt">LineTerminator</span> occurred between the preceding token and the <code>++</code> or
<code>--</code> token, then a semicolon is automatically inserted before the <code>++</code> or <code>--</code> token.</p>
<p>When a <code>continue</code>, <code>break</code>, <code>return</code>, <code>throw</code>, or <code>yield</code> token is
encountered and a <span class="nt">LineTerminator</span> is encountered before the next token, a semicolon is automatically
inserted after the <code>continue</code>, <code>break</code>, <code>return</code>, <code>throw</code>, or <code>yield</code>
token.</p>
<p>The resulting practical advice to ECMAScript programmers is:</p>
<p>A postfix <code>++</code> or <code>--</code> operator should appear on the same line as its operand.</p>
<p>An <span class="nt">Expression</span> in a <code>return</code> or <code>throw</code> statement or an <span
class="nt">AssignmentExpression</span> in a <code>yield</code> expression should start on the same line as the
<code>return</code>, <code>throw</code>, or <code>yield</code> token.</p>
<p>An <span class="nt">IdentifierReference</span> in a <code>break</code> or <code>continue</code> statement should be on
the same line as the <code>break</code> or <code>continue</code> token.</p>
</section>
<section id="sec-examples-of-automatic-semicolon-insertion">
<h1><span class="secnum" id="sec-11.9.2"><a href="#sec-examples-of-automatic-semicolon-insertion"
title="link to this section">11.9.2</a></span> Examples of Automatic Semicolon Insertion</h1>
<p>The source</p>
<pre>{ 1 2 } 3</pre>
<p>is not a valid sentence in the ECMAScript grammar, even with the <a href="#sec-automatic-semicolon-insertion">automatic
semicolon insertion</a> rules. In contrast, the source</p>
<pre>{ 1<br>2 } 3</pre>
<p>is also not a valid ECMAScript sentence, but is transformed by <a href="#sec-automatic-semicolon-insertion">automatic
semicolon insertion</a> into the following:</p>
<pre>{ 1<br>;2 ;} 3;</pre>
<p>which is a valid ECMAScript sentence.</p>
<p>The source</p>
<pre>for (a; b<br>)</pre>
<p>is not a valid ECMAScript sentence and is not altered by <a href="#sec-automatic-semicolon-insertion">automatic semicolon
insertion</a> because the semicolon is needed for the header of a <code>for</code> statement. Automatic semicolon insertion
never inserts one of the two semicolons in the header of a <code>for</code> statement.</p>
<p>The source</p>
<pre>return<br>a + b</pre>
<p>is transformed by <a href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a> into the following:</p>
<pre>return;<br>a + b;</pre>
<div class="note">
<p><span class="nh">NOTE</span> The expression <code>a + b</code> is not treated as a value to be returned by the
<code>return</code> statement, because a <i>LineTerminator</i> separates it from the token <code>return</code>.</p>
</div>
<p>The source</p>
<pre>a = b<br>++c</pre>
<p>is transformed by <a href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a> into the following:</p>
<pre>a = b;<br>++c;</pre>
<div class="note">
<p><span class="nh">NOTE</span> The token <code>++</code> is not treated as a postfix operator applying to the variable
<code>b</code>, because a <i>LineTerminator</i> occurs between <code>b</code> and <code>++</code>.</p>
</div>
<p>The source</p>
<pre>if (a > b)<br>else c = d</pre>
<p>is not a valid ECMAScript sentence and is not altered by <a href="#sec-automatic-semicolon-insertion">automatic semicolon
insertion</a> before the <code>else</code> token, even though no production of the grammar applies at that point, because an
automatically inserted semicolon would then be parsed as an empty statement.</p>
<p>The source</p>
<pre>a = b + c<br>(d + e).print()</pre>
<p>is <i>not</i> transformed by <a href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a>, because the
parenthesized expression that begins the second line can be interpreted as an argument list for a function call:</p>
<pre>a = b + c(d + e).print()</pre>
<p>In the circumstance that an assignment statement must begin with a left parenthesis, it is a good idea for the programmer
to provide an explicit semicolon at the end of the preceding statement rather than to rely on <a
href="#sec-automatic-semicolon-insertion">automatic semicolon insertion</a>.</p>
</section>
</section>
</section>
<section id="sec-ecmascript-language-expressions">
<div class="front">
<h1><span class="secnum" id="sec-12"><a href="#sec-ecmascript-language-expressions" title="link to this section">12</a></span>
ECMAScript Language: Expressions</h1>
</div>
<section id="sec-identifiers">
<div class="front">
<h1><span class="secnum" id="sec-12.1"><a href="#sec-identifiers" title="link to this section">12.1</a></span>
Identifiers</h1>
<p><b>Syntax</b></p>
<div class="gp">
<div class="lhs"><span class="nt">IdentifierReference</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">Identifier</span></div>
<div class="rhs"><span class="grhsannot">[~Yield]</span> <code class="t">yield</code></div>
</div>
<p><i>BindingIdentifier</i><span style="font-family: sans-serif"><sub>[Yield]</sub></span> <b>:</b></p>
<p><span style="font-family: Times New Roman"><i>Identifier<br></i></span>[~Yield] <code>yield</code></p>
<div class="gp">
<div class="lhs"><span class="nt">LabelIdentifier</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">Identifier</span></div>
<div class="rhs"><span class="grhsannot">[~Yield]</span> <code class="t">yield</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">Identifier</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">IdentifierName</span> <span class="grhsmod">but not</span> <span class="nt">ReservedWord</span></div>
</div>
</div>
<section id="sec-identifiers-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.1.1"><a href="#sec-identifiers-static-semantics-early-errors"
title="link to this section">12.1.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <span class="nt">Identifier</span></div>
<ul>
<li>
<p>It is a Syntax Error if the code matched by this production is contained in <a href="#sec-strict-mode-code">strict
mode code</a> and the StringValue of <span class="nt">Identifier</span> is <code>"arguments"</code> or
<code>"eval"</code>.</p>
</li>
</ul>
<p><span class="prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <code
class="t">yield</code></span></p>
<p><span class="prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <code
class="t">yield</code></span></p>
<div class="gp prod"><span class="nt">LabelIdentifier</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ul>
<li>
<p>It is a Syntax Error if the code matched by this production is contained in <a href="#sec-strict-mode-code">strict
code</a><var>.</var></p>
</li>
</ul>
<p><i>IdentifierReference</i><span style="font-family: sans-serif"><sub>[Yield]</sub> <b>:</b></span> <i>Identifier</i></p>
<p><i>BindingIdentifier</i><span style="font-family: sans-serif"><sub>[Yield]</sub> <b>:</b></span> <i>Identifier</i></p>
<p><i>LabelIdentifier</i><span style="font-family: sans-serif"><sub>[Yield]</sub> <b>:</b></span> <i>Identifier</i></p>
<ul>
<li>
<p>It is a Syntax Error if this production has a <sub>[Yield]</sub> parameter and StringValue of <span
class="nt">Identifier</span> is <code>"yield"</code>.</p>
</li>
</ul>
<div class="gp prod"><span class="nt">Identifier</span> <span class="geq">:</span> <span class="nt">IdentifierName</span> <span class="grhsmod">but not</span> <span class="nt">ReservedWord</span></div>
<ul>
<li>
<p>It is a Syntax Error if this phrase is contained in <a href="#sec-strict-mode-code">strict mode code</a> and the
StringValue of <span class="nt">IdentifierName</span> is: <code>"implements"</code>, <code>"interface"</code>,
<code>"let"</code>, <code>"package"</code>, <code>"private"</code>, <code>"protected"</code>, <code>"public"</code>,
<code>"static"</code>, or <code>"yield"</code>.</p>
</li>
<li>
<p>It is a Syntax Error if StringValue of <span class="nt">IdentifierName</span> is the same string value as the
StringValue of any <span class="nt">ReservedWord</span> except for <code>yield</code>.</p>
</li>
</ul>
<div class="note">
<p><span class="nh">NOTE</span> <span style="font-family: sans-serif">StringValue of</span> <i>IdentifierName</i>
normalizes any Unicode escape sequences in <i>IdentifierName</i> hence such escapes cannot be used to write an
<i>Identifier</i> whose code point sequence is the same as a <i>ReservedWord</i>.</p>
</div>
</section>
<section id="sec-identifiers-static-semantics-boundnames">
<h1><span class="secnum" id="sec-12.1.2"><a href="#sec-identifiers-static-semantics-boundnames"
title="link to this section">12.1.2</a></span> Static Semantics: BoundNames</h1>
<p>See also: <a href="#sec-let-and-const-declarations-static-semantics-boundnames">13.2.1.2</a>, <a
href="#sec-variable-statement-static-semantics-boundnames">13.2.2.1</a>, <a
href="#sec-destructuring-binding-patterns-static-semantics-boundnames">13.2.3.1</a>, <a
href="#sec-for-in-and-for-of-statements-static-semantics-boundnames">13.6.4.2</a>, <a
href="#sec-function-definitions-static-semantics-boundnames">14.1.3</a>, <a
href="#sec-arrow-function-definitions-static-semantics-boundnames">14.2.2</a>, <a
href="#sec-generator-function-definitions-static-semantics-boundnames">14.4.2</a>, <a
href="#sec-class-definitions-static-semantics-boundnames">14.5.2</a>, <a
href="#sec-imports-static-semantics-boundnames">15.2.2.2</a>, <a
href="#sec-exports-static-semantics-boundnames">15.2.3.2</a>.</p>
<div class="gp prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <span class="nt">Identifier</span></div>
<ol class="proc">
<li>Return a new <a href="#sec-list-and-record-specification-type">List</a> containing the StringValue of
<i>Identifier</i>.</li>
</ol>
<div class="gp prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ol class="proc">
<li>Return a new <a href="#sec-list-and-record-specification-type">List</a> containing <code>"yield"</code>.</li>
</ol>
</section>
<section id="sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.1.3"><a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.1.3</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <span class="nt">Identifier</span></div>
<ol class="proc">
<li>If this <i>IdentifierReference</i> is contained in <a href="#sec-strict-mode-code">strict mode code</a> and
StringValue of <i>Identifier</i> is <code>"eval"</code> or <code>"arguments"</code>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
<div class="gp prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-identifiers-static-semantics-stringvalue">
<h1><span class="secnum" id="sec-12.1.4"><a href="#sec-identifiers-static-semantics-stringvalue"
title="link to this section">12.1.4</a></span> Static Semantics<span style="font-family: sans-serif">:</span>
<i>StringValue</i></h1>
<p>See also: <a href="#sec-identifier-names-static-semantics-stringvalue">11.6.1.2</a>, <a
href="#sec-string-literals-static-semantics-stringvalue">11.8.4.2</a>.</p>
<p><span class="prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <code
class="t">yield</code></span></p>
<p><span class="prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <code
class="t">yield</code></span></p>
<div class="gp prod"><span class="nt">LabelIdentifier</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ol class="proc">
<li>Return <code>"yield"</code>.</li>
</ol>
<div class="gp prod"><span class="nt">Identifier</span> <span class="geq">:</span> <span class="nt">IdentifierName</span> <span class="grhsmod">but not</span> <span class="nt">ReservedWord</span></div>
<ol class="proc">
<li>Return the StringValue of <i>IdentifierName</i>.</li>
</ol>
</section>
<section id="sec-identifiers-runtime-semantics-bindinginitialization">
<div class="front">
<h1><span class="secnum" id="sec-12.1.5"><a href="#sec-identifiers-runtime-semantics-bindinginitialization"
title="link to this section">12.1.5</a></span> Runtime Semantics: BindingInitialization</h1>
<p>With arguments <var>value</var> and <var>environment</var>.</p>
<p>See also: <a href="#sec-destructuring-binding-patterns-runtime-semantics-bindinginitialization">13.2.3.5</a>, <a
href="#sec-for-in-and-for-of-statements-runtime-semantics-bindinginitialization">13.6.4.9</a>.</p>
<div class="note">
<p><span class="nh">NOTE</span> <b>undefined</b> is passed for <var>environment</var> to indicate that a <a
href="#sec-putvalue">PutValue</a> operation should be used to assign the initialization value. This is the case for
<code>var</code> statements and formal parameter lists of some non-strict functions (See <a
href="#sec-functiondeclarationinstantiation">9.2.12</a>). In those cases a lexical binding is hoisted and preinitialized
prior to evaluation of its initializer.</p>
</div>
<div class="gp prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <span class="nt">Identifier</span></div>
<ol class="proc">
<li>Let <i>name</i> be StringValue of <i>Identifier</i>.</li>
<li>Return <a href="#sec-initializeboundname">InitializeBoundName</a>( <i>name</i>, <i>value</i>,
<i>environment</i>).</li>
</ol>
<div class="gp prod"><span class="nt">BindingIdentifier</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ol class="proc">
<li>Return <a href="#sec-initializeboundname">InitializeBoundName</a>(<code>"yield"</code>, <i>value</i>,
<i>environment</i>).</li>
</ol>
</div>
<section id="sec-initializeboundname">
<h1><span class="secnum" id="sec-12.1.5.1"><a href="#sec-initializeboundname"
title="link to this section">12.1.5.1</a></span> Runtime Semantics: InitializeBoundName(name, value, environment)</h1>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>name</i>) is String.</li>
<li>If <i>environment</i> is not <b>undefined</b>, then
<ol class="block">
<li>Let <i>env</i> be the EnvironmentRecord component of <i>environment</i>.</li>
<li>Perform <i>env</i>.InitializeBinding(<i>name</i>, <i>value</i>).</li>
<li>Return <a href="#sec-normalcompletion">NormalCompletion</a>(<b>undefined</b>).</li>
</ol>
</li>
<li>Else
<ol class="block">
<li>Let <i>lhs</i> be <a href="#sec-resolvebinding">ResolveBinding</a>(<i>name</i>).</li>
<li>Return <a href="#sec-putvalue">PutValue</a>(<i>lhs</i>, <i>value</i>).</li>
</ol>
</li>
</ol>
</section>
</section>
<section id="sec-identifiers-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.1.6"><a href="#sec-identifiers-runtime-semantics-evaluation"
title="link to this section">12.1.6</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <span class="nt">Identifier</span></div>
<ol class="proc">
<li>Return <a href="#sec-resolvebinding">ResolveBinding</a>(StringValue of <i>Identifier</i>).</li>
</ol>
<div class="gp prod"><span class="nt">IdentifierReference</span> <span class="geq">:</span> <code class="t">yield</code></div>
<ol class="proc">
<li>Return <a href="#sec-resolvebinding">ResolveBinding</a>(<code>"yield"</code>).</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1:</span> The result of evaluating an <i>IdentifierReference</i> is always a value of type <a
href="#sec-reference-specification-type">Reference</a>.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2:</span> In non-<a href="#sec-strict-mode-code">strict code</a>, the keyword <code>yield</code>
may be used as an identifier. Evaluating the <i>IdentifierReference</i> production resolves the binding of
<code>yield</code> as if it was an <i>Identifier</i>. Early Error restriction ensures that such an evaluation only can
occur for non-<a href="#sec-strict-mode-code">strict code</a>. See <a href="#sec-let-and-const-declarations">13.2.1</a>
for the handling of <code>yield</code> in binding creation contexts.</p>
</div>
</section>
</section>
<section id="sec-primary-expression">
<div class="front">
<h1><span class="secnum" id="sec-12.2"><a href="#sec-primary-expression" title="link to this section">12.2</a></span>
Primary Expression</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">PrimaryExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">this</code></div>
<div class="rhs"><span class="nt">IdentifierReference</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">Literal</span></div>
<div class="rhs"><span class="nt">ArrayLiteral</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">ObjectLiteral</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">FunctionExpression</span></div>
<div class="rhs"><span class="nt">ClassExpression</span></div>
<div class="rhs"><span class="nt">GeneratorExpression</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
<div class="rhs"><span class="nt">TemplateLiteral</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">(</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">)</code></div>
<div class="rhs"><code class="t">(</code> <code class="t">)</code></div>
<div class="rhs"><code class="t">(</code> <code class="t">...</code> <span class="nt">BindingIdentifier</span><sub class="g-params">[?Yield]</sub> <code class="t">)</code></div>
<div class="rhs"><code class="t">(</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">,</code> <code class="t">...</code> <span class="nt">BindingIdentifier</span><sub class="g-params">[?Yield]</sub> <code class="t">)</code></div>
</div>
<h2>Supplemental Syntax</h2>
<p>When processing the production</p>
<p><span class="nt">PrimaryExpression</span><sub>[Yield]</sub> <b>:</b> <span
class="nt">CoverParenthesizedExpressionAndArrowParameterList</span><sub>[?Yield]</sub><span style="font-family: Times New
Roman"><i><br></i></span>the interpretation of <span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span> is
refined using the following grammar:</p>
<div class="gp">
<div class="lhs"><span class="nt">ParenthesizedExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">(</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">)</code></div>
</div>
</div>
<section id="sec-primary-expression-semantics">
<div class="front">
<h1><span class="secnum" id="sec-12.2.0"><a href="#sec-primary-expression-semantics"
title="link to this section">12.2.0</a></span> Semantics</h1>
</div>
<section id="sec-static-semantics-coveredparenthesizedexpression">
<h1><span class="secnum" id="sec-12.2.0.1"><a href="#sec-static-semantics-coveredparenthesizedexpression"
title="link to this section">12.2.0.1</a></span> Static Semantics: CoveredParenthesizedExpression</h1>
<div class="gp prod"><span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span> <code class="t">(</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">)</code></div>
<ol class="proc">
<li>Return the result of parsing the lexical token stream matched by
<i>CoverParenthesizedExpressionAndArrowParameterList</i><sub>[Yield]</sub> using either
<i>ParenthesizedExpression</i> or <i>ParenthesizedExpression</i><sub>[Yield]</sub> as the goal symbol depending upon
whether the <sub>[Yield]</sub> grammar parameter was present when
<i>CoverParenthesizedExpressionAndArrowParameterList was matched.</i></li>
</ol>
</section>
<section id="sec-semantics-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.2.0.2"><a href="#sec-semantics-static-semantics-isfunctiondefinition"
title="link to this section">12.2.0.2</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-grouping-operator-static-semantics-isfunctiondefinition">12.2.9.2</a>, <a
href="#sec-static-semantics-static-semantics-isfunctiondefinition">12.3.1.2</a>, <a
href="#sec-postfix-expressions-static-semantics-isfunctiondefinition">12.4.2</a>, <a
href="#sec-unary-operators-static-semantics-isfunctiondefinition">12.5.2</a>, <a
href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition">12.6.1</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">PrimaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">this</code></div>
<div class="rhs"><span class="nt">IdentifierReference</span></div>
<div class="rhs"><span class="nt">Literal</span></div>
<div class="rhs"><span class="nt">ArrayLiteral</span></div>
<div class="rhs"><span class="nt">ObjectLiteral</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
<div class="rhs"><span class="nt">TemplateLiteral</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span></div>
<ol class="proc">
<li>Let <i>expr</i> be CoveredParenthesizedExpression of <i>CoverParenthesizedExpressionAndArrowParameterList</i>.</li>
<li>Return IsFunctionDefinition of <i>expr</i>.</li>
</ol>
</section>
<section id="sec-semantics-static-semantics-isidentifierref">
<h1><span class="secnum" id="sec-12.2.0.3"><a href="#sec-semantics-static-semantics-isidentifierref"
title="link to this section">12.2.0.3</a></span> Static Semantics: IsIdentifierRef</h1>
<p>See also: <a href="#sec-static-semantics-static-semantics-isidentifierref">12.3.1.4</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">PrimaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">IdentifierReference</span></div>
</div>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
<div class="gp">
<div class="lhs"><span class="nt">PrimaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">this</code></div>
<div class="rhs"><span class="nt">Literal</span></div>
<div class="rhs"><span class="nt">ArrayLiteral</span></div>
<div class="rhs"><span class="nt">ObjectLiteral</span></div>
<div class="rhs"><span class="nt">FunctionExpression</span></div>
<div class="rhs"><span class="nt">ClassExpression</span></div>
<div class="rhs"><span class="nt">GeneratorExpression</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
<div class="rhs"><span class="nt">TemplateLiteral</span></div>
<div class="rhs"><span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-semantics-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.2.0.4"><a href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.2.0.4</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">PrimaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">this</code></div>
<div class="rhs"><span class="nt">Literal</span></div>
<div class="rhs"><span class="nt">ArrayLiteral</span></div>
<div class="rhs"><span class="nt">ObjectLiteral</span></div>
<div class="rhs"><span class="nt">FunctionExpression</span></div>
<div class="rhs"><span class="nt">ClassExpression</span></div>
<div class="rhs"><span class="nt">GeneratorExpression</span></div>
<div class="rhs"><span class="nt">RegularExpressionLiteral</span></div>
<div class="rhs"><span class="nt">TemplateLiteral</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span></div>
<ol class="proc">
<li>Let <i>expr</i> be CoveredParenthesizedExpression of <i>CoverParenthesizedExpressionAndArrowParameterList</i>.</li>
<li>Return IsValidSimpleAssignmentTarget of <i>expr</i>.</li>
</ol>
</section>
</section>
<section id="sec-this-keyword">
<div class="front">
<h1><span class="secnum" id="sec-12.2.1"><a href="#sec-this-keyword" title="link to this section">12.2.1</a></span> The
<code>this</code> Keyword</h1>
</div>
<section id="sec-this-keyword-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.1.1"><a href="#sec-this-keyword-runtime-semantics-evaluation"
title="link to this section">12.2.1.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <code class="t">this</code></div>
<ol class="proc">
<li>Return <a href="#sec-resolvethisbinding">ResolveThisBinding</a>( ) .</li>
</ol>
</section>
</section>
<section id="sec-identifier-reference">
<h1><span class="secnum" id="sec-12.2.2"><a href="#sec-identifier-reference" title="link to this section">12.2.2</a></span>
Identifier Reference</h1>
<p>See <a href="#sec-identifiers">12.1</a> for <span class="nt">IdentifierReference</span>.</p>
</section>
<section id="sec-primary-expression-literals">
<div class="front">
<h1><span class="secnum" id="sec-12.2.3"><a href="#sec-primary-expression-literals"
title="link to this section">12.2.3</a></span> Literals</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">Literal</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">NullLiteral</span></div>
<div class="rhs"><span class="nt">BooleanLiteral</span></div>
<div class="rhs"><span class="nt">NumericLiteral</span></div>
<div class="rhs"><span class="nt">StringLiteral</span></div>
</div>
</div>
<section id="sec-literals-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.3.1"><a href="#sec-literals-runtime-semantics-evaluation"
title="link to this section">12.2.3.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">Literal</span> <span class="geq">:</span> <span class="nt">NullLiteral</span></div>
<ol class="proc">
<li>Return <b>null</b>.</li>
</ol>
<div class="gp prod"><span class="nt">Literal</span> <span class="geq">:</span> <span class="nt">BooleanLiteral</span></div>
<ol class="proc">
<li>Return <b>false</b> if <i>BooleanLiteral</i> is the token <code>false</code>.</li>
<li>Return <b>true</b> if <i>BooleanLiteral</i> is the token <code>true</code>.</li>
</ol>
<div class="gp prod"><span class="nt">Literal</span> <span class="geq">:</span> <span class="nt">NumericLiteral</span></div>
<ol class="proc">
<li>Return the number whose value is MV of <i>NumericLiteral</i> as defined in <a
href="#sec-literals-numeric-literals">11.8.3</a>.</li>
</ol>
<div class="gp prod"><span class="nt">Literal</span> <span class="geq">:</span> <span class="nt">StringLiteral</span></div>
<ol class="proc">
<li>Return the StringValue of <i>StringLiteral</i> as defined in <a
href="#sec-string-literals-static-semantics-stringvalue">11.8.4.2</a>.</li>
</ol>
</section>
</section>
<section id="sec-array-initializer">
<div class="front">
<h1><span class="secnum" id="sec-12.2.4"><a href="#sec-array-initializer" title="link to this section">12.2.4</a></span>
Array Initializer</h1>
<div class="note">
<p><span class="nh">NOTE</span> An <i>ArrayLiteral</i> is an expression describing the initialization of an Array
object, using a list, of zero or more expressions each of which represents an array element, enclosed in square
brackets. The elements need not be literals; they are evaluated each time the array initializer is evaluated.</p>
</div>
<p>Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list
is not preceded by an <span class="nt">AssignmentExpression</span> (i.e., a comma at the beginning or after another
comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements.
Elided array elements are not defined. If an element is elided at the end of an array, that element does not contribute to
the length of the Array.</p>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">ArrayLiteral</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">[</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <code class="t">]</code></div>
<div class="rhs"><code class="t">[</code> <span class="nt">ElementList</span><sub class="g-params">[?Yield]</sub> <code class="t">]</code></div>
<div class="rhs"><code class="t">[</code> <span class="nt">ElementList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <code class="t">]</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ElementList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">SpreadElement</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">ElementList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">ElementList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">SpreadElement</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">Elision</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">,</code></div>
<div class="rhs"><span class="nt">Elision</span> <code class="t">,</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SpreadElement</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">...</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
</div>
</div>
<section id="sec-static-semantics-elisionwidth">
<h1><span class="secnum" id="sec-12.2.4.1"><a href="#sec-static-semantics-elisionwidth"
title="link to this section">12.2.4.1</a></span> Static Semantics: ElisionWidth</h1>
<div class="gp prod"><span class="nt">Elision</span> <span class="geq">:</span> <code class="t">,</code></div>
<ol class="proc">
<li>Return the numeric value 1.</li>
</ol>
<div class="gp prod"><span class="nt">Elision</span> <span class="geq">:</span> <span class="nt">Elision</span> <code class="t">,</code></div>
<ol class="proc">
<li>Let <i>preceding</i> be the ElisionWidth of <i>Elision</i>.</li>
<li>Return <i>preceding</i>+1.</li>
</ol>
</section>
<section id="sec-runtime-semantics-arrayaccumulation">
<h1><span class="secnum" id="sec-12.2.4.2"><a href="#sec-runtime-semantics-arrayaccumulation"
title="link to this section">12.2.4.2</a></span> Runtime Semantics: ArrayAccumulation</h1>
<p>With parameters <var>array</var> and <var>nextIndex</var>.</p>
<div class="gp prod"><span class="nt">ElementList</span> <span class="geq">:</span> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>padding</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Let <i>initResult</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>initValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>initResult</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>initValue</i>).</li>
<li>Let <i>created</i> be <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>array</i>, <a
href="#sec-tostring">ToString</a>(<a href="#sec-touint32">ToUint32</a>(<i>nextIndex+padding</i>)),
<i>initValue</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>created</i> is <b>true</b><i>.</i></li>
<li>Return <i>nextIndex+padding+</i>1.</li>
</ol>
<div class="gp prod"><span class="nt">ElementList</span> <span class="geq">:</span> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">SpreadElement</span></div>
<ol class="proc">
<li>Let <i>padding</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Return the result of performing ArrayAccumulation for <i>SpreadElement</i> with arguments <i>array</i> and
<i>nextIndex</i>+<i>padding</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ElementList</span> <span class="geq">:</span> <span class="nt">ElementList</span> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>postIndex</i> be the result of performing ArrayAccumulation for <i>ElementList</i> with arguments
<i>array</i> and <i>nextIndex</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>postIndex</i>).</li>
<li>Let <i>padding</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Let <i>initResult</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>initValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>initResult</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>initValue</i>).</li>
<li>Let <i>created</i> be <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>array</i>, <a
href="#sec-tostring">ToString</a>(<a href="#sec-touint32">ToUint32</a>(<i>postIndex</i>+<i>padding</i>)),
<i>initValue</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>created</i> is <b>true</b>.</li>
<li>Return <i>postIndex</i>+<i>padding+</i>1.</li>
</ol>
<div class="gp prod"><span class="nt">ElementList</span> <span class="geq">:</span> <span class="nt">ElementList</span> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <span class="nt">SpreadElement</span></div>
<ol class="proc">
<li>Let <i>postIndex</i> be the result of performing ArrayAccumulation for <i>ElementList</i> with arguments
<i>array</i> and <i>nextIndex</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>postIndex</i>).</li>
<li>Let <i>padding</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Return the result of performing ArrayAccumulation for <i>SpreadElement</i> with arguments <i>array</i> and
<i>postIndex</i>+<i>padding</i>.</li>
</ol>
<div class="gp prod"><span class="nt">SpreadElement</span> <span class="geq">:</span> <code class="t">...</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>spreadRef</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>spreadObj</i> be <a href="#sec-getvalue">GetValue</a>(<i>spreadRef</i>).</li>
<li>Let <i>iterator</i> be <a href="#sec-getiterator">GetIterator</a>(<i>spreadObj</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>iterator</i>).</li>
<li>Repeat
<ol class="block">
<li>Let <i>next</i> be <a href="#sec-iteratorstep">IteratorStep</a>(<i>iterator</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>next</i>).</li>
<li>If <i>next</i> is <b>false</b>, return <i>nextIndex</i>.</li>
<li>Let <i>nextValue</i> be <a href="#sec-iteratorvalue">IteratorValue</a>(<i>next</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>nextValue</i>).</li>
<li>Let <i>status</i> be <a href="#sec-createdataproperty">CreateDataProperty</a>(<i>array</i>, <a
href="#sec-tostring">ToString</a>(<i>nextIndex</i>), <i>nextValue</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>status</i> is <b>true</b> .</li>
<li>Let <i>nextIndex</i> be <i>nextIndex</i> + 1.</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> <a href="#sec-createdataproperty">CreateDataProperty</a> is used to ensure that own
properties are defined for the array even if the standard built-in Array prototype object has been modified in a manner
that would preclude the creation of new own properties using [[Set]].</p>
</div>
</section>
<section id="sec-array-initializer-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.4.3"><a href="#sec-array-initializer-runtime-semantics-evaluation"
title="link to this section">12.2.4.3</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">ArrayLiteral</span> <span class="geq">:</span> <code class="t">[</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>array</i> be <a href="#sec-arraycreate">ArrayCreate</a>(0).</li>
<li>Let <i>pad</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Perform <a href="#sec-set-o-p-v-throw">Set</a>(<i>array</i>, <code>"length"</code>, <i>pad</i>, <b>false</b>).</li>
<li>NOTE: The above Set cannot fail because of the nature of the object returned by <a
href="#sec-arraycreate">ArrayCreate</a>.</li>
<li>Return <i>array</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ArrayLiteral</span> <span class="geq">:</span> <code class="t">[</code> <span class="nt">ElementList</span> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>array</i> be <a href="#sec-arraycreate">ArrayCreate</a>(0).</li>
<li>Let <i>len</i> be the result of performing ArrayAccumulation for <i>ElementList</i> with arguments <i>array</i> and
0.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>len</i>).</li>
<li>Perform <a href="#sec-set-o-p-v-throw">Set</a>(<i>array</i>, <code>"length"</code>, <i>len</i>, <b>false</b>).</li>
<li>NOTE: The above Set cannot fail because of the nature of the object returned by <a
href="#sec-arraycreate">ArrayCreate</a>.</li>
<li>Return <i>array</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ArrayLiteral</span> <span class="geq">:</span> <code class="t">[</code> <span class="nt">ElementList</span> <code class="t">,</code> <span class="nt">Elision</span><sub class="g-opt">opt</sub> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>array</i> be <a href="#sec-arraycreate">ArrayCreate</a>(0).</li>
<li>Let <i>len</i> be the result of performing ArrayAccumulation for <i>ElementList</i> with arguments <i>array</i> and
0.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>len</i>).</li>
<li>Let <i>padding</i> be the ElisionWidth of <i>Elision</i>; if <i>Elision</i> is not present, use the numeric value
zero.</li>
<li>Perform <a href="#sec-set-o-p-v-throw">Set</a>(<i>array</i>, <code>"length"</code>, <a
href="#sec-touint32">ToUint32</a>(<i>padding</i>+<i>len</i>), <b>false</b>).</li>
<li>NOTE: The above Set cannot fail because of the nature of the object returned by <a
href="#sec-arraycreate">ArrayCreate</a>.</li>
<li>Return <i>array</i>.</li>
</ol>
</section>
</section>
<section id="sec-object-initializer">
<div class="front">
<h1><span class="secnum" id="sec-12.2.5"><a href="#sec-object-initializer" title="link to this section">12.2.5</a></span>
Object Initializer</h1>
<div class="note">
<p><span class="nh">NOTE 1</span> An object initializer is an expression describing the initialization of an Object,
written in a form resembling a literal. It is a list of zero or more pairs of property keys and associated values,
enclosed in curly brackets. The values need not be literals; they are evaluated each time the object initializer is
evaluated.</p>
</div>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">ObjectLiteral</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">{</code> <code class="t">}</code></div>
<div class="rhs"><code class="t">{</code> <span class="nt">PropertyDefinitionList</span><sub class="g-params">[?Yield]</sub> <code class="t">}</code></div>
<div class="rhs"><code class="t">{</code> <span class="nt">PropertyDefinitionList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <code class="t">}</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">PropertyDefinitionList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">PropertyDefinition</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">PropertyDefinitionList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <span class="nt">PropertyDefinition</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">PropertyDefinition</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">IdentifierReference</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">CoverInitializedName</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">PropertyName</span><sub class="g-params">[?Yield]</sub> <code class="t">:</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">MethodDefinition</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">PropertyName</span><sub class="g-params">[Yield,GeneratorParameter]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LiteralPropertyName</span></div>
<div class="rhs"><span class="grhsannot">[+GeneratorParameter]</span> <span class="nt">ComputedPropertyName</span></div>
<div class="rhs"><span class="grhsannot">[~GeneratorParameter]</span> <span class="nt">ComputedPropertyName</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">StringLiteral</span></div>
<div class="rhs"><span class="nt">NumericLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ComputedPropertyName</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">[</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">]</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">CoverInitializedName</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">IdentifierReference</span><sub class="g-params">[?Yield]</sub> <span class="nt">Initializer</span><sub class="g-params">[In, ?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">Initializer</span><sub class="g-params">[In, Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">=</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[?In, ?Yield]</sub></div>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> <i>MethodDefinition</i> is defined in <a href="#sec-method-definitions">14.3</a>.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 3</span> In certain contexts, <i>ObjectLiteral</i> is used as a cover grammar for a more
restricted secondary grammar. The <i>CoverInitializedName</i> production is necessary to fully cover these secondary
grammars. However, use of this production results in an early Syntax Error in normal contexts where an actual
<i>ObjectLiteral</i> is expected.</p>
</div>
</div>
<section id="sec-object-initializer-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.2.5.1"><a href="#sec-object-initializer-static-semantics-early-errors"
title="link to this section">12.2.5.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">MethodDefinition</span></div>
<ul>
<li>It is a Syntax Error if HasDirectSuper of <span class="nt">MethodDefinition</span> is <span style="font-family:
Times New Roman"><b><i>true</i></b></span>.</li>
</ul>
<p>In addition to describing an actual object initializer the <span class="nt">ObjectLiteral</span> productions are also
used as a cover grammar for <span class="nt">ObjectAssignmentPattern</span> (<a
href="#sec-destructuring-assignment">12.14.5</a>). and may be recognized as part of a <span
class="nt">CoverParenthesizedExpressionAndArrowParameterList</span>. When <span class="nt">ObjectLiteral</span> appears in
a context where <span class="nt">ObjectAssignmentPattern</span> is required the following Early Error rules are <b>not</b>
applied. In addition, they are not applied when initially parsing a
<var>CoverParenthesizedExpressionAndArrowParameterList.</var></p>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">CoverInitializedName</span></div>
<ul>
<li>Always throw a Syntax Error if code matches <span style="font-family: Times New Roman">this production.</span></li>
</ul>
<div class="note">
<p><span class="nh">NOTE</span> This production exists so that <i>ObjectLiteral</i> can serve as a cover grammar for
<i>ObjectAssignmentPattern</i> (<a href="#sec-destructuring-assignment">12.14.5</a>). It cannot occur in an actual
object initializer.</p>
</div>
</section>
<section id="sec-object-initializer-static-semantics-computedpropertycontains">
<h1><span class="secnum" id="sec-12.2.5.2"><a href="#sec-object-initializer-static-semantics-computedpropertycontains"
title="link to this section">12.2.5.2</a></span> Static Semantics: ComputedPropertyContains</h1>
<p>With parameter <var>symbol</var>.</p>
<p>See also: <a href="#sec-method-definitions-static-semantics-computedpropertycontains">14.3.2</a>, <a
href="#sec-generator-function-definitions-static-semantics-computedpropertycontains">14.4.3</a>, <a
href="#sec-class-definitions-static-semantics-computedpropertycontains">14.5.5</a>.</p>
<div class="gp prod"><span class="nt">PropertyName</span> <span class="geq">:</span> <span class="nt">LiteralPropertyName</span></div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyName</span> <span class="geq">:</span> <span class="nt">ComputedPropertyName</span></div>
<ol class="proc">
<li>Return the result of <i>ComputedPropertyName</i> Contains <i>symbol</i>.</li>
</ol>
</section>
<section id="sec-object-initializer-static-semantics-contains">
<h1><span class="secnum" id="sec-12.2.5.3"><a href="#sec-object-initializer-static-semantics-contains"
title="link to this section">12.2.5.3</a></span> Static Semantics: Contains</h1>
<p>With parameter <var>symbol</var>.</p>
<p>See also: <a href="#sec-static-semantic-rules">5.3</a>, <a
href="#sec-static-semantics-static-semantics-contains">12.3.1.1</a>, <a
href="#sec-function-definitions-static-semantics-contains">14.1.4</a>, <a
href="#sec-arrow-function-definitions-static-semantics-contains">14.2.3</a>, <a
href="#sec-generator-function-definitions-static-semantics-contains">14.4.4</a>, <a
href="#sec-class-definitions-static-semantics-contains">14.5.4</a>.</p>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">MethodDefinition</span></div>
<ol class="proc">
<li>If <i>symbol</i> is <i>MethodDefinition</i>, return <b>true</b>.</li>
<li>Return the result of ComputedPropertyContains for <i>MethodDefinition</i> with argument <i>symbol</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> Static semantic rules that depend upon substructure generally do not look into function
definitions.</p>
</div>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>If <i>symbol</i> is a <i>ReservedWord</i>, return <b>false</b>.</li>
<li>If <i>symbol</i> is an <i>Identifier</i> and StringValue of <i>symbol</i> is the same value as the StringValue of
<i>IdentifierName</i>, return <b>true</b>;</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-object-initializer-static-semantics-hascomputedpropertykey">
<h1><span class="secnum" id="sec-12.2.5.4"><a href="#sec-object-initializer-static-semantics-hascomputedpropertykey"
title="link to this section">12.2.5.4</a></span> Static Semantics: HasComputedPropertyKey</h1>
<p>See also: <a href="#sec-method-definitions-static-semantics-hascomputedpropertykey">14.3.4</a>, <a
href="#sec-generator-function-definitions-static-semantics-hascomputedpropertykey">14.4.5</a></p>
<div class="gp prod"><span class="nt">PropertyDefinitionList</span> <span class="geq">:</span> <span class="nt">PropertyDefinitionList</span> <code class="t">,</code> <span class="nt">PropertyDefinition</span></div>
<ol class="proc">
<li>If HasComputedPropertyKey of <i>PropertyDefinitionList</i> is <b>true</b>, return <b>true</b>.</li>
<li>Return HasComputedPropertyKey of <i>PropertyDefinition</i>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">IdentifierReference</span></div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">PropertyName</span> <code class="t">:</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Return IsComputedPropertyKey of <i>PropertyName</i>.</li>
</ol>
</section>
<section id="sec-static-semantics-iscomputedpropertykey">
<h1><span class="secnum" id="sec-12.2.5.5"><a href="#sec-static-semantics-iscomputedpropertykey"
title="link to this section">12.2.5.5</a></span> Static Semantics: IsComputedPropertyKey</h1>
<div class="gp prod"><span class="nt">PropertyName</span> <span class="geq">:</span> <span class="nt">LiteralPropertyName</span></div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyName</span> <span class="geq">:</span> <span class="nt">ComputedPropertyName</span></div>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
</section>
<section id="sec-object-initializer-static-semantics-propname">
<h1><span class="secnum" id="sec-12.2.5.6"><a href="#sec-object-initializer-static-semantics-propname"
title="link to this section">12.2.5.6</a></span> Static Semantics: <i>PropName</i></h1>
<p>See also: <a href="#sec-method-definitions-static-semantics-propname">14.3.6</a>, <a
href="#sec-generator-function-definitions-static-semantics-propname">14.4.10</a>, <a
href="#sec-class-definitions-static-semantics-propname">14.5.12</a></p>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">IdentifierReference</span></div>
<ol class="proc">
<li>Return StringValue of <i>IdentifierReference</i>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">PropertyName</span> <code class="t">:</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Return PropName of <i>PropertyName</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>Return StringValue of <i>IdentifierName</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">StringLiteral</span></div>
<ol class="proc">
<li>Return a String value whose code units are the SV of the <i>StringLiteral</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">NumericLiteral</span></div>
<ol class="proc">
<li>Let <i>nbr</i> be the result of forming the value of the <i>NumericLiteral</i>.</li>
<li>Return <a href="#sec-tostring">ToString</a>(<i>nbr</i>).</li>
</ol>
<div class="gp prod"><span class="nt">ComputedPropertyName</span> <span class="geq">:</span> <code class="t">[</code> <span class="nt">AssignmentExpression</span> <code class="t">]</code></div>
<ol class="proc">
<li>Return <span style="font-family: sans-serif">empty</span>.</li>
</ol>
</section>
<section id="sec-static-semantics-propertynamelist">
<h1><span class="secnum" id="sec-12.2.5.7"><a href="#sec-static-semantics-propertynamelist"
title="link to this section">12.2.5.7</a></span> Static Semantics: PropertyNameList</h1>
<div class="gp prod"><span class="nt">PropertyDefinitionList</span> <span class="geq">:</span> <span class="nt">PropertyDefinition</span></div>
<ol class="proc">
<li>If PropName of <i>PropertyDefinition</i> is <span style="font-family: sans-serif">empty</span>, return a new empty
<a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Return a new <a href="#sec-list-and-record-specification-type">List</a> containing PropName of
<i>PropertyDefinition</i>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinitionList</span> <span class="geq">:</span> <span class="nt">PropertyDefinitionList</span> <code class="t">,</code> <span class="nt">PropertyDefinition</span></div>
<ol class="proc">
<li>Let <i>list</i> be PropertyNameList of <i>PropertyDefinitionList.</i></li>
<li>If PropName of <i>PropertyDefinition</i> is <span style="font-family: sans-serif">empty</span>, return
<i>list</i>.</li>
<li>Append PropName of <i>PropertyDefinition</i> to the end of <i>list</i>.</li>
<li>Return <i>list</i>.</li>
</ol>
</section>
<section id="sec-object-initializer-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.5.8"><a href="#sec-object-initializer-runtime-semantics-evaluation"
title="link to this section">12.2.5.8</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">ObjectLiteral</span> <span class="geq">:</span> <code class="t">{</code> <code class="t">}</code></div>
<ol class="proc">
<li>Return <a href="#sec-objectcreate">ObjectCreate</a>(<span style="font-family:
sans-serif">%ObjectPrototype%</span>).</li>
</ol>
<p><span class="prod"><span class="nt">ObjectLiteral</span> <span class="geq">:</span></span><br>	<code>{</code> <span
class="nt">PropertyDefinitionList</span> <code>}</code><span style="font-family: Times New
Roman"><i><br></i></span>	<code>{</code> <span class="nt">PropertyDefinitionList</span> <code>,</code>
<code>}</code></p>
<ol class="proc">
<li>Let <i>obj</i> be <a href="#sec-objectcreate">ObjectCreate</a>(%ObjectPrototype%).</li>
<li>Let <i>status</i> be the result of performing PropertyDefinitionEvaluation of <i>PropertyDefinitionList</i> with
arguments <i>obj</i> and <b>true</b>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <i>obj</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>Return StringValue of <i>IdentifierName</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">StringLiteral</span></div>
<ol class="proc">
<li>Return a String value whose code units are the SV of the <i>StringLiteral</i>.</li>
</ol>
<div class="gp prod"><span class="nt">LiteralPropertyName</span> <span class="geq">:</span> <span class="nt">NumericLiteral</span></div>
<ol class="proc">
<li>Let <i>nbr</i> be the result of forming the value of the <i>NumericLiteral</i>.</li>
<li>Return <a href="#sec-tostring">ToString</a>(<i>nbr</i>).</li>
</ol>
<div class="gp prod"><span class="nt">ComputedPropertyName</span> <span class="geq">:</span> <code class="t">[</code> <span class="nt">AssignmentExpression</span> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>exprValue</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>propName</i> be <a href="#sec-getvalue">GetValue</a>(<i>exprValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propName</i>).</li>
<li>Return <a href="#sec-topropertykey">ToPropertyKey</a>(<i>propName</i>).</li>
</ol>
</section>
<section id="sec-object-initializer-runtime-semantics-propertydefinitionevaluation">
<h1><span class="secnum" id="sec-12.2.5.9"><a
href="#sec-object-initializer-runtime-semantics-propertydefinitionevaluation"
title="link to this section">12.2.5.9</a></span> Runtime Semantics: PropertyDefinitionEvaluation</h1>
<p>With parameter <var>object</var> and <span style="font-family: Times New Roman"><i>enumerable</i>.</span></p>
<p>See also: <a href="#sec-method-definitions-runtime-semantics-propertydefinitionevaluation">14.3.9</a>, <a
href="#sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation">14.4.13</a>, B.3.1</p>
<div class="gp prod"><span class="nt">PropertyDefinitionList</span> <span class="geq">:</span> <span class="nt">PropertyDefinitionList</span> <code class="t">,</code> <span class="nt">PropertyDefinition</span></div>
<ol class="proc">
<li>Let <i>status</i> be the result of performing PropertyDefinitionEvaluation of <i>PropertyDefinitionList</i> with
arguments <i>object</i> and <i>enumerable</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return the result of performing PropertyDefinitionEvaluation of <i>PropertyDefinition</i> with arguments
<i>object</i> and <i>enumerable</i>.</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">IdentifierReference</span></div>
<ol class="proc">
<li>Let <i>propName</i> be StringValue of <i>IdentifierReference</i>.</li>
<li>Let <i>exprValue</i> be the result of evaluating <i>IdentifierReference</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>exprValue</i>).</li>
<li>Let <i>propValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>exprValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propValue</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>enumerable</i> is <b>true</b>.</li>
<li>Return <a href="#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a>(<i>object</i>, <i>propName</i>,
<i>propValue</i>).</li>
</ol>
<div class="gp prod"><span class="nt">PropertyDefinition</span> <span class="geq">:</span> <span class="nt">PropertyName</span> <code class="t">:</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>propKey</i> be the result of evaluating <i>PropertyName</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propKey</i>).</li>
<li>Let <i>exprValueRef</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>propValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>exprValueRef</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propValue</i>).</li>
<li>If <a href="#sec-isanonymousfunctiondefinition">IsAnonymousFunctionDefinition</a>(<i>AssignmentExpression)</i> is
<b>true</b>, then
<ol class="block">
<li>Let <i>hasNameProperty</i> be <a href="#sec-hasownproperty">HasOwnProperty</a>(<i>propValue</i>,
<code>"name"</code>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>hasNameProperty</i>).</li>
<li>If <i>hasNameProperty</i> is <b>false</b>, perform <a
href="#sec-setfunctionname">SetFunctionName</a>(<i>propValue</i>, <i>propKey</i>).</li>
</ol>
</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>enumerable</i> is <b>true</b>.</li>
<li>Return <a href="#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a>(<i>object</i>, <i>propKey</i>,
<i>propValue</i>).</li>
</ol>
<p class="Note"><i>NOTE	An alternative semantics for this production is given in <a
href="#sec-__proto__-property-names-in-object-initializers">B.3.1</a>.</i></p>
</section>
</section>
<section id="sec-function-defining-expressions">
<h1><span class="secnum" id="sec-12.2.6"><a href="#sec-function-defining-expressions"
title="link to this section">12.2.6</a></span> Function Defining Expressions</h1>
<p>See <a href="#sec-function-definitions">14.1</a> for <span class="prod"><span class="nt">PrimaryExpression</span> <span
class="geq">:</span> <span class="nt">FunctionExpression</span></span> .</p>
<p>See <a href="#sec-generator-function-definitions">14.4</a> for <span class="prod"><span
class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">GeneratorExpression</span></span> .</p>
<p>See <a href="#sec-class-definitions">14.5</a> for <span class="prod"><span class="nt">PrimaryExpression</span> <span
class="geq">:</span> <span class="nt">ClassExpression</span></span> .</p>
</section>
<section id="sec-primary-expression-regular-expression-literals">
<div class="front">
<h1><span class="secnum" id="sec-12.2.7"><a href="#sec-primary-expression-regular-expression-literals"
title="link to this section">12.2.7</a></span> Regular Expression Literals</h1>
<h2>Syntax</h2>
<p>See <a href="#sec-literals-string-literals">11.8.4</a>.</p>
</div>
<section id="sec-primary-expression-regular-expression-literals-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.2.7.1"><a
href="#sec-primary-expression-regular-expression-literals-static-semantics-early-errors"
title="link to this section">12.2.7.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">RegularExpressionLiteral</span></div>
<ul>
<li>
<p>It is a Syntax Error if <span style="font-family: Times New Roman">BodyText</span> of <span
class="nt">RegularExpressionLiteral</span> cannot be recognized using the goal symbol <span class="nt">Pattern</span>
of the ECMAScript RegExp grammar specified in <a href="#sec-patterns">21.2.1</a><var>.</var></p>
</li>
<li>
<p>It is a Syntax Error if <span style="font-family: Times New Roman">FlagText</span> of <span
class="nt">RegularExpressionLiteral</span> contains any code points other than <code>"g"</code>, <code>"i"</code>,
<code>"m"</code>, <code>"u"</code>, or <code>"y"</code>, or if it contains the same code point more than once.</p>
</li>
</ul>
</section>
<section id="sec-regular-expression-literals-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.7.2"><a href="#sec-regular-expression-literals-runtime-semantics-evaluation"
title="link to this section">12.2.7.2</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">RegularExpressionLiteral</span></div>
<ol class="proc">
<li>Let <i>pattern</i> be the string value consisting of the <a href="#sec-utf16encoding">UTF16Encoding</a> of each code
point of BodyText of <i>RegularExpressionLiteral</i>.</li>
<li>Let <i>flags</i> be the string value consisting of the <a href="#sec-utf16encoding">UTF16Encoding</a> of each code
point of FlagText of <i>RegularExpressionLiteral</i>.</li>
<li>Return <a href="#sec-regexpcreate">RegExpCreate</a>(<i>pattern</i>, <i>flags</i>).</li>
</ol>
</section>
</section>
<section id="sec-template-literals">
<div class="front">
<h1><span class="secnum" id="sec-12.2.8"><a href="#sec-template-literals" title="link to this section">12.2.8</a></span>
Template Literals</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">TemplateLiteral</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">NoSubstitutionTemplate</span></div>
<div class="rhs"><span class="nt">TemplateHead</span> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <span class="nt">TemplateSpans</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateSpans</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">TemplateTail</span></div>
<div class="rhs"><span class="nt">TemplateMiddleList</span><sub class="g-params">[?Yield]</sub> <span class="nt">TemplateTail</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">TemplateMiddleList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">TemplateMiddle</span> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">TemplateMiddleList</span><sub class="g-params">[?Yield]</sub> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub></div>
</div>
</div>
<section id="sec-static-semantics-templatestrings">
<h1><span class="secnum" id="sec-12.2.8.1"><a href="#sec-static-semantics-templatestrings"
title="link to this section">12.2.8.1</a></span> Static Semantics: TemplateStrings</h1>
<p>With parameter <var>raw</var>.</p>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">NoSubstitutionTemplate</span></div>
<ol class="proc">
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>string</i> be the TV of <i>NoSubstitutionTemplate</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>string</i> be the TRV of <i>NoSubstitutionTemplate</i>.</li>
</ol>
</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing the single element,
<i>string</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">TemplateHead</span> <span class="nt">Expression</span> <span class="nt">TemplateSpans</span></div>
<ol class="proc">
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>head</i> be the TV of <i>TemplateHead</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>head</i> be the TRV of <i>TemplateHead</i>.</li>
</ol>
</li>
<li>Let <i>tail</i> be TemplateStrings of <i>TemplateSpans</i> with argument <i>raw</i>.</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing <i>head</i> followed by the element,
in order of <i>tail</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>tail</i> be the TV of <i>TemplateTail</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>tail</i> be the TRV of <i>TemplateTail</i>.</li>
</ol>
</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing the single element, <i>tail</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>Let <i>middle</i> be TemplateStrings of <i>TemplateMiddleList</i> with argument <i>raw</i>.</li>
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>tail</i> be the TV of <i>TemplateTail</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>tail</i> be the TRV of <i>TemplateTail</i>.</li>
</ol>
</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing the elements, in order, of
<i>middle</i> followed by <i>tail</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>string</i> be the TV of <i>TemplateMiddle</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>string</i> be the TRV of <i>TemplateMiddle</i>.</li>
</ol>
</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing the single element,
<i>string</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>Let <i>front</i> be TemplateStrings of <i>TemplateMiddleList</i> with argument <i>raw</i>.</li>
<li>If <i>raw</i> is <b>false</b>, then
<ol class="block">
<li>Let <i>last</i> be the TV of <i>TemplateMiddle</i>.</li>
</ol>
</li>
<li>Else,
<ol class="block">
<li>Let <i>last</i> be the TRV of <i>TemplateMiddle</i>.</li>
</ol>
</li>
<li>Append <i>last</i> as the last element of the <a href="#sec-list-and-record-specification-type">List</a>
<i>front</i>.</li>
<li>Return <i>front</i>.</li>
</ol>
</section>
<section id="sec-template-literals-runtime-semantics-argumentlistevaluation">
<h1><span class="secnum" id="sec-12.2.8.2"><a href="#sec-template-literals-runtime-semantics-argumentlistevaluation"
title="link to this section">12.2.8.2</a></span> <span style="font-family: sans-serif">Runtime Semantics:</span>
ArgumentListEvaluation</h1>
<p>See also: <a href="#sec-argument-lists-runtime-semantics-argumentlistevaluation">12.3.6.1</a></p>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">NoSubstitutionTemplate</span></div>
<ol class="proc">
<li>Let <i>templateLiteral</i> be this <i>TemplateLiteral.</i></li>
<li>Let <i>siteObj</i> be <a href="#sec-gettemplateobject">GetTemplateObject</a>(<i>templateLiteral</i>).</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing the one element which is
<i>siteObj</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">TemplateHead</span> <span class="nt">Expression</span> <span class="nt">TemplateSpans</span></div>
<ol class="proc">
<li>Let <i>templateLiteral</i> be this <i>TemplateLiteral.</i></li>
<li>Let <i>siteObj</i> be <a href="#sec-gettemplateobject">GetTemplateObject</a>(<i>templateLiteral</i>).</li>
<li>Let <i>firstSub</i> be the result of evaluating <i>Expression</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>firstSub</i>).</li>
<li>Let <i>restSub</i> be SubstitutionEvaluation of <i>TemplateSpans</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>restSub</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>restSub</i> is a <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> whose first element is <i>siteObj</i>, whose
second elements is <i>firstSub</i>, and whose subsequent elements are the elements of <i>restSub</i>, in order.
<i>restSub</i> may contain no elements.</li>
</ol>
</section>
<section id="sec-gettemplateobject">
<h1><span class="secnum" id="sec-12.2.8.3"><a href="#sec-gettemplateobject"
title="link to this section">12.2.8.3</a></span> Runtime Semantics: GetTemplateObject ( templateLiteral )</h1>
<p>The abstract operation <span style="font-family: Times New Roman">GetTemplateObject</span> is called with a grammar
production, <var>templateLiteral</var>, as an argument. It performs the following steps:</p>
<ol class="proc">
<li>Let <i>rawStrings</i> be TemplateStrings of <i>templateLiteral</i> with argument <b>true</b>.</li>
<li>Let <i>ctx</i> be <a href="#sec-execution-contexts">the running execution context</a>.</li>
<li>Let <i>realm</i> be the <i>ctx</i>’s <a href="#sec-code-realms">Realm</a>.</li>
<li>Let <i>templateRegistry</i> be <i>realm</i>.[[templateMap]].</li>
<li>For each element <i>e</i> of <i>templateRegistry</i>, do
<ol class="block">
<li>If <i>e</i>.[[strings]] and <i>rawStrings</i> contain the same values in the same order, then
<ol class="block">
<li>Return <i>e.</i>[[array]].</li>
</ol>
</li>
</ol>
</li>
<li>Let <i>cookedStrings</i> be TemplateStrings of <i>templateLiteral</i> with argument <b>false</b>.</li>
<li>Let <i>count</i> be the number of elements in the <a href="#sec-list-and-record-specification-type">List</a>
<i>cookedStrings</i>.</li>
<li>Let <i>template</i> be <a href="#sec-arraycreate">ArrayCreate</a>(<i>count</i>).</li>
<li>Let <i>rawObj</i> be <a href="#sec-arraycreate">ArrayCreate</a>(<i>count</i>).</li>
<li>Let <i>index</i> be 0.</li>
<li>Repeat while <i>index</i> < <i>count</i>
<ol class="block">
<li>Let <i>prop</i> be <a href="#sec-tostring">ToString</a>(<i>index</i>).</li>
<li>Let <i>cookedValue</i> be the string value <i>cookedStrings</i>[<i>index</i>].</li>
<li><a href="#sec-call">Call</a> <i>template</i>.[[DefineOwnProperty]](<i>prop</i>, PropertyDescriptor{[[Value]]:
<i>cookedValue</i>, [[Enumerable]]: <b>true</b>, [[Writable]]: <b>false</b>, [[Configurable]]:
<b>false</b>})<i>.</i></li>
<li>Let <i>rawValue</i> be the string value <i>rawStrings</i>[<i>index</i>].</li>
<li><a href="#sec-call">Call</a> <i>rawObj</i>.[[DefineOwnProperty]](<i>prop</i>, PropertyDescriptor{[[Value]]:
<i>rawValue</i>, [[Enumerable]]: <b>true</b>, [[Writable]]: <b>false</b>, [[Configurable]]:
<b>false</b>})<i>.</i></li>
<li>Let <i>index</i> be <i>index</i>+1.</li>
</ol>
</li>
<li>Perform <a href="#sec-setintegritylevel">SetIntegrityLevel</a>(<i>rawObj</i>, <code>"frozen"</code>).</li>
<li><a href="#sec-call">Call</a> <i>template</i>.[[DefineOwnProperty]](<code>"raw"</code>, PropertyDescriptor{[[Value]]:
<i>rawObj</i>, [[Writable]]: <b>false</b>, [[Enumerable]]: <b>false</b>, [[Configurable]]:
<b>false</b>})<i>.</i></li>
<li>Perform <a href="#sec-setintegritylevel">SetIntegrityLevel</a>(<i>template</i>, <code>"frozen"</code>).</li>
<li>Append the Record{[[strings]]: <i>rawStrings</i>, [[array]]: <i>template</i>} to <i>templateRegistry</i>.</li>
<li>Return <i>template</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE 1</span> The creation of a template object cannot result in an <a
href="#sec-completion-record-specification-type">abrupt completion</a>.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 2</span> Each <i>TemplateLiteral</i> in the program code of a <a
href="#sec-code-realms">Realm</a> is associated with a unique template object that is used in the evaluation of tagged
Templates (<a href="#sec-template-literals-runtime-semantics-evaluation">12.2.8.5</a>). The template objects are frozen
and the same template object is used each time a specific tagged Template is evaluated. Whether template objects are
created lazily upon first evaluation of the <i>TemplateLiteral</i> or eagerly prior to first evaluation is an
implementation choice that is not observable to ECMAScript code.</p>
</div>
<div class="note">
<p><span class="nh">NOTE 3</span> Future editions of this specification may define additional non-enumerable properties
of template objects.</p>
</div>
</section>
<section id="sec-runtime-semantics-substitutionevaluation">
<h1><span class="secnum" id="sec-12.2.8.4"><a href="#sec-runtime-semantics-substitutionevaluation"
title="link to this section">12.2.8.4</a></span> Runtime Semantics: SubstitutionEvaluation</h1>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>Return an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>Return the result of SubstitutionEvaluation of <i>TemplateMiddleList</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>Let <i>sub</i> be the result of evaluating <i>Expression</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>sub</i>).</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> containing only <i>sub</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>Let <i>preceding</i> be the result of SubstitutionEvaluation of <i>TemplateMiddleList</i> .</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>preceding</i>).</li>
<li>Let <i>next</i> be the result of evaluating <i>Expression</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>next</i>).</li>
<li>Append <i>next</i> as the last element of the <a href="#sec-list-and-record-specification-type">List</a>
<i>preceding</i>.</li>
<li>Return <i>preceding</i>.</li>
</ol>
</section>
<section id="sec-template-literals-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.8.5"><a href="#sec-template-literals-runtime-semantics-evaluation"
title="link to this section">12.2.8.5</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">NoSubstitutionTemplate</span></div>
<ol class="proc">
<li>Return the string value whose code units are the elements of the TV of <i>NoSubstitutionTemplate</i> as defined in
<a href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateLiteral</span> <span class="geq">:</span> <span class="nt">TemplateHead</span> <span class="nt">Expression</span> <span class="nt">TemplateSpans</span></div>
<ol class="proc">
<li>Let <i>head</i> be the TV of <i>TemplateHead</i> as defined in <a
href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
<li>Let <i>sub</i> be the result of evaluating <i>Expression</i>.</li>
<li>Let <i>middle</i> be <a href="#sec-tostring">ToString</a>(<i>sub</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>middle</i>).</li>
<li>Let <i>tail</i> be the result of evaluating <i>TemplateSpans</i> .</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>tail</i>).</li>
<li>Return the string value whose code units are the elements of <i>head</i> followed by the elements of <i>middle</i>
followed by the elements of <i>tail</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The string conversion semantics applied to the <i>Expression</i> value are like <code><a
href="#sec-string.prototype.concat">String.prototype.concat</a></code> rather than the <code>+</code> operator.</p>
</div>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>Let <i>tail</i> be the TV of <i>TemplateTail</i> as defined in <a
href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
<li>Return the string consisting of the code units of <i>tail</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateSpans</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateTail</span></div>
<ol class="proc">
<li>Let <i>head</i> be the result of evaluating <i>TemplateMiddleList</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>head</i>).</li>
<li>Let <i>tail</i> be the TV of <i>TemplateTail</i> as defined in <a
href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
<li>Return the string whose code units are the elements of <i>head</i> followed by the elements of <i>tail</i>.</li>
</ol>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>Let <i>head</i> be the TV of <i>TemplateMiddle</i> as defined in <a
href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
<li>Let <i>sub</i> be the result of evaluating <i>Expression</i>.</li>
<li>Let <i>middle</i> be <a href="#sec-tostring">ToString</a>(<i>sub</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>middle</i>).</li>
<li>Return the sequence of code units consisting of the code units of <i>head</i> followed by the elements of
<i>middle</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The string conversion semantics applied to the <i>Expression</i> value are like <code><a
href="#sec-string.prototype.concat">String.prototype.concat</a></code> rather than the <code>+</code> operator.</p>
</div>
<div class="gp prod"><span class="nt">TemplateMiddleList</span> <span class="geq">:</span> <span class="nt">TemplateMiddleList</span> <span class="nt">TemplateMiddle</span> <span class="nt">Expression</span></div>
<ol class="proc">
<li>Let <i>rest</i> be the result of evaluating <i>TemplateMiddleList</i> .</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>rest</i>).</li>
<li>Let <i>middle</i> be the TV of <i>TemplateMiddle</i> as defined in <a
href="#sec-template-literal-lexical-components">11.8.6</a>.</li>
<li>Let <i>sub</i> be the result of evaluating <i>Expression</i>.</li>
<li>Let <i>last</i> be <a href="#sec-tostring">ToString</a>(<i>sub</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>last</i>).</li>
<li>Return the sequence of code units consisting of the elements of <i>rest</i> followed by the code units of
<i>middle</i> followed by the elements of <i>last</i>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> The string conversion semantics applied to the <i>Expression</i> value are like <code><a
href="#sec-string.prototype.concat">String.prototype.concat</a></code> rather than the <code>+</code> operator.</p>
</div>
</section>
</section>
<section id="sec-grouping-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.2.9"><a href="#sec-grouping-operator" title="link to this section">12.2.9</a></span>
The Grouping Operator</h1>
</div>
<section id="sec-grouping-operator-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.2.9.1"><a href="#sec-grouping-operator-static-semantics-early-errors"
title="link to this section">12.2.9.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span></div>
<ul>
<li>
<p>It is a Syntax Error if the lexical token sequence matched by <span
class="nt">CoverParenthesizedExpressionAndArrowParameterList</span> cannot be parsed with no tokens left over using
<span class="nt">ParenthesizedExpression</span> as the goal symbol.</p>
</li>
<li>
<p>All Early Errors rules for <span class="nt">ParenthesizedExpression</span> and its derived productions also apply
to <span style="font-family: Times New Roman">CoveredParenthesizedExpression</span> of <span
class="nt">CoverParenthesizedExpressionAndArrowParameterList</span>.</p>
</li>
</ul>
</section>
<section id="sec-grouping-operator-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.2.9.2"><a href="#sec-grouping-operator-static-semantics-isfunctiondefinition"
title="link to this section">12.2.9.2</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isfunctiondefinition">12.2.0.2</a>, <a
href="#sec-static-semantics-static-semantics-isfunctiondefinition">12.3.1.2</a>, <a
href="#sec-postfix-expressions-static-semantics-isfunctiondefinition">12.4.2</a>, <a
href="#sec-unary-operators-static-semantics-isfunctiondefinition">12.5.2</a>, <a
href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition">12.6.1</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a>.</p>
<div class="gp prod"><span class="nt">ParenthesizedExpression</span> <span class="geq">:</span> <code class="t">(</code> <span class="nt">Expression</span> <code class="t">)</code></div>
<ol class="proc">
<li>Return IsFunctionDefinition of <i>Expression</i>.</li>
</ol>
</section>
<section id="sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.2.9.3"><a href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.2.9.3</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp prod"><span class="nt">ParenthesizedExpression</span> <span class="geq">:</span> <code class="t">(</code> <span class="nt">Expression</span> <code class="t">)</code></div>
<ol class="proc">
<li>Return IsValidSimpleAssignmentTarget of <i>Expression</i>.</li>
</ol>
</section>
<section id="sec-grouping-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.2.9.4"><a href="#sec-grouping-operator-runtime-semantics-evaluation"
title="link to this section">12.2.9.4</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span> <span class="nt">CoverParenthesizedExpressionAndArrowParameterList</span></div>
<ol class="proc">
<li>Let <i>expr</i> be CoveredParenthesizedExpression of <i>CoverParenthesizedExpressionAndArrowParameterList</i>.</li>
<li>Return the result of evaluating <i>expr</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ParenthesizedExpression</span> <span class="geq">:</span> <code class="t">(</code> <span class="nt">Expression</span> <code class="t">)</code></div>
<ol class="proc">
<li>Return the result of evaluating <i>Expression</i>. This may be of type <a
href="#sec-reference-specification-type">Reference</a>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> This algorithm does not apply <a href="#sec-getvalue">GetValue</a> to the result of
evaluating <i>Expression</i>. The principal motivation for this is so that operators such as <code>delete</code> and
<code>typeof</code> may be applied to parenthesized expressions.</p>
</div>
</section>
</section>
</section>
<section id="sec-left-hand-side-expressions">
<div class="front">
<h1><span class="secnum" id="sec-12.3"><a href="#sec-left-hand-side-expressions"
title="link to this section">12.3</a></span> Left-Hand-Side Expressions</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">PrimaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub> <code class="t">[</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">]</code></div>
<div class="rhs"><span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">TemplateLiteral</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">SuperProperty</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">MetaProperty</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">Arguments</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SuperProperty</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">super</code> <code class="t">[</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">]</code></div>
<div class="rhs"><code class="t">super</code> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MetaProperty</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">NewTarget</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewTarget</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <code class="t">.</code> <code class="t">target</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">new</code> <span class="nt">NewExpression</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">CallExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">Arguments</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">SuperCall</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">CallExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">Arguments</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">CallExpression</span><sub class="g-params">[?Yield]</sub> <code class="t">[</code> <span class="nt">Expression</span><sub class="g-params">[In, ?Yield]</sub> <code class="t">]</code></div>
<div class="rhs"><span class="nt">CallExpression</span><sub class="g-params">[?Yield]</sub> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">CallExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">TemplateLiteral</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">SuperCall</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">super</code> <span class="nt">Arguments</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">Arguments</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><code class="t">(</code> <code class="t">)</code></div>
<div class="rhs"><code class="t">(</code> <span class="nt">ArgumentList</span><sub class="g-params">[?Yield]</sub> <code class="t">)</code></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">ArgumentList</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><code class="t">...</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">ArgumentList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
<div class="rhs"><span class="nt">ArgumentList</span><sub class="g-params">[?Yield]</sub> <code class="t">,</code> <code class="t">...</code> <span class="nt">AssignmentExpression</span><sub class="g-params">[In, ?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">NewExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">CallExpression</span><sub class="g-params">[?Yield]</sub></div>
</div>
</div>
<section id="sec-static-semantics">
<div class="front">
<h1><span class="secnum" id="sec-12.3.1"><a href="#sec-static-semantics" title="link to this section">12.3.1</a></span>
Static Semantics</h1>
</div>
<section id="sec-static-semantics-static-semantics-contains">
<h1><span class="secnum" id="sec-12.3.1.1"><a href="#sec-static-semantics-static-semantics-contains"
title="link to this section">12.3.1.1</a></span> Static Semantics: Contains</h1>
<p>With parameter <var>symbol</var>.</p>
<p>See also: <a href="#sec-static-semantic-rules">5.3</a>, <a
href="#sec-object-initializer-static-semantics-contains">12.2.5.3</a>, <a
href="#sec-function-definitions-static-semantics-contains">14.1.4</a>, <a
href="#sec-arrow-function-definitions-static-semantics-contains">14.2.3</a>, <a
href="#sec-generator-function-definitions-static-semantics-contains">14.4.4</a>, <a
href="#sec-class-definitions-static-semantics-contains">14.5.4</a></p>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>If <i>MemberExpression</i> Contains <i>symbol</i> is <b>true</b>, return <b>true</b>.</li>
<li>If <i>symbol</i> is a <i>ReservedWord</i>, return <b>false</b>.</li>
<li>If <i>symbol</i> is an <i>Identifier</i> and StringValue of <i>symbol</i> is the same value as the StringValue of
<i>IdentifierName</i>, return <b>true</b>;</li>
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">SuperProperty</span> <span class="geq">:</span> <code class="t">super</code> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>If <i>symbol</i> is the <i>ReservedWord</i> <code>super</code>, return <b>true</b>.</li>
<li>If <i>symbol</i> is a <i>ReservedWord</i>, return <b>false</b>.</li>
<li>If <i>symbol</i> is an <i>Identifier</i> and StringValue of <i>symbol</i> is the same value as the StringValue of
<i>IdentifierName</i>, return <b>true</b>;</li>
<li>Return <b>false</b>.</li>
</ol>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">CallExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>If <i>CallExpression</i> Contains <i>symbol</i> is <b>true</b>, return <b>true</b>.</li>
<li>If <i>symbol</i> is a <i>ReservedWord</i>, return <b>false</b>.</li>
<li>If <i>symbol</i> is an <i>Identifier</i> and StringValue of <i>symbol</i> is the same value as the StringValue of
<i>IdentifierName</i>, return <b>true</b>;</li>
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-static-semantics-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.3.1.2"><a href="#sec-static-semantics-static-semantics-isfunctiondefinition"
title="link to this section">12.3.1.2</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isfunctiondefinition">12.2.0.2</a>, <a
href="#sec-grouping-operator-static-semantics-isfunctiondefinition">12.2.9.2</a>, <a
href="#sec-postfix-expressions-static-semantics-isfunctiondefinition">12.4.2</a>, <a
href="#sec-unary-operators-static-semantics-isfunctiondefinition">12.5.2</a>, <a
href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition">12.6.1</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">TemplateLiteral</span></div>
<div class="rhs"><span class="nt">SuperProperty</span></div>
<div class="rhs"><span class="nt">MetaProperty</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">NewExpression</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">CallExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">SuperCall</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">TemplateLiteral</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-static-semantics-static-semantics-isdestructuring">
<h1><span class="secnum" id="sec-12.3.1.3"><a href="#sec-static-semantics-static-semantics-isdestructuring"
title="link to this section">12.3.1.3</a></span> Static Semantics: IsDestructuring</h1>
<p>See also: <a href="#sec-for-in-and-for-of-statements-static-semantics-isdestructuring">13.6.4.6</a>.</p>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <span class="nt">PrimaryExpression</span></div>
<ol class="proc">
<li>If <i>PrimaryExpression</i> is either an <i>ObjectLiteral</i> or an <i>ArrayLiteral</i>, return <b>true.</b></li>
<li>Return <b>false</b>.</li>
</ol>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">TemplateLiteral</span></div>
<div class="rhs"><span class="nt">SuperProperty</span></div>
<div class="rhs"><span class="nt">MetaProperty</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">NewExpression</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">CallExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">SuperCall</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">TemplateLiteral</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-static-semantics-static-semantics-isidentifierref">
<h1><span class="secnum" id="sec-12.3.1.4"><a href="#sec-static-semantics-static-semantics-isidentifierref"
title="link to this section">12.3.1.4</a></span> Static Semantics: IsIdentifierRef</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isidentifierref">12.2.0.3</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">LeftHandSideExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">CallExpression</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">TemplateLiteral</span></div>
<div class="rhs"><span class="nt">SuperProperty</span></div>
<div class="rhs"><span class="nt">MetaProperty</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">NewExpression</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.3.1.5"><a href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.3.1.5</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">CallExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">CallExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<div class="rhs"><span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<div class="rhs"><span class="nt">SuperProperty</span></div>
</div>
<ol class="proc">
<li>Return <b>true</b>.</li>
</ol>
<div class="gp">
<div class="lhs"><span class="nt">CallExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">SuperCall</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">Arguments</span></div>
<div class="rhs"><span class="nt">CallExpression</span> <span class="nt">TemplateLiteral</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">NewExpression</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MemberExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">MemberExpression</span> <span class="nt">TemplateLiteral</span></div>
<div class="rhs"><code class="t">new</code> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">NewTarget</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">new</code> <code class="t">.</code> <code class="t">target</code></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
</section>
<section id="sec-property-accessors">
<div class="front">
<h1><span class="secnum" id="sec-12.3.2"><a href="#sec-property-accessors" title="link to this section">12.3.2</a></span>
Property Accessors</h1>
<div class="note">
<p><span class="nh">NOTE</span> Properties are accessed by name, using either the dot notation:</p>
</div>
<div class="lhs">MemberExpression <code>.</code> IdentifierName<br>CallExpression <code>.</code> IdentifierName</div>
<p>or the bracket notation:</p>
<div class="lhs">MemberExpression <code>[</code> Expression <code>]</code><br>CallExpression <code>[</code> Expression <code>]</code></div>
<p>The dot notation is explained by the following syntactic conversion:</p>
<div class="lhs">MemberExpression <code>.</code> IdentifierName</div>
<p>is identical in its behaviour to</p>
<div class="lhs">MemberExpression <code>[</code> <identifier-name-string> <code>]</code></div>
<p>and similarly</p>
<div class="lhs">CallExpression <code>.</code> IdentifierName</div>
<p>is identical in its behaviour to</p>
<div class="lhs">CallExpression <code>[</code> <identifier-name-string> <code>]</code></div>
<p>where <var><identifier-name-string></var> is the result of evaluating <span style="font-family: Times New
Roman">StringValue of</span> <span class="nt">IdentifierName</span>.</p>
</div>
<section id="sec-property-accessors-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.3.2.1"><a href="#sec-property-accessors-runtime-semantics-evaluation"
title="link to this section">12.3.2.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>baseReference</i> be the result of evaluating <i>MemberExpression</i>.</li>
<li>Let <i>baseValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>baseReference</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>baseValue</i>).</li>
<li>Let <i>propertyNameReference</i> be the result of evaluating <i>Expression</i>.</li>
<li>Let <i>propertyNameValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>propertyNameReference</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propertyNameValue</i>).</li>
<li>Let <i>bv</i> be <a href="#sec-requireobjectcoercible">RequireObjectCoercible</a>(<i>baseValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>bv</i>).</li>
<li>Let <i>propertyKey</i> be <a href="#sec-topropertykey">ToPropertyKey</a>(<i>propertyNameValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propertyKey</i>).</li>
<li>If the code matched by the syntactic production that is being evaluated is <a href="#sec-strict-mode-code">strict
mode code</a>, let <i>strict</i> be <b>true</b>, else let <i>strict</i> be <b>false</b>.</li>
<li>Return a value of type <a href="#sec-reference-specification-type">Reference</a> whose base value is <i>bv</i> and
whose referenced name is <i>propertyKey</i>, and whose strict reference flag is <i>strict</i>.</li>
</ol>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <span class="nt">MemberExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>Let <i>baseReference</i> be the result of evaluating <i>MemberExpression</i>.</li>
<li>Let <i>baseValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>baseReference</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>baseValue</i>).</li>
<li>Let <i>bv</i> be <a href="#sec-requireobjectcoercible">RequireObjectCoercible</a>(<i>baseValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>bv</i>).</li>
<li>Let <i>propertyNameString</i> be StringValue of <i>IdentifierName</i></li>
<li>If the code matched by the syntactic production that is being evaluated is <a href="#sec-strict-mode-code">strict
mode code</a>, let <i>strict</i> be <b>true</b>, else let <i>strict</i> be <b>false</b>.</li>
<li>Return a value of type <a href="#sec-reference-specification-type">Reference</a> whose base value is <i>bv</i> and
whose referenced name is <i>propertyNameString</i>, and whose strict reference flag is <i>strict</i>.</li>
</ol>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">CallExpression</span> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<p>Is evaluated in exactly the same manner as <span class="prod"><span class="nt">MemberExpression</span> <span
class="geq">:</span> <span class="nt">MemberExpression</span> <code class="t">[</code> <span class="nt">Expression</span>
<code class="t">]</code></span> except that the contained <span class="nt">CallExpression</span> is evaluated in step
1.</p>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">CallExpression</span> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<p>Is evaluated in exactly the same manner as <span class="prod"><span class="nt">MemberExpression</span> <span
class="geq">:</span> <span class="nt">MemberExpression</span> <code class="t">.</code> <span
class="nt">IdentifierName</span></span> except that the contained <span class="nt">CallExpression</span> is evaluated in
step 1.</p>
</section>
</section>
<section id="sec-new-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.3.3"><a href="#sec-new-operator" title="link to this section">12.3.3</a></span> The
<code>new</code> Operator</h1>
</div>
<section id="sec-new-operator-runtime-semantics-evaluation">
<div class="front">
<h1><span class="secnum" id="sec-12.3.3.1"><a href="#sec-new-operator-runtime-semantics-evaluation"
title="link to this section">12.3.3.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">NewExpression</span> <span class="geq">:</span> <code class="t">new</code> <span class="nt">NewExpression</span></div>
<ol class="proc">
<li>Return <a href="#sec-evaluatenew">EvaluateNew</a>(<i>NewExpression</i>, <span style="font-family:
sans-serif">empty</span>).</li>
</ol>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <code class="t">new</code> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
<ol class="proc">
<li>Return <a href="#sec-evaluatenew">EvaluateNew</a>(<i>MemberExpression</i>, <i>Arguments</i>).</li>
</ol>
</div>
<section id="sec-evaluatenew">
<h1><span class="secnum" id="sec-12.3.3.1.1"><a href="#sec-evaluatenew"
title="link to this section">12.3.3.1.1</a></span> Runtime Semantics: EvaluateNew(constructProduction,
arguments)</h1>
<p>The abstract operation EvaluateNew with arguments <span style="font-family: Times New
Roman"><i>constructProduction</i>,</span> and <var>arguments</var> performs the following steps:</p>
<ol class="proc">
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>constructProduction</i> is either a <i>NewExpression</i> or a
<i>MemberExpression</i>.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>arguments</i> is either <span style="font-family:
sans-serif">empty</span> or an <i>Arguments</i> production.</li>
<li>Let <i>ref</i> be the result of evaluating <i>constructProduction</i>.</li>
<li>Let <i>constructor</i> be <a href="#sec-getvalue">GetValue</a>(<i>ref</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>constructor</i>).</li>
<li>If <i>arguments</i> is <span style="font-family: sans-serif">empty</span>, let <i>argList</i> be an empty <a
href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Else,
<ol class="block">
<li>Let <i>argList</i> be ArgumentListEvaluation of <i>arguments</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argList</i>).</li>
</ol>
</li>
<li>If <a href="#sec-isconstructor">IsConstructor</a> (<i>constructor</i>) is <b>false</b>, throw a <b>TypeError</b>
exception.</li>
<li>Return <a href="#sec-construct">Construct</a>(<i>constructor</i>, <i>argList</i>).</li>
</ol>
</section>
</section>
</section>
<section id="sec-function-calls">
<div class="front">
<h1><span class="secnum" id="sec-12.3.4"><a href="#sec-function-calls" title="link to this section">12.3.4</a></span>
Function Calls</h1>
</div>
<section id="sec-function-calls-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.3.4.1"><a href="#sec-function-calls-runtime-semantics-evaluation"
title="link to this section">12.3.4.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">MemberExpression</span> <span class="nt">Arguments</span></div>
<ol class="proc">
<li>Let <i>ref</i> be the result of evaluating <i>MemberExpression</i>.</li>
<li>Let <i>func</i> be <a href="#sec-getvalue">GetValue</a>(<i>ref</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>func</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is <a
href="#sec-reference-specification-type">Reference</a> and <a
href="#sec-reference-specification-type">IsPropertyReference</a>(<i>ref</i>) is <b>false</b> and <a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>ref</i>) <i>is</i> <code>"eval"</code>, then
<ol class="block">
<li>If <a href="#sec-samevalue">SameValue</a>(<i>func</i>, %eval%) is <b>true</b>, then
<ol class="block">
<li>Let <i>argList</i> be ArgumentListEvaluation(<i>Arguments</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argList</i>).</li>
<li>If <i>argList</i> has no elements, return <b>undefined.</b></li>
<li>Let <i>evalText</i> be the first element of <i>argList</i>.</li>
<li>If the source code matching this <i>CallExpression</i> is <a href="#sec-strict-mode-code">strict code</a>,
let <i>strictCaller</i> be <b>true.</b> Otherwise let <i>strictCaller</i> be <b>false.</b></li>
<li>Let <i>evalRealm</i> be <a href="#sec-execution-contexts">the running execution context</a>’s <a
href="#sec-code-realms">Realm</a>.</li>
<li>Return <a href="#sec-performeval">PerformEval</a>(<i>evalText</i>, <i>evalRealm</i>, <i>strictCaller</i>,
<b>true</b>). .</li>
</ol>
</li>
</ol>
</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is <a
href="#sec-reference-specification-type">Reference</a>, then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">IsPropertyReference</a>(<i>ref</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>thisValue</i> be <a href="#sec-getthisvalue">GetThisValue</a>(<i>ref</i>).</li>
</ol>
</li>
<li>Else, the base of <i>ref</i> is an <a href="#sec-environment-records">Environment Record</a>
<ol class="block">
<li>Let <i>refEnv</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>ref</i>).</li>
<li>Let <i>thisValue</i> be <i>refEnv</i>.WithBaseObject().</li>
</ol>
</li>
</ol>
</li>
<li>Else <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is not <a
href="#sec-reference-specification-type">Reference</a>,
<ol class="block">
<li>Let <i>thisValue</i> be <b>undefined</b>.</li>
</ol>
</li>
<li>Let <i>thisCall</i> be this <i>CallExpression</i>.</li>
<li>Let <i>tailCall</i> be <a href="#sec-isintailposition">IsInTailPosition</a>(<i>thisCall</i>). (See <a
href="#sec-isintailposition">14.6.1</a>)</li>
<li>Return <a href="#sec-evaluatedirectcall">EvaluateDirectCall</a>(<i>func</i>, <i>thisValue</i>, <i>Arguments</i>,
<i>tailCall</i>).</li>
</ol>
<p>A <span class="nt">CallExpression</span> whose evaluation executes step 4.a.vii is a <i>direct eval</i>.</p>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">CallExpression</span> <span class="nt">Arguments</span></div>
<ol class="proc">
<li>Let <i>ref</i> be the result of evaluating <i>CallExpression</i>.</li>
<li>Let <i>thisCall</i> be this <i>CallExpression</i></li>
<li>Let <i>tailCall</i> be <a href="#sec-isintailposition">IsInTailPosition</a>(<i>thisCall</i>). (See <a
href="#sec-isintailposition">14.6.1</a>)</li>
<li>Return <a href="#sec-evaluatecall">EvaluateCall</a>(<i>ref</i>, <i>Arguments</i>, <i>tailCall</i>).</li>
</ol>
</section>
<section id="sec-evaluatecall">
<h1><span class="secnum" id="sec-12.3.4.2"><a href="#sec-evaluatecall" title="link to this section">12.3.4.2</a></span>
Runtime Semantics: EvaluateCall( ref, arguments, tailPosition )</h1>
<p>The abstract operation EvaluateCall takes as arguments a value <var>ref</var>, a syntactic grammar production
<var>arguments</var>, and a Boolean argument <var>tailPosition</var>. It performs the following steps:</p>
<ol class="proc">
<li>Let <i>func</i> be <a href="#sec-getvalue">GetValue</a>(<i>ref</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>func</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is <a
href="#sec-reference-specification-type">Reference</a>, then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">IsPropertyReference</a>(<i>ref</i>) is <b>true</b>, then
<ol class="block">
<li>Let <i>thisValue</i> be <a href="#sec-getthisvalue">GetThisValue</a>(<i>ref</i>).</li>
</ol>
</li>
<li>Else, the base of <i>ref</i> is an <a href="#sec-environment-records">Environment Record</a>
<ol class="block">
<li>Let <i>refEnv</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>ref</i>).</li>
<li>Let <i>thisValue</i> be <i>refEnv</i>.WithBaseObject().</li>
</ol>
</li>
</ol>
</li>
<li>Else <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is not <a
href="#sec-reference-specification-type">Reference</a>,
<ol class="block">
<li>Let <i>thisValue</i> be <b>undefined</b>.</li>
</ol>
</li>
<li>Return <a href="#sec-evaluatedirectcall">EvaluateDirectCall</a>(<i>func</i>, <i>thisValue</i>, <i>arguments</i>,
<i>tailPosition</i>).</li>
</ol>
</section>
<section id="sec-evaluatedirectcall">
<h1><span class="secnum" id="sec-12.3.4.3"><a href="#sec-evaluatedirectcall"
title="link to this section">12.3.4.3</a></span> Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments,
tailPosition )</h1>
<p>The abstract operation EvaluateDirectCall takes as arguments a value <var>func</var>, a value <var>thisValue</var>, a
syntactic grammar production <var>arguments</var>, and a Boolean argument <var>tailPosition</var>. It performs the
following steps:</p>
<ol class="proc">
<li>Let <i>argList</i> be ArgumentListEvaluation(<i>arguments</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argList</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>func</i>) is not Object, throw a <b>TypeError</b>
exception.</li>
<li>If <a href="#sec-iscallable">IsCallable</a>(<i>func</i>) is <b>false</b>, throw a <b>TypeError</b> exception.</li>
<li>If <i>tailPosition</i> is <b>true</b>, perform <a href="#sec-preparefortailcall">PrepareForTailCall</a>().</li>
<li>Let <i>result</i> be <a href="#sec-call">Call</a>(<i>func</i>, <i>thisValue</i>, <i>argList</i>).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: If <i>tailPosition</i> is <b>true</b>, the above call will not
return here, but instead evaluation will continue as if the following return has already occurred.</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: If <i>result</i> is not an <a
href="#sec-completion-record-specification-type">abrupt completion</a> then <a
href="#sec-ecmascript-data-types-and-values">Type</a>(<i>result</i>) is an <a
href="#sec-ecmascript-language-types">ECMAScript language type</a>.</li>
<li>Return <i>result</i>.</li>
</ol>
</section>
</section>
<section id="sec-super-keyword">
<div class="front">
<h1><span class="secnum" id="sec-12.3.5"><a href="#sec-super-keyword" title="link to this section">12.3.5</a></span> The
<code>super</code> Keyword</h1>
</div>
<section id="sec-super-keyword-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.3.5.1"><a href="#sec-super-keyword-runtime-semantics-evaluation"
title="link to this section">12.3.5.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">SuperProperty</span> <span class="geq">:</span> <code class="t">super</code> <code class="t">[</code> <span class="nt">Expression</span> <code class="t">]</code></div>
<ol class="proc">
<li>Let <i>propertyNameReference</i> be the result of evaluating <i>Expression</i>.</li>
<li>Let <i>propertyNameValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>propertyNameReference</i>).</li>
<li>Let <i>propertyKey</i> be <a href="#sec-topropertykey">ToPropertyKey</a>(<i>propertyNameValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>propertyKey</i>).</li>
<li>If the code matched by the syntactic production that is being evaluated is <a href="#sec-strict-mode-code">strict
mode code</a>, let <i>strict</i> be <b>true</b>, else let <i>strict</i> be <b>false</b>.</li>
<li>Return <a href="#sec-makesuperpropertyreference">MakeSuperPropertyReference</a>(<i>propertyKey</i>,
<i>strict</i>).</li>
</ol>
<div class="gp prod"><span class="nt">SuperProperty</span> <span class="geq">:</span> <code class="t">super</code> <code class="t">.</code> <span class="nt">IdentifierName</span></div>
<ol class="proc">
<li>Let <i>propertyKey</i> be StringValue of <i>IdentifierName</i>.</li>
<li>If the code matched by the syntactic production that is being evaluated is <a href="#sec-strict-mode-code">strict
mode code</a>, let <i>strict</i> be <b>true</b>, else let <i>strict</i> be <b>false</b>.</li>
<li>Return <a href="#sec-makesuperpropertyreference">MakeSuperPropertyReference</a>(<i>propertyKey</i>,
<i>strict</i>).</li>
</ol>
<div class="gp prod"><span class="nt">SuperCall</span> <span class="geq">:</span> <code class="t">super</code> <span class="nt">Arguments</span></div>
<ol class="proc">
<li>Let <i>newTarget</i> be <a href="#sec-getnewtarget">GetNewTarget</a>().</li>
<li>If <i>newTarget</i> is <b>undefined</b>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>func</i> be <a href="#sec-getsuperconstructor">GetSuperConstructor</a>().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>func</i>).</li>
<li>Let <i>argList</i> be ArgumentListEvaluation of <i>Arguments</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>argList</i>).</li>
<li>Let <i>result</i> be <a href="#sec-construct">Construct</a>(<i>func</i>, <i>argList</i>, <i>newTarget</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>result</i>).</li>
<li>Let <i>thisER</i> be <a href="#sec-getthisenvironment">GetThisEnvironment</a>( ).</li>
<li>Return <i>thisER</i>.<a href="#sec-bindthisvalue">BindThisValue</a>(<i>result</i>).</li>
</ol>
</section>
<section id="sec-getsuperconstructor">
<h1><span class="secnum" id="sec-12.3.5.2"><a href="#sec-getsuperconstructor"
title="link to this section">12.3.5.2</a></span> Runtime Semantics: GetSuperConstructor ( )</h1>
<p>The abstract operation GetSuperConstructor performs the following steps:</p>
<ol class="proc">
<li>Let <i>envRec</i> be <a href="#sec-getthisenvironment">GetThisEnvironment</a>( ).</li>
<li><a href="#sec-algorithm-conventions">Assert</a>: <i>envRec</i> is a function <a
href="#sec-environment-records">Environment Record</a>.</li>
<li>Let <i>activeFunction</i> be <i>envRec</i>.[[FunctionObject]].</li>
<li>Let <i>superConstructor</i> be <i>activeFunction</i>.[[GetPrototypeOf]]().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>superConstructor</i>).</li>
<li>If <a href="#sec-isconstructor">IsConstructor</a>(<i>superConstructor</i>) is <b>false</b>, throw a <b>TypeError</b>
exception.</li>
<li>Return <i>superConstructor</i>.</li>
</ol>
</section>
<section id="sec-makesuperpropertyreference">
<h1><span class="secnum" id="sec-12.3.5.3"><a href="#sec-makesuperpropertyreference"
title="link to this section">12.3.5.3</a></span> Runtime Semantics: MakeSuperPropertyReference(propertyKey,
strict)</h1>
<p>The abstract operation MakeSuperPropertyReference with arguments <var>propertyKey</var> and <var>strict</var> performs
the following steps:</p>
<ol class="proc">
<li>Let <i>env</i> be <a href="#sec-getthisenvironment">GetThisEnvironment</a>( ).</li>
<li>If <i>env</i>.HasSuperBinding() is <b>false</b>, throw a <b>ReferenceError</b> exception.</li>
<li>Let <i>actualThis</i> be <i>env</i>.GetThisBinding().</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>actualThis</i>).</li>
<li>Let <i>baseValue</i> be <i>env</i>.<a href="#sec-getsuperbase">GetSuperBase</a>().</li>
<li>Let <i>bv</i> be <a href="#sec-requireobjectcoercible">RequireObjectCoercible</a>(<i>baseValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>bv</i>).</li>
<li>Return a value of type <a href="#sec-reference-specification-type">Reference</a> that is a Super <a
href="#sec-reference-specification-type">Reference</a> whose base value is <i>bv</i>, whose referenced name is
<i>propertyKey</i>, whose thisValue is <i>actualThis</i>, and whose strict reference flag is <i>strict</i>.</li>
</ol>
</section>
</section>
<section id="sec-argument-lists">
<div class="front">
<h1><span class="secnum" id="sec-12.3.6"><a href="#sec-argument-lists" title="link to this section">12.3.6</a></span>
Argument Lists</h1>
<div class="note">
<p><span class="nh">NOTE</span> The evaluation of an argument list produces a <a
href="#sec-list-and-record-specification-type">List</a> of values (<a href="#sec-list-and-record-specification-type">see
6.2.1</a>).</p>
</div>
</div>
<section id="sec-argument-lists-runtime-semantics-argumentlistevaluation">
<h1><span class="secnum" id="sec-12.3.6.1"><a href="#sec-argument-lists-runtime-semantics-argumentlistevaluation"
title="link to this section">12.3.6.1</a></span> <span style="font-family: sans-serif">Runtime Semantics:</span>
ArgumentListEvaluation</h1>
<p>See also: <a href="#sec-template-literals-runtime-semantics-argumentlistevaluation">12.2.8.2</a></p>
<div class="gp prod"><span class="nt">Arguments</span> <span class="geq">:</span> <code class="t">(</code> <code class="t">)</code></div>
<ol class="proc">
<li>Return an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
</ol>
<div class="gp prod"><span class="nt">ArgumentList</span> <span class="geq">:</span> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>ref</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>arg</i> be <a href="#sec-getvalue">GetValue</a>(<i>ref</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>arg</i>).</li>
<li>Return a <a href="#sec-list-and-record-specification-type">List</a> whose sole item is <i>arg</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ArgumentList</span> <span class="geq">:</span> <code class="t">...</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>list</i> be an empty <a href="#sec-list-and-record-specification-type">List</a>.</li>
<li>Let <i>spreadRef</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>spreadObj</i> be <a href="#sec-getvalue">GetValue</a>(<i>spreadRef</i>).</li>
<li>Let <i>iterator</i> be <a href="#sec-getiterator">GetIterator</a>(<i>spreadObj</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>iterator</i>).</li>
<li>Repeat
<ol class="block">
<li>Let <i>next</i> be <a href="#sec-iteratorstep">IteratorStep</a>(<i>iterator</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>next</i>).</li>
<li>If <i>next</i> is <b>false</b>, return <i>list</i>.</li>
<li>Let <i>nextArg</i> be <a href="#sec-iteratorvalue">IteratorValue</a>(<i>next</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>nextArg</i>).</li>
<li>Append <i>nextArg</i> as the last element of <i>list</i>.</li>
</ol>
</li>
</ol>
<div class="gp prod"><span class="nt">ArgumentList</span> <span class="geq">:</span> <span class="nt">ArgumentList</span> <code class="t">,</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>precedingArgs</i> be the result of evaluating <i>ArgumentList</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>precedingArgs</i>).</li>
<li>Let <i>ref</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>arg</i> be <a href="#sec-getvalue">GetValue</a>(<i>ref</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>arg</i>).</li>
<li>Append <i>arg</i> to the end of <i>precedingArgs</i>.</li>
<li>Return <i>precedingArgs</i>.</li>
</ol>
<div class="gp prod"><span class="nt">ArgumentList</span> <span class="geq">:</span> <span class="nt">ArgumentList</span> <code class="t">,</code> <code class="t">...</code> <span class="nt">AssignmentExpression</span></div>
<ol class="proc">
<li>Let <i>precedingArgs</i> be the result of evaluating <i>ArgumentList</i>.</li>
<li>Let <i>spreadRef</i> be the result of evaluating <i>AssignmentExpression</i>.</li>
<li>Let <i>iterator</i> be <a href="#sec-getiterator">GetIterator</a>(<a
href="#sec-getvalue">GetValue</a>(<i>spreadRef</i>) ).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>iterator</i>).</li>
<li>Repeat
<ol class="block">
<li>Let <i>next</i> be <a href="#sec-iteratorstep">IteratorStep</a>(<i>iterator</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>next</i>).</li>
<li>If <i>next</i> is <b>false</b>, return <i>precedingArgs</i>.</li>
<li>Let <i>nextArg</i> be <a href="#sec-iteratorvalue">IteratorValue</a>(<i>next</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>nextArg</i>).</li>
<li>Append <i>nextArg</i> as the last element of <i>precedingArgs</i>.</li>
</ol>
</li>
</ol>
</section>
</section>
<section id="sec-tagged-templates">
<div class="front">
<h1><span class="secnum" id="sec-12.3.7"><a href="#sec-tagged-templates" title="link to this section">12.3.7</a></span>
Tagged Templates</h1>
<div class="note">
<p><span class="nh">NOTE</span> A tagged template is a function call where the arguments of the call are derived from a
<i>TemplateLiteral</i> (<a href="#sec-template-literals">12.2.8</a>). The actual arguments include a template object (<a
href="#sec-gettemplateobject">12.2.8.3</a>) and the values produced by evaluating the expressions embedded within the
<i>TemplateLiteral</i>.</p>
</div>
</div>
<section id="sec-tagged-templates-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.3.7.1"><a href="#sec-tagged-templates-runtime-semantics-evaluation"
title="link to this section">12.3.7.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">MemberExpression</span> <span class="geq">:</span> <span class="nt">MemberExpression</span> <span class="nt">TemplateLiteral</span></div>
<ol class="proc">
<li>Let <i>tagRef</i> be the result of evaluating <i>MemberExpression</i>.</li>
<li>Let <i>thisCall</i> be this <i>MemberExpression</i>.</li>
<li>Let <i>tailCall</i> be <a href="#sec-isintailposition">IsInTailPosition</a>(<i>thisCall</i>). (See <a
href="#sec-isintailposition">14.6.1</a>)</li>
<li>Return <a href="#sec-evaluatecall">EvaluateCall</a>(<i>tagRef</i>, <i>TemplateLiteral</i>, <i>tailCall</i>).</li>
</ol>
<div class="gp prod"><span class="nt">CallExpression</span> <span class="geq">:</span> <span class="nt">CallExpression</span> <span class="nt">TemplateLiteral</span></div>
<ol class="proc">
<li>Let <i>tagRef</i> be the result of evaluating <i>CallExpression</i>.</li>
<li>Let <i>thisCall</i> be this <i>CallExpression</i>.</li>
<li>Let <i>tailCall</i> be <a href="#sec-isintailposition">IsInTailPosition</a>(<i>thisCall</i>). (See <a
href="#sec-isintailposition">14.6.1</a>)</li>
<li>Return <a href="#sec-evaluatecall">EvaluateCall</a>(<i>tagRef</i>, <i>TemplateLiteral</i>, <i>tailCall</i>).</li>
</ol>
</section>
</section>
<section id="sec-meta-properties">
<div class="front">
<h1><span class="secnum" id="sec-12.3.8"><a href="#sec-meta-properties" title="link to this section">12.3.8</a></span>
Meta Properties</h1>
</div>
<section id="sec-meta-properties-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.3.8.1"><a href="#sec-meta-properties-runtime-semantics-evaluation"
title="link to this section">12.3.8.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">NewTarget</span> <span class="geq">:</span> <code class="t">new</code> <code class="t">.</code> <code class="t">target</code></div>
<ol class="proc">
<li>Return <a href="#sec-getnewtarget">GetNewTarget</a>().</li>
</ol>
</section>
</section>
</section>
<section id="sec-postfix-expressions">
<div class="front">
<h1><span class="secnum" id="sec-12.4"><a href="#sec-postfix-expressions" title="link to this section">12.4</a></span>
Postfix Expressions</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">PostfixExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[?Yield]</sub> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">++</code></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span><sub class="g-params">[?Yield]</sub> <span class="grhsannot">[no <span class="nt">LineTerminator</span> here]</span> <code class="t">--</code></div>
</div>
</div>
<section id="sec-postfix-expressions-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.4.1"><a href="#sec-postfix-expressions-static-semantics-early-errors"
title="link to this section">12.4.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp">
<div class="lhs"><span class="nt">PostfixExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">++</code></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">--</code></div>
</div>
<ul>
<li>
<p>It is an early <a href="#sec-reference-specification-type">Reference</a> Error if <span style="font-family: Times New
Roman">IsValidSimpleAssignmentTarget</span> of <span class="nt">LeftHandSideExpression</span> is <span
class="value">false</span>.</p>
</li>
</ul>
</section>
<section id="sec-postfix-expressions-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.4.2"><a href="#sec-postfix-expressions-static-semantics-isfunctiondefinition"
title="link to this section">12.4.2</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isfunctiondefinition">12.2.0.2</a>, <a
href="#sec-grouping-operator-static-semantics-isfunctiondefinition">12.2.9.2</a>, <a
href="#sec-static-semantics-static-semantics-isfunctiondefinition">12.3.1.2</a>, <a
href="#sec-unary-operators-static-semantics-isfunctiondefinition">12.5.2</a>, <a
href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition">12.6.1</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a></p>
<div class="gp">
<div class="lhs"><span class="nt">PostfixExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">++</code></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">--</code></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.4.3"><a href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.4.3</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">PostfixExpression</span> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">++</code></div>
<div class="rhs"><span class="nt">LeftHandSideExpression</span> <code class="t">--</code></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-postfix-increment-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.4.4"><a href="#sec-postfix-increment-operator"
title="link to this section">12.4.4</a></span> Postfix Increment Operator</h1>
</div>
<section id="sec-postfix-increment-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.4.4.1"><a href="#sec-postfix-increment-operator-runtime-semantics-evaluation"
title="link to this section">12.4.4.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">PostfixExpression</span> <span class="geq">:</span> <span class="nt">LeftHandSideExpression</span> <code class="t">++</code></div>
<ol class="proc">
<li>Let <i>lhs</i> be the result of evaluating <i>LeftHandSideExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>lhs</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>Let <i>newValue</i> be the result of adding the value <code>1</code> to <i>oldValue</i>, using the same rules as for
the <code>+</code> operator (<a href="#sec-applying-the-additive-operators-to-numbers">see 12.7.5</a>).</li>
<li>Let <i>status</i> be <a href="#sec-putvalue">PutValue</a>(<i>lhs</i>, <i>newValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <i>oldValue</i>.</li>
</ol>
</section>
</section>
<section id="sec-postfix-decrement-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.4.5"><a href="#sec-postfix-decrement-operator"
title="link to this section">12.4.5</a></span> Postfix Decrement Operator</h1>
</div>
<section id="sec-postfix-decrement-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.4.5.1"><a href="#sec-postfix-decrement-operator-runtime-semantics-evaluation"
title="link to this section">12.4.5.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">PostfixExpression</span> <span class="geq">:</span> <span class="nt">LeftHandSideExpression</span> <code class="t">--</code></div>
<ol class="proc">
<li>Let <i>lhs</i> be the result of evaluating <i>LeftHandSideExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>lhs</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>Let <i>newValue</i> be the result of subtracting the value <code>1</code> from <i>oldValue</i>, using the same rules
as for the <code>-</code> operator (<a href="#sec-applying-the-additive-operators-to-numbers">12.7.5</a>).</li>
<li>Let <i>status</i> be <a href="#sec-putvalue">PutValue</a>(<i>lhs</i>, <i>newValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <i>oldValue</i>.</li>
</ol>
</section>
</section>
</section>
<section id="sec-unary-operators">
<div class="front">
<h1><span class="secnum" id="sec-12.5"><a href="#sec-unary-operators" title="link to this section">12.5</a></span> Unary
Operators</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">UnaryExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">PostfixExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">delete</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">void</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">typeof</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">++</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">--</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">+</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">-</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">~</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><code class="t">!</code> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
</div>
</div>
<section id="sec-unary-operators-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.5.1"><a href="#sec-unary-operators-static-semantics-early-errors"
title="link to this section">12.5.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp">
<div class="lhs"><span class="nt">UnaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">++</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">--</code> <span class="nt">UnaryExpression</span></div>
</div>
<ul>
<li>
<p>It is an early <a href="#sec-reference-specification-type">Reference</a> Error if <span style="font-family: Times New
Roman">IsValidSimpleAssignmentTarget</span> of <span class="nt">UnaryExpression</span> is <span
class="value">false</span>.</p>
</li>
</ul>
</section>
<section id="sec-unary-operators-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.5.2"><a href="#sec-unary-operators-static-semantics-isfunctiondefinition"
title="link to this section">12.5.2</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isfunctiondefinition">12.2.0.2</a>, <a
href="#sec-grouping-operator-static-semantics-isfunctiondefinition">12.2.9.2</a>, <a
href="#sec-static-semantics-static-semantics-isfunctiondefinition">12.3.1.2</a>, <a
href="#sec-postfix-expressions-static-semantics-isfunctiondefinition">12.4.2</a>, <a
href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition">12.6.1</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">UnaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">delete</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">void</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">typeof</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">++</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">--</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">+</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">-</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">~</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">!</code> <span class="nt">UnaryExpression</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.5.3"><a href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.5.3</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">12.6.2</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<div class="gp">
<div class="lhs"><span class="nt">UnaryExpression</span> <span class="geq">:</span></div>
<div class="rhs"><code class="t">delete</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">void</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">typeof</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">++</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">--</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">+</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">-</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">~</code> <span class="nt">UnaryExpression</span></div>
<div class="rhs"><code class="t">!</code> <span class="nt">UnaryExpression</span></div>
</div>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-delete-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.4"><a href="#sec-delete-operator" title="link to this section">12.5.4</a></span> The
<code>delete</code> Operator</h1>
</div>
<section id="sec-delete-operator-static-semantics-early-errors">
<h1><span class="secnum" id="sec-12.5.4.1"><a href="#sec-delete-operator-static-semantics-early-errors"
title="link to this section">12.5.4.1</a></span> Static Semantics: Early Errors</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">delete</code> <span class="nt">UnaryExpression</span></div>
<ul>
<li>
<p>It is a Syntax Error if the <span class="nt">UnaryExpression</span> is contained in <a
href="#sec-strict-mode-code">strict mode code</a> and the derived <span class="nt">UnaryExpression</span> is <span
class="prod"><span class="nt">PrimaryExpression</span> <span class="geq">:</span></span>
<var>IdentifierReference.</var></p>
</li>
<li>
<p>It is a Syntax Error if the derived <span class="nt">UnaryExpression</span> is<br> <span style="font-family:
Times New Roman"><i>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList<br></i></span>and <span
class="nt">CoverParenthesizedExpressionAndArrowParameterList</span> ultimately derives a phrase that, if used in place
of <var>UnaryExpression,</var> would produce a Syntax Error according to these rules. This rule is recursively
applied.</p>
</li>
</ul>
<div class="note">
<p><span class="nh">NOTE</span> The last rule means that expressions such as<br>		<code>delete
(((foo)))</code><br>produce early errors because of recursive application of the first rule.</p>
</div>
</section>
<section id="sec-delete-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.4.2"><a href="#sec-delete-operator-runtime-semantics-evaluation"
title="link to this section">12.5.4.2</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">delete</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>ref</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>ref</i>).</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>ref</i>) is not <a
href="#sec-reference-specification-type">Reference</a>, return <b>true</b>.</li>
<li>If <a href="#sec-reference-specification-type">IsUnresolvableReference</a>(<i>ref</i>) is <b>true</b>, then
<ol class="block">
<li><a href="#sec-algorithm-conventions">Assert</a>: <a
href="#sec-reference-specification-type">IsStrictReference</a>(<i>ref</i>) is <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</li>
<li>If <a href="#sec-reference-specification-type">IsPropertyReference</a>(<i>ref</i>) is <b>true</b>, then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">IsSuperReference</a>(<i>ref</i>), throw a <b>ReferenceError</b>
exception.</li>
<li>Let <i>baseObj</i> be <a href="#sec-toobject">ToObject</a>(<a
href="#sec-reference-specification-type">GetBase</a>(<i>ref</i>)).</li>
<li>Let <i>deleteStatus</i> be <i>baseObj</i>.[[Delete]](<a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>ref</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>deleteStatus</i>).</li>
<li>If <i>deleteStatus</i> is <b>false</b> and <a
href="#sec-reference-specification-type">IsStrictReference</a>(<i>ref</i>) is <b>true</b>, throw a
<b>TypeError</b> exception.</li>
<li>Return <i>deleteStatus</i>.</li>
</ol>
</li>
<li>Else <i>ref</i> is a <a href="#sec-reference-specification-type">Reference</a> to an <a
href="#sec-environment-records">Environment Record</a> binding,
<ol class="block">
<li>Let <i>bindings</i> be <a href="#sec-reference-specification-type">GetBase</a>(<i>ref</i>).</li>
<li>Return <i>bindings</i>.DeleteBinding(<a
href="#sec-reference-specification-type">GetReferencedName</a>(<i>ref</i>)).</li>
</ol>
</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> When a <code>delete</code> operator occurs within <a href="#sec-strict-mode-code">strict
mode code</a>, a <b>SyntaxError</b> exception is thrown if its <i>UnaryExpression</i> is a direct reference to a
variable, function argument, or function name. In addition, if a <code>delete</code> operator occurs within <a
href="#sec-strict-mode-code">strict mode code</a> and the property to be deleted has the attribute { [[Configurable]]:
<b>false</b> }, a <b>TypeError</b> exception is thrown.</p>
</div>
</section>
</section>
<section id="sec-void-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.5"><a href="#sec-void-operator" title="link to this section">12.5.5</a></span> The
<code>void</code> Operator</h1>
</div>
<section id="sec-void-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.5.1"><a href="#sec-void-operator-runtime-semantics-evaluation"
title="link to this section">12.5.5.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">void</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>status</i> be <a href="#sec-getvalue">GetValue</a>(<i>expr</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <b>undefined</b>.</li>
</ol>
<div class="note">
<p><span class="nh">NOTE</span> <a href="#sec-getvalue">GetValue</a> must be called even though its value is not used
because it may have observable side-effects.</p>
</div>
</section>
</section>
<section id="sec-typeof-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.6"><a href="#sec-typeof-operator" title="link to this section">12.5.6</a></span> The
<code>typeof</code> Operator</h1>
</div>
<section id="sec-typeof-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.6.1"><a href="#sec-typeof-operator-runtime-semantics-evaluation"
title="link to this section">12.5.6.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">typeof</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>val</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>If <a href="#sec-ecmascript-data-types-and-values">Type</a>(<i>val</i>) is <a
href="#sec-reference-specification-type">Reference</a>, then
<ol class="block">
<li>If <a href="#sec-reference-specification-type">IsUnresolvableReference</a>(<i>val</i>) is <b>true</b>, return
<code>"undefined"</code>.</li>
</ol>
</li>
<li>Let <i>val</i> be <a href="#sec-getvalue">GetValue</a>(<i>val</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>val</i>).</li>
<li>Return a String according to <a href="#table-35">Table 35</a>.</li>
</ol>
<figure>
<figcaption><span id="table-35">Table 35</span> — typeof Operator Results</figcaption>
<table class="real-table">
<tr>
<th><b>Type of</b> <span style="font-family: Times New Roman">val</span></th>
<th>Result</th>
</tr>
<tr>
<td>Undefined</td>
<td><code>"undefined"</code></td>
</tr>
<tr>
<td>Null</td>
<td><code>"object"</code></td>
</tr>
<tr>
<td>Boolean</td>
<td><code>"boolean"</code></td>
</tr>
<tr>
<td>Number</td>
<td><code>"number"</code></td>
</tr>
<tr>
<td>String</td>
<td><code>"string"</code></td>
</tr>
<tr>
<td>Symbol</td>
<td><code>"symbol"</code></td>
</tr>
<tr>
<td>Object (ordinary and does not implement [[Call]])</td>
<td><code>"object"</code></td>
</tr>
<tr>
<td>Object (standard exotic and does not implement [[Call]])</td>
<td><code>"object"</code></td>
</tr>
<tr>
<td>Object (implements [[Call]])</td>
<td><code>"function"</code></td>
</tr>
<tr>
<td>Object (non-standard exotic and does not implement [[Call]])</td>
<td>Implementation-defined. Must not be <code>"undefined"</code>, <code>"boolean"</code>, <code>"function"</code>, <code>"number"</code>, <code>"symbol"</code>, or <code>"string".</code></td>
</tr>
</table>
</figure>
<div class="note">
<p><span class="nh">NOTE</span> Implementations are discouraged from defining new <code>typeof</code> result values for
non-standard exotic objects. If possible <code>"object"</code>should be used for such objects.</p>
</div>
</section>
</section>
<section id="sec-prefix-increment-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.7"><a href="#sec-prefix-increment-operator"
title="link to this section">12.5.7</a></span> Prefix Increment Operator</h1>
</div>
<section id="sec-prefix-increment-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.7.1"><a href="#sec-prefix-increment-operator-runtime-semantics-evaluation"
title="link to this section">12.5.7.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">++</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>Let <i>newValue</i> be the result of adding the value <code>1</code> to <i>oldValue</i>, using the same rules as for
the <code>+</code> operator (<a href="#sec-applying-the-additive-operators-to-numbers">see 12.7.5</a>).</li>
<li>Let <i>status</i> be <a href="#sec-putvalue">PutValue</a>(<i>expr</i>, <i>newValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <i>newValue</i>.</li>
</ol>
</section>
</section>
<section id="sec-prefix-decrement-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.8"><a href="#sec-prefix-decrement-operator"
title="link to this section">12.5.8</a></span> Prefix Decrement Operator</h1>
</div>
<section id="sec-prefix-decrement-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.8.1"><a href="#sec-prefix-decrement-operator-runtime-semantics-evaluation"
title="link to this section">12.5.8.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">--</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>Let <i>newValue</i> be the result of subtracting the value <code>1</code> from <i>oldValue</i>, using the same
rules as for the <code>-</code> operator (<a href="#sec-applying-the-additive-operators-to-numbers">see
12.7.5</a>).</li>
<li>Let <i>status</i> be <a href="#sec-putvalue">PutValue</a>(<i>expr</i>, <i>newValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>status</i>).</li>
<li>Return <i>newValue</i>.</li>
</ol>
</section>
</section>
<section id="sec-unary-plus-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.9"><a href="#sec-unary-plus-operator" title="link to this section">12.5.9</a></span>
Unary <code>+</code> Operator</h1>
<div class="note">
<p><span class="nh">NOTE</span> The unary + operator converts its operand to Number type.</p>
</div>
</div>
<section id="sec-unary-plus-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.9.1"><a href="#sec-unary-plus-operator-runtime-semantics-evaluation"
title="link to this section">12.5.9.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">+</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Return <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
</ol>
</section>
</section>
<section id="sec-unary-minus-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.10"><a href="#sec-unary-minus-operator"
title="link to this section">12.5.10</a></span> Unary <code>-</code> Operator</h1>
<div class="note">
<p><span class="nh">NOTE</span> The unary <code>-</code> operator converts its operand to Number type and then negates
it. Negating <b>+0</b> produces <b>−0</b>, and negating <b>−0</b> produces <b>+0</b>.</p>
</div>
</div>
<section id="sec-unary-minus-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.10.1"><a href="#sec-unary-minus-operator-runtime-semantics-evaluation"
title="link to this section">12.5.10.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">-</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-tonumber">ToNumber</a>(<a href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>If <i>oldValue</i> is <b>NaN</b>, return <b>NaN</b>.</li>
<li>Return the result of negating <i>oldValue</i>; that is, compute a Number with the same magnitude but opposite
sign.</li>
</ol>
</section>
</section>
<section id="sec-bitwise-not-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.11"><a href="#sec-bitwise-not-operator"
title="link to this section">12.5.11</a></span> Bitwise NOT Operator ( <code>~</code> )</h1>
</div>
<section id="sec-bitwise-not-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.11.1"><a href="#sec-bitwise-not-operator-runtime-semantics-evaluation"
title="link to this section">12.5.11.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">~</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-toint32">ToInt32</a>(<a href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>Return the result of applying bitwise complement to <i>oldValue</i>. The result is a signed 32-bit integer.</li>
</ol>
</section>
</section>
<section id="sec-logical-not-operator">
<div class="front">
<h1><span class="secnum" id="sec-12.5.12"><a href="#sec-logical-not-operator"
title="link to this section">12.5.12</a></span> Logical NOT Operator ( <code>!</code> )</h1>
</div>
<section id="sec-logical-not-operator-runtime-semantics-evaluation">
<h1><span class="secnum" id="sec-12.5.12.1"><a href="#sec-logical-not-operator-runtime-semantics-evaluation"
title="link to this section">12.5.12.1</a></span> Runtime Semantics: Evaluation</h1>
<div class="gp prod"><span class="nt">UnaryExpression</span> <span class="geq">:</span> <code class="t">!</code> <span class="nt">UnaryExpression</span></div>
<ol class="proc">
<li>Let <i>expr</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>oldValue</i> be <a href="#sec-toboolean">ToBoolean</a>(<a
href="#sec-getvalue">GetValue</a>(<i>expr</i>)).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>oldValue</i>).</li>
<li>If <i>oldValue</i> is <b>true</b>, return <b>false</b>.</li>
<li>Return <b>true</b>.</li>
</ol>
</section>
</section>
</section>
<section id="sec-multiplicative-operators">
<div class="front">
<h1><span class="secnum" id="sec-12.6"><a href="#sec-multiplicative-operators" title="link to this section">12.6</a></span>
Multiplicative Operators</h1>
<h2>Syntax</h2>
<div class="gp">
<div class="lhs"><span class="nt">MultiplicativeExpression</span><sub class="g-params">[Yield]</sub> <span class="geq">:</span></div>
<div class="rhs"><span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
<div class="rhs"><span class="nt">MultiplicativeExpression</span><sub class="g-params">[?Yield]</sub> <span class="nt">MultiplicativeOperator</span> <span class="nt">UnaryExpression</span><sub class="g-params">[?Yield]</sub></div>
</div>
<div class="gp">
<div class="lhs"><span class="nt">MultiplicativeOperator</span> <span class="geq">:</span> <span class="grhsmod">one of</span></div>
<div class="rhs"><code class="t">*</code> <code class="t">/</code> <code class="t">%</code></div>
</div>
</div>
<section id="sec-multiplicative-operators-static-semantics-isfunctiondefinition">
<h1><span class="secnum" id="sec-12.6.1"><a href="#sec-multiplicative-operators-static-semantics-isfunctiondefinition"
title="link to this section">12.6.1</a></span> Static Semantics: IsFunctionDefinition</h1>
<p>See also: <a href="#sec-semantics-static-semantics-isfunctiondefinition">12.2.0.2</a>, <a
href="#sec-grouping-operator-static-semantics-isfunctiondefinition">12.2.9.2</a>, <a
href="#sec-static-semantics-static-semantics-isfunctiondefinition">12.3.1.2</a>, <a
href="#sec-postfix-expressions-static-semantics-isfunctiondefinition">12.4.2</a>, <a
href="#sec-unary-operators-static-semantics-isfunctiondefinition">12.5.2</a>, <a
href="#sec-additive-operators-static-semantics-isfunctiondefinition">12.7.1</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isfunctiondefinition">12.8.1</a>, <a
href="#sec-relational-operators-static-semantics-isfunctiondefinition">12.9.1</a>, <a
href="#sec-equality-operators-static-semantics-isfunctiondefinition">12.10.1</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isfunctiondefinition">12.11.1</a>, <a
href="#sec-binary-logical-operators-static-semantics-isfunctiondefinition">12.12.1</a>, <a
href="#sec-conditional-operator-static-semantics-isfunctiondefinition">12.13.1</a>, <a
href="#sec-assignment-operators-static-semantics-isfunctiondefinition">12.14.2</a>, <a
href="#sec-comma-operator-static-semantics-isfunctiondefinition">12.15.1</a>, <a
href="#sec-function-definitions-static-semantics-isfunctiondefinition">14.1.11</a>, <a
href="#sec-generator-function-definitions-static-semantics-isfunctiondefinition">14.4.9</a>, <a
href="#sec-class-definitions-static-semantics-isfunctiondefinition">14.5.8</a>.</p>
<p><i>MultiplicativeExpression <b>:</b></i> <i>MultiplicativeExpression</i> <i>MultiplicativeOperator</i>
<i>UnaryExpression</i></p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget">
<h1><span class="secnum" id="sec-12.6.2"><a
href="#sec-multiplicative-operators-static-semantics-isvalidsimpleassignmenttarget"
title="link to this section">12.6.2</a></span> Static Semantics: IsValidSimpleAssignmentTarget</h1>
<p>See also: <a href="#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget">12.1.3</a>, <a
href="#sec-semantics-static-semantics-isvalidsimpleassignmenttarget">12.2.0.4</a>, <a
href="#sec-grouping-operator-static-semantics-isvalidsimpleassignmenttarget">12.2.9.3</a>, <a
href="#sec-static-semantics-static-semantics-isvalidsimpleassignmenttarget">12.3.1.5</a>, <a
href="#sec-postfix-expressions-static-semantics-isvalidsimpleassignmenttarget">12.4.3</a>, <a
href="#sec-unary-operators-static-semantics-isvalidsimpleassignmenttarget">12.5.3</a>, <a
href="#sec-additive-operators-static-semantics-isvalidsimpleassignmenttarget">12.7.2</a>, <a
href="#sec-bitwise-shift-operators-static-semantics-isvalidsimpleassignmenttarget">12.8.2</a>, <a
href="#sec-relational-operators-static-semantics-isvalidsimpleassignmenttarget">12.9.2</a>, <a
href="#sec-equality-operators-static-semantics-isvalidsimpleassignmenttarget">12.10.2</a>, <a
href="#sec-binary-bitwise-operators-static-semantics-isvalidsimpleassignmenttarget">12.11.2</a>, <a
href="#sec-binary-logical-operators-static-semantics-isvalidsimpleassignmenttarget">12.12.2</a>, <a
href="#sec-conditional-operator-static-semantics-isvalidsimpleassignmenttarget">12.13.2</a>, <a
href="#sec-assignment-operators-static-semantics-isvalidsimpleassignmenttarget">12.14.3</a>, <a
href="#sec-comma-operator-static-semantics-isvalidsimpleassignmenttarget">12.15.2</a>.</p>
<p><i>MultiplicativeExpression <b>:</b></i> <i>MultiplicativeExpression</i> <i>MultiplicativeOperator</i>
<i>UnaryExpression</i></p>
<ol class="proc">
<li>Return <b>false</b>.</li>
</ol>
</section>
<section id="sec-multiplicative-operators-runtime-semantics-evaluation">
<div class="front">
<h1><span class="secnum" id="sec-12.6.3"><a href="#sec-multiplicative-operators-runtime-semantics-evaluation"
title="link to this section">12.6.3</a></span> Runtime Semantics: Evaluation</h1>
<p><i>MultiplicativeExpression <b>:</b></i> <i>MultiplicativeExpression</i> <i>MultiplicativeOperator</i>
<i>UnaryExpression</i></p>
<ol class="proc">
<li>Let <i>left</i> be the result of evaluating <i>MultiplicativeExpression</i>.</li>
<li>Let <i>leftValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>left</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>leftValue</i>).</li>
<li>Let <i>right</i> be the result of evaluating <i>UnaryExpression</i>.</li>
<li>Let <i>rightValue</i> be <a href="#sec-getvalue">GetValue</a>(<i>right</i>).</li>
<li>Let <i>lnum</i> be <a href="#sec-tonumber">ToNumber</a>(<i>leftValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>lnum</i>).</li>
<li>Let <i>rnum</i> be <a href="#sec-tonumber">ToNumber</a>(<i>rightValue</i>).</li>
<li><a href="#sec-returnifabrupt">ReturnIfAbrupt</a>(<i>rnum</i>).</li>
<li>Return the result of applying the <i>MultiplicativeOperator</i> (*, /, or %) to <i>lnum</i> and <i>rnum</i> as
specified in <a href="#sec-applying-the-mul-operator">12.6.3.1</a>, <a
href="#sec-applying-the-div-operator">12.6.3.2</a>, or <a href="#sec-applying-the-mod-operator">12.6.3.3</a>.</li>
</ol>
</div>
<section id="sec-applying-the-mul-operator">
<h1><span class="secnum" id="sec-12.6.3.1"><a href="#sec-applying-the-mul-operator"
title="link to this section">12.6.3.1</a></span> Applying the <code>*</code> Operator</h1>
<p>The <code>*</code> <span class="nt">MultiplicativeOperator</span> performs multiplication, producing the product of its
operands. Multiplication is commutative. Multiplication is not always associative in ECMAScript, because of finite
precision.</p>
<p>The result of a floating-point multiplication is governed by the rules of IEEE 754 binary double-precision
arithmetic:</p>
<ul>
<li>
<p>If either operand is <b>NaN</b>, the result is <b>NaN</b>.</p>
</li>
<li>
<p>The sign of the result is positive if both operands have the same sign, negative if the operands have different
signs.</p>
</li>
<li>
<p>Multiplication of an infinity by a zero results in <b>NaN</b>.</p>
</li>
<li>
<p>Multiplication of an infinity by an infinity results in an infinity. The sign is determined by the rule already
stated above.</p>
</li>
<li>
<p>Multiplication of an infinity by a finite nonzero value results in a signed infinity. The sign is determined by the
rule already stated above.</p>
</li>
<li>
<p>In the remaining cases, where neither an infinity nor NaN is involved, the product is computed and rounded to the
nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too large to represent, the
result is then an infinity of appropriate sign. If the magnitude is too small to represent, the result is then a zero
of appropriate sign. The ECMAScript language requires support of gradual underflow as defined by IEEE 754.</p>
</li>
</ul>
</section>
<section id="sec-applying-the-div-operator">
<h1><span class="secnum" id="sec-12.6.3.2"><a href="#sec-applying-the-div-operator"
title="link to this section">12.6.3.2</a></span> Applying the <code>/</code> Operator</h1>
<p>The <code>/</code> <span class="nt">MultiplicativeOperator</span> performs division, producing the quotient of its
operands. The left operand is the dividend and the right operand is the divisor. ECMAScript does not perform integer
division. The operands and result of all division operations are double-precision floating-point numbers. The result of
division is determined by the specification of IEEE 754 arithmetic:</p>
<ul>
<li>
<p>If either operand is <b>NaN</b>, the result is <b>NaN</b>.</p>
</li>
<li>
<p>The sign of the result is positive if both operands have the same sign, negative if the operands have different
signs.</p>
</li>
<li>
<p>Division of an infinity by an infinity results in <b>NaN</b>.</p>
</li>
<li>
<p>Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated
above.</p>
</li>
<li>
<p>Division of an infinity by a nonzero finite value results in a signed infinity. The sign is determined by the rule
already stated above.</p>
</li>
<li>
<p>Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated
above.</p>
</li>
<li>
<p>Division of a zero by a zero results in <b>NaN</b>; division of zero by any other finite value results in zero,
with the sign determined by the rule already stated above.</p>
</li>
<li>
<p>Division of a nonzero finite value by a zero results in a signed infinity. The sign is determined by the rule
already stated above.</p>
</li>
<li>
<p>In the remaining cases, where neither an infinity, nor a zero, nor <b>NaN</b> is involved, the quotient is computed
and rounded to the nearest representable value using IEEE 754 round-to-nearest mode. If the magnitude is too large to
represent, the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small
to represent, the operation underflows and the result is a zero of the appropriate sign. The ECMAScript language
requires support of gradual underflow as defined by IEEE 754.</p>
</li>
</ul>
</section>
<section id="sec-applying-the-mod-operator">
<h1><span class="secnum" id="sec-12.6.3.3"><a href="#sec-applying-the-mod-operator"
title="link to this section">12.6.3.3</a></span> Applying the <code>%</code> Operator</h1>
<p>The <code>%</code> <span class="nt">MultiplicativeOperator</span> yields the remainder of its operands from an implied
division; the left operand is the dividend and the right operand is the divisor.</p>
<div class="note">
<p><span class="nh">NOTE</span> In C and C++, the remainder operator accepts only integral operands; in ECMAScript, it
also accepts floating-point operands.</p>
</div>
<p>The result of a floating-point remainder operation as computed by the <code>%</code> operator is not the same as the
“remainder” operation defined by IEEE 754. The IEEE 754 “remainder” operation computes the
remainder from a rounding division, not a truncating division, and so its behaviour is not analogous to that of the usual
integer remainder operator. Instead the ECMAScript language defines <code>%</code> on floating-point operations to behave
in a manner analogous to that of the Java integer remainder operator; this may be compared with the C library function
fmod.</p>
<p>The result of an ECMAScript floating-point remainder operation is determined by the rules of IEEE arithmetic:</p>
<ul>
<li>
<p>If either operand is <b>NaN</b>, the result is <b>NaN</b>.</p>
</li>
<li>
<p>The sign of the result equals the sign of the dividend.</p>
</li>
<li>
<p>If the dividend is an infinity, or the divisor is a zero, or both, the result is <b>NaN</b>.</p>
</li>
<li>
<p>If the dividend is finite and the divisor is an infinity, the result equals the dividend.</p>
</li>
<li>
<p>If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.</p>
</li>
<li>
<p>In the remaining cases, where neither an infinity, nor a zero, nor <b>NaN</b> is involved, the floating-point
remainder r from a dividend n and a divisor d is defined by the mathematical relation r = n − (d × q)
where q is an integer that is negative only if n/d is negative and positive only if n/d is positive, and whose
magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of n and d. r is
computed and rounded to the nearest representable value using IEEE 754 round-to-nearest mode.</p>
</li>
</ul>
</section>
</section>
</section>
</section>
</body>
</html>
|