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: NativescriptQueryRunner's query method fails when targeting es2017 #8182

Merged
merged 2 commits into from Oct 6, 2021

Conversation

pekevski
Copy link
Contributor

Making the promise async now correctly scopes the handler. this.driver is now defined.
Additional corrections were made to the syntax, eg conditionals.

Closes #8180

Description of change

I believe making the promise async will now correctly scope this in the handler function. When it references this.driver, on running a query the app would throw an exception stating that driver was undefined.

Tested this change with NS8 projects and it doesn't throw the error anymore.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change N/A
  • Documentation has been updated to reflect this change N/A
  • The new commits follow conventions explained in CONTRIBUTING.md

…r.ts

Making the promise async now correctly scopes the handler. this.driver is now defined.
Additional corrections were made to the syntax, eg conditionals.

Closes typeorm#8180
@imnotjames
Copy link
Contributor

I'm going to change the title of this PR to

fix: NativescriptQueryRunner's query method fails when targeting es2017 - what do you think? That'll be the message that shows up on the commit, as well.

@imnotjames imnotjames changed the title fix: correctly scope the "handler" function in NativescriptQueryRunner fix: NativescriptQueryRunner's query method fails when targeting es2017 Oct 5, 2021
@pekevski
Copy link
Contributor Author

pekevski commented Oct 5, 2021

Yep 👍 sounds good to me. Thank you

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.

NativeScript Query Runner has a scope issue in its query() method
2 participants