Page MenuHomePhabricator

Extension:SiteScout needless use of eval in JS
Closed, ResolvedPublic

Description

https://github.com/wikimedia/mediawiki-extensions-SiteScout/blob/master/resources/js/SiteScout.js#L207
has the line:

eval( 'SiteScout.' + stat + 's_count=' + 'SiteScout.' + stat + 's_count+1;' );

which should probably be replaced with:

SiteScout[ stat + "s_count" ]++;

I assume that there are slower ways to increment an integer but...

Also https://github.com/wikimedia/mediawiki-extensions-SiteScout/blob/master/resources/js/SiteScout.js#L236 looks like maybe a bug, shouldn't it be this?

SiteScout.networkupdates = $util.data( 'networkupdates' );

Event Timeline

Change 326405 had a related patch set uploaded (by Jack Phoenix):
Remove unnecessary eval() fix typo

https://gerrit.wikimedia.org/r/326405

Change 326405 merged by jenkins-bot:
Remove unnecessary eval() fix typo

https://gerrit.wikimedia.org/r/326405

ashley claimed this task.
ashley removed a project: Patch-For-Review.
ashley subscribed.

Fixed, thanks!