blob: 5cf81ff6a3a7df9fff41d8029abdcdb4e1c737fc [file] [log] [blame]
<script src="../resources/js-test-pre.js"></script>
<script>
description("Tests that navigator.geolocation cannot be shadowed.");
function testInStrictMode()
{
"use strict";
try {
navigator.geolocation = 1;
testFailed("navigator.geolocation = 1 did not throw exception.");
} catch (e) {
testPassed("navigator.geolocation = 1 threw exception " + e + ".");
}
shouldNotBe("navigator.geolocation", "1");
}
function testInNonStrictMode()
{
shouldNotThrow("navigator.geolocation = 1");
shouldNotBe("navigator.geolocation", "1");
}
debug("* Strict mode");
testInStrictMode();
debug ("* Non-Strict mode");
testInNonStrictMode();
</script>
<script src="../resources/js-test-post.js"></script>