clean up slowparse by refactoring calls to parser.domBuilder.currentNode

RESOLVED FIXED

Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: pomax, Unassigned)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
if we're pulling data out of parser.domBuilder.currentNode more than once, we should cache that as:

var currentNode = parser.domBuilder.currentNode;

and then do

return {
  openTag: this._combine({
    name: currentNode.nodeName.toLowerCase()
  }, currentNode.parseInfo.openTag),
...

We're doing a lot of duplicated data pulling in a lot of places atm.

Comment 1

5 years ago
I will take it.
Flags: needinfo?(pomax)

Comment 3

5 years ago
(In reply to xdchen from comment #2)
> Created attachment 829918 [details] [review]
> https://github.com/mozilla/slowparse/pull/59

this one is in
Flags: needinfo?(pomax)
(Reporter)

Updated

5 years ago
Attachment #830817 - Flags: review?(pomax) → review+
(Reporter)

Comment 6

5 years ago
landed
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.