Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make google_search_features.js work on pages without CSS #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@@ -95,7 +95,7 @@ const BlinkFeatureNameToCaniuseName = {
* @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