Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit d5f92bd

Browse files
committed
FIXED changing location.hash should be synchronous #781
1 parent 9275c1d commit d5f92bd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ FIXED updated to JSDOM 1.2.1
66

77
FIXED browser.evaluate({throws error}) should throw an error #790
88

9+
FIXED changing location.hash should be synchronous #781
10+
911
681 passing
1012
10 sec to complete
1113

src/zombie/history.coffee

+8-2
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,19 @@ createLocation = (history, url)->
321321
Object.defineProperties location,
322322
assign:
323323
value: (url)->
324-
browser.eventLoop.next ->
324+
if hashChange(history.current, url)
325325
history.assign(url)
326+
else
327+
browser.eventLoop.next ->
328+
history.assign(url)
326329

327330
replace:
328331
value: (url)->
329-
browser.eventLoop.next ->
332+
if hashChange(history.current, url)
330333
history.replace(url)
334+
else
335+
browser.eventLoop.next ->
336+
history.replace(url)
331337

332338
reload:
333339
value: (force)->

test/history_test.js

-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ describe('History', function() {
351351
browser.document.body.innerHTML = '<html><body>Wolf</body></html>';
352352
browser.window.addEventListener('hashchange', ()=> done());
353353
browser.window.location.hash = 'boo';
354-
browser.wait();
355354
});
356355

357356
it('should add page to history', function() {

0 commit comments

Comments
 (0)