Skip to content

Truly independent web browser

855 B
Raw Blame
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
    asyncTest((done) => {
        const xhr = new XMLHttpRequest();
        xhr.responseType = "json";
        xhr.onreadystatechange = async function() {
            if (xhr.readyState === 4 && xhr.status === 200) {
                if (xhr.response.answer === 42)
                    println("PASS");
                else
                    println("FAIL");
                if (xhr.response === xhr.response)
                    println("PASS");
                else
                    println("FAIL");
                xhr.response.extra = "survives GC";
                internals.gc();
                println(xhr.response.extra);
                done();
            }
        };
        xhr.open("GET", 'data:application/json,{"answer":42}', true);
        xhr.send();
    });
</script>