Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d0a66ed

Browse files
committed
WIP: use defineGetter for IE8 in browserSpec
1 parent 9845cee commit d0a66ed

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

test/ng/browserSpecs.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,27 @@ function MockWindow(options) {
4646
};
4747

4848
this.location = {
49-
get href() {
50-
return locationHref;
51-
},
52-
set href(value) {
53-
locationHref = value;
54-
mockWindow.history.state = null;
55-
historyEntriesLength++;
56-
},
57-
get hash() {
58-
return getHash(locationHref);
59-
},
60-
set hash(value) {
61-
locationHref = stripHash(locationHref) + '#' + value;
62-
},
6349
replace: function(url) {
6450
locationHref = url;
6551
mockWindow.history.state = null;
6652
}
6753
};
6854

55+
this.location.__defineGetter__('href', function getHref() {
56+
return locationHref;
57+
});
58+
this.location.__defineSetter__('href', function setHref(value) {
59+
locationHref = value;
60+
mockWindow.history.state = null;
61+
historyEntriesLength++;
62+
});
63+
this.location.__defineGetter__('hash', function getHash() {
64+
return getHash(locationHref);
65+
});
66+
this.location.__defineSetter__('hash', function setHash(value) {
67+
locationHref = stripHash(locationHref) + '#' + value;
68+
});
69+
6970
this.history = {
7071
replaceState: noop,
7172
pushState: noop

0 commit comments

Comments
 (0)