Newer
Older
minerva / Tests / LibWeb / Text / input / HTML / storage-does-not-have-legacy-override-builtins-flag.html
@minerva minerva on 13 Jul 670 bytes Initial commit
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
    test(() => {
        for (const functionName of ["key", "getItem", "setItem", "removeItem", "clear"]) {
            const failFunction = function () { println(`FAIL: Overriden ${functionName} was called`); };
            window.localStorage[functionName] = failFunction;

            println(`${functionName} should still be native: '${window.localStorage[functionName].toString()}'`);
            println(`${functionName}'s stringified function was added to storage: '${window.localStorage.getItem(functionName)}'`);
            window.localStorage[functionName]("1", "2");
        }
    });
</script>