Skip to content

some.object && some.object.fn() and this.object && this.object.value not handled #51

@connorjclark

Description

@connorjclark

I used this tool on a large codebase, and came across some cases that were missed. Here's
everything I found:

GoogleChrome/lighthouse#13503 (comment)
(link to code at particular commit)
https://github.com/GoogleChrome/lighthouse/tree/11a6a030f3e29910be6dc1166f17e085c17da6da

I believe the following specific examples show every unique case missed.


Does not transform:

const hasMetricError = lhr.categories.performance && lhr.categories.performance.auditRefs
  .some(audit => Boolean(audit.group === 'metrics' && lhr.audits[audit.id].errorMessage));

But it will transform this:

const hasMetricError = lhr.categories.performance && lhr.categories.performance.auditRefs;

Perhaps function calls are not handled?


Does not transform:

this.json.audits['script-treemap-data'] && this.json.audits['script-treemap-data'].details

or

this.json.audits.blah && this.json.audits.blah.details

Perhaps this. is not handled?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions