blob: 0593420d40d028e1939865f5ebb95fab14e8b95c (
plain)
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
|
<!DOCTYPE HTML>
<html>
<head>
<title>location_replace</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function () {
var href = location.href;
location.replace('#x');
assert_equals((href + "#x"), location.href, "location href");
}, "location replace");
test(function () {
var href = location.href;
assert_throws_dom('SYNTAX_ERR', function() { location.replace("//"); });
assert_equals(location.href, href);
}, "URL that fails to parse");
</script>
</body>
</html>
|