Skip to content

Conversation

fritz-c
Copy link

@fritz-c fritz-c commented Mar 15, 2018

When no CSS features are used at the specified URL, it exits with an error:

(node:11369) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'reduce' of undefined
    at uniqueByProperty (google_search_features.js:99:34)
    at google_search_features.js:244:22
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)

The content of the failing page was as follows:

Hi
<script type="text/javascript">
  console.log(['a', 'b'].includes('b') ? 'has b' : 'no b');
</script>

This pull request provides a default argument to one of the utility functions to prevent said reduce errors.

/**
* Unique items based on obj property.
* @param {!Array} items
* @param {string} propName Property name to filter on.
Copy link
Contributor

@ebidel ebidel Mar 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first doc string needs to be {!Array=}, now

@ebidel
Copy link
Contributor

ebidel commented Mar 15, 2018

Good catch!

@ebidel
Copy link
Contributor

ebidel commented Oct 8, 2018

Ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants