<html>
    <body>
        <h1>Async/Await test page</h1>
        <p>
            This page tests how your browser handles the async and await
            keywords defined in ES2017. A function can be declared async. This
            means the function returns a Promise which may resolve later. Within
            an async function the await keyword can be used. The await keyword
            pauses the execution of the async function until the value awaited
            on resolves, or rejects. A resolved value is returned by the await
            keyword and a reject value is thrown. Together these keywords allow
            asynchronous code to be written as though it was synchronous.
        </p>
        <div>
            <table>
                <tr><th colspan="3">This table shows the result of awaiting on
                    different values in an async method</th></tr>
                <tr>
                    <th>Value awaited on</th>
                    <th>The value returned by await</th>
                    <th>The value thrown by await</th>
                <tr>
                <tr>
                    <td>Promise resolved to 5</td>
                    <td id="result-0"></td>
                    <td id="error-0"></td>
                </tr>
                <tr>
                    <td>Promise rejected with an error</td>
                    <td id="result-1"></td>
                    <td id="error-1"></td>
                </tr>
            </table>
        </div>

        <script>
            // The values used by the test
            const value = 5;
            const resolvedPromise = new Promise((resolve, reject) => {
                resolve(value);
            });
            const error = new Error('An error');
            const rejectedPromise = new Promise((resolve, reject) => {
                reject(error);
            });

            // The asynchronous function using await
            async function awaitOn(resultId, errorId, value) {
                try {
                    document.getElementById(resultId).innerText = await value;
                }
                catch (e) {
                    document.getElementById(errorId).innerText = e;
                }
            }

            // Pass different values to the asynchronous function to await on
            awaitOn('result-0', 'error-0', resolvedPromise);
            awaitOn('result-1', 'error-1', rejectedPromise);
        </script>
    </body>
</html>

Add a test page for async await that awaits on resolved and rejected promises.
Add a test page for async await that awaits on resolved and rejected promises.
