Merge "Pass empty string to unused argument of pushState/replaceState"

This commit is contained in:
jenkins-bot 2022-08-09 20:48:12 +00:00 committed by Gerrit Code Review
commit 91a94fe9bb
2 changed files with 4 additions and 4 deletions

View file

@ -238,7 +238,7 @@ NewTopicController.prototype.teardown = function ( abandoned ) {
url.searchParams.delete( 'action' ); url.searchParams.delete( 'action' );
url.searchParams.delete( 'veaction' ); url.searchParams.delete( 'veaction' );
url.searchParams.delete( 'section' ); url.searchParams.delete( 'section' );
history.replaceState( null, document.title, url ); history.replaceState( null, '', url );
mw.config.set( 'wgDiscussionToolsStartNewTopicTool', false ); mw.config.set( 'wgDiscussionToolsStartNewTopicTool', false );
} }
}; };

View file

@ -225,7 +225,7 @@ function highlightPublishedComment( threadItemSet, threadItemId ) {
var urlFragment = mw.util.escapeIdForLink( sectionTitle ); var urlFragment = mw.util.escapeIdForLink( sectionTitle );
// Navigate to fragment without scrolling // Navigate to fragment without scrolling
location.hash = '#' + urlFragment + '-DoesNotExist-DiscussionToolsHack'; location.hash = '#' + urlFragment + '-DoesNotExist-DiscussionToolsHack';
history.replaceState( null, document.title, '#' + urlFragment ); history.replaceState( null, '', '#' + urlFragment );
} }
} else { } else {
// Find the comment we replied to, then highlight the last reply // Find the comment we replied to, then highlight the last reply
@ -371,7 +371,7 @@ function clearHighlightTargetComment( threadItemSet ) {
// doesn't exist on the page, hopefully), and then use history.pushState() to clear it. // doesn't exist on the page, hopefully), and then use history.pushState() to clear it.
location.hash += '-DoesNotExist-DiscussionToolsHack'; location.hash += '-DoesNotExist-DiscussionToolsHack';
url.hash = ''; url.hash = '';
history.replaceState( null, document.title, url ); history.replaceState( null, '', url );
} else if ( } else if (
url.searchParams.has( 'dtnewcomments' ) || url.searchParams.has( 'dtnewcomments' ) ||
url.searchParams.has( 'dtnewcommentssince' ) url.searchParams.has( 'dtnewcommentssince' )
@ -379,7 +379,7 @@ function clearHighlightTargetComment( threadItemSet ) {
url.searchParams.delete( 'dtnewcomments' ); url.searchParams.delete( 'dtnewcomments' );
url.searchParams.delete( 'dtnewcommentssince' ); url.searchParams.delete( 'dtnewcommentssince' );
url.searchParams.delete( 'dtinthread' ); url.searchParams.delete( 'dtinthread' );
history.pushState( null, document.title, url ); history.pushState( null, '', url );
highlightTargetComment( threadItemSet ); highlightTargetComment( threadItemSet );
} else if ( highlightedTarget ) { } else if ( highlightedTarget ) {
// Highlights were applied without changing the URL, e.g. when showing // Highlights were applied without changing the URL, e.g. when showing