Opened 18 months ago

Closed 18 months ago

Last modified 12 months ago

#6811 closed defect (fixed)

Blank values for snippet arguments are ignored

Reported by: mjethani Assignee: mjethani
Priority: P2 Milestone:
Module: Core Keywords: circumvention
Cc: kzar, rscott, Ross Blocked By:
Blocking: #6538 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

Description (last modified by mjethani)


Adblock Plus with Snippets as of changeset b3488684866c

How to reproduce

  1. Write a snippet function foo(one, two, three) { console.log("one=" + one, "two=" + two, "three=" + three); } in the snippets library
  2. Write a snippet filter$#foo 1 '' 3
  3. Visit

Observed behaviour

Prints one=1, two=3, three=undefined

Expected behaviour

Prints one=1, two=, three=3

Additional notes

The parsing code in lib/snippets.js needs to be modified to accept blank values for arguments.

Hints for testers

Try the filter$#$log Hello '' world on It should print "Hello" followed by "world" to the console, on the same line, but with two spaces between "Hello" and "world".

Change History (10)

comment:1 Changed 18 months ago by mjethani

  • Component changed from Unknown to Core

comment:2 Changed 18 months ago by mjethani

  • Sensitive set

comment:3 Changed 18 months ago by mjethani

  • Owner set to mjethani

comment:4 Changed 18 months ago by mjethani

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:5 Changed 18 months ago by abpbot

A commit referencing this issue has landed:
Issue 6811 - Parse blank arguments to snippets correctly

comment:6 Changed 18 months ago by mjethani

  • Description modified (diff)

comment:7 Changed 18 months ago by mjethani

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:8 Changed 18 months ago by mjethani

  • Cc rscott Ross added

comment:9 Changed 15 months ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Fixed. Blank values are not ignored.

Firefox 62 / 51 / Windows 10
Chrome 69 / 49 / Windows 10
Opera 56 / 36 / Windows 10

comment:10 Changed 12 months ago by mjethani

  • Sensitive unset
Note: See TracTickets for help on using tickets.