Skip to content

Commit 25b184f

Browse files
committed
Revert "Add location revival for easier record/replay (#757)"
This reverts commit 6233018.
1 parent 9337df3 commit 25b184f

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

modules/Location.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@ var PathUtils = require('./PathUtils');
99
*/
1010
class Location {
1111

12-
/**
13-
* Revives the location from its serialized form.
14-
* Use `Location.revive` as a second argument to `JSON.parse`.
15-
*
16-
* var serialized = JSON.stringify(location);
17-
* var deserialized = JSON.parse(serialized, Location.revive);
18-
*
19-
*/
20-
static revive(key, value) {
21-
if (key === '') {
22-
return new Location(value.path, value.navigationType);
23-
} else {
24-
return value;
25-
}
26-
}
27-
2812
constructor(path, navigationType) {
2913
this.path = path;
3014
this.navigationType = navigationType || NavigationTypes.POP;
@@ -42,13 +26,6 @@ class Location {
4226
return PathUtils.getQuery(this.path, options);
4327
}
4428

45-
toJSON() {
46-
return {
47-
path: this.path,
48-
navigationType: this.navigationType
49-
};
50-
}
51-
5229
}
5330

5431
module.exports = Location;

modules/__tests__/Location-test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
var expect = require('expect');
22
var Location = require('../Location');
3-
var NavigationTypes = require('../NavigationTypes');
43

54
describe('Location', function () {
65
var location;
76

8-
it('can be revived', function () {
9-
location = new Location('/the/path', NavigationTypes.POP);
10-
11-
var serialized = JSON.stringify(location);
12-
var revived = JSON.parse(serialized, Location.revive);
13-
14-
expect(revived instanceof Location).toEqual(true);
15-
expect(revived.path).toEqual(location.path);
16-
expect(revived.navigationType).toEqual(location.navigationType);
17-
});
18-
197
describe('with a query string', function () {
208
beforeEach(function () {
219
location = new Location('/the/path?the=query');

0 commit comments

Comments
 (0)