Page MenuHomePhabricator

WikiPEG: Drop legacy (IE8) and unused code
Open, LowPublic

Description

Port some PEG.js code updates since 2016

See: #441: Drop IE8 support and update code accordingly

  • Replace arrays.each with native Array.prototype.forEach
  • Replace arrays.every with native Array.prototype.every
  • Replace arrays.some with native Array.prototype.some
  • Remove arrays.pluck, arrays.map (unused)
  • Replace objects.keys with native Object.prototype.keys
  • Replace for loops with suitable array methods
  • Replace instanceof Array with Array.isArray()
  • Delete "opcodes.js" file (unused)

Need to determine what to do with ".pegjs" example files. Do we keep them (and maintain them)? Do we update the code to drop IE8 support as well? Or do we just drop them and defer to PEG.js's examples?

See https://github.com/pegjs/pegjs/commit/b81afb147129504f1d35ca11764a289548261f6c

  • Don't quote "class"

Others

  • Fix typos, convert var to const or let, use arrow functions

Event Timeline

Change 511820 had a related patch set uploaded (by Dan1wang; owner: Dan1wang):
[wikipeg@master] Drop legacy & unused code (T224084). Avoid use of "discard" (T224085)

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

ssastry edited projects, added WikiPEG; removed Parsoid.