librelist archives

« back to archive

Completer error

Completer error

From:
Phil Hudson
Date:
2015-02-24 @ 14:41
Think I may have found a bug in modules/completers.js, lines 108-111, method
all_word_completer.prototype.complete


It manifests when I do M-x download-show and then in the minibuffer press 
tab. (There's only one
active download, so that *should* be completed). I get:

  Call interactively: TypeError: s.toLowerCase is not a function


Now, my JS-fu is limited at best, but it seems to me that this is most 
likely line 111 erroring.
That in turn suggests that line 108 ought to check for null and substitute
"", a common idiom in
JS, right?

So:

  var s = c.get_string(x); 

should be: 

  var s = c.get_string(x) || "";                         

Does that look right? Or is c.get_string(x) something that can be
asserted never to return null, and the problem I'm seeing lies
elsewhere?

Caveat: I have *not* replicated this with -q

-- 
Phil Hudson                   http://hudson-it.ddns.net
@UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63

Re: [conkeror] Completer error

From:
Scott Jaderholm
Date:
2015-02-25 @ 14:12
The bug and an unapplied patch. http://bugs.conkeror.org/issue484

Scott

On Tue, Feb 24, 2015 at 6:41 AM, Phil Hudson <phil.hudson@iname.com> wrote:

> Think I may have found a bug in modules/completers.js, lines 108-111,
> method
> all_word_completer.prototype.complete
>
> It manifests when I do M-x download-show and then in the minibuffer press
> tab. (There's only one
> active download, so that *should* be completed). I get:
>
>   Call interactively: TypeError: s.toLowerCase is not a function
>
> Now, my JS-fu is limited at best, but it seems to me that this is most
> likely line 111 erroring.
> That in turn suggests that line 108 ought to check for null and substitute
> "", a common idiom in
> JS, right?
> So:
>
>   var s = c.get_string(x);
>
> should be:
>
>   var s = c.get_string(x) || "";
>
> Does that look right? Or is c.get_string(x) something that can be
> asserted never to return null, and the problem I'm seeing lies
> elsewhere?
>
> Caveat: I have *not* replicated this with -q
>
> --
> Phil Hudson                   http://hudson-it.ddns.net
> @UWascalWabbit                 PGP/GnuPG ID: 0x887DCA63
>