Skip to content

Commit

Permalink
Lulu: Fix unreachable code after return statement warnings
Browse files Browse the repository at this point in the history
And fix inconsistent return
  • Loading branch information
dstillman committed Oct 24, 2024
1 parent 76fab72 commit a90a241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lulu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 12,
"browserSupport": "gcsibv",
"lastUpdated": "2023-04-27 09:24:18"
"lastUpdated": "2024-10-24 04:02:00"
}

function getSearchResults(doc) {

Check warning on line 15 in Lulu.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Missing license block
Expand Down Expand Up @@ -102,11 +102,11 @@ function makeItem(doc, url) {

function detectSearch(items) {

Check failure on line 103 in Lulu.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Expected to return a value at the end of function 'detectSearch'
// Disabled -- no longer working
return false;
if (false) return false;

Check failure on line 105 in Lulu.js

View workflow job for this annotation

GitHub Actions / Lint, Check, Test

Unexpected constant condition

if (items.ISBN) return true;

if (!items.length) return;
if (!items.length) return false;

for (var i=0, n=items.length; i<n; i++) {
if (items[i].ISBN && ZU.cleanISBN('' + items[i].ISBN)) {
Expand Down

2 comments on commit a90a241

@AbeJellinek
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I'm confused about what we want here. detectSearch was disabled in ecb80fa. Now we have a comment saying detectSearch is disabled, one line above a disabling return statement that is itself now disabled. We're making a request to Lulu for each ISBN that other search translators can't resolve, but the translator is still broken.

Should we just make this a web translator only? Or try to fix it?

@dstillman
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that was supposed to be a true! Thanks for catching that.

I've fixed, but yeah, we could just remove the search stuff altogether.

Please sign in to comment.