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

Fix usage of String#includes which is es6 but not transformed by buble #8565

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

ahk
Copy link
Contributor

@ahk ahk commented Jul 27, 2019

Fix a usage of String#includes which breaks in any non-es6 browser and is also not handled by buble transformation.

  • briefly describe the changes in this PR

@@ -178,7 +178,7 @@ export class RequestManager {
if (accessToken[0] === 's')
throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${help}`);

urlObject.params = urlObject.params.filter((d) => !d.includes('access_token'));
urlObject.params = urlObject.params.filter((d) => d.indexOf('access_token') !== -1);
Copy link
Member

Choose a reason for hiding this comment

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

Invert the comparison — "not includes" will translate to indexOf(...) === -1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you Vlad. Classic.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

👍 pending rebase after newlines fix (or fixing it in this PR because it's not a big deal)

@ahk ahk force-pushed the fix-includes-usage branch from 3743980 to dec814a Compare July 29, 2019 16:46
@mourner mourner merged commit 4ffd0e2 into master Jul 29, 2019
@mourner mourner deleted the fix-includes-usage branch July 29, 2019 16:54
mourner added a commit that referenced this pull request Jul 30, 2019
* origin/publisher-production:
  update version to v1.2.0 (#8562)
  Fix usage of String.includes which is es6 but not transformed by buble (#8565) (#8573)
  [docs] fix missing location prop to feedback component (#8554)
  Fix typo
  [docs] update dr-ui (#8548)
  [docs] fix errors on IE11 caused by dr-ui dependencies (#8544)
  updates directions plugin version (#8536)
  add dds sdk support
  squash (#8529)
  [docs] adds feedback component (#8507)
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