Skip to content

Commit dda87a5

Browse files
VilkkuSunil Pai
authored andcommitted
Do not consider history.replaceState() deprecated (#200)
1 parent 4793307 commit dda87a5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

transforms/class.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,23 @@ module.exports = (file, api, options) => {
179179
(acc, name) =>
180180
acc + j(classPath)
181181
.find(j.Identifier, {name})
182+
.filter(path => {
183+
// Do not consider history.replaceState() deprecated
184+
let correctContext = true;
185+
186+
if (
187+
name === 'replaceState' &&
188+
path.parentPath &&
189+
path.parentPath.value &&
190+
path.parentPath.value.object &&
191+
path.parentPath.value.object.name &&
192+
path.parentPath.value.object.name === 'history'
193+
) {
194+
correctContext = false;
195+
}
196+
197+
return correctContext;
198+
})
182199
.size(),
183200
0
184201
) > 0;

0 commit comments

Comments
 (0)