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

ESNext compatibility #812

Merged
merged 2 commits into from
Mar 22, 2019
Merged

ESNext compatibility #812

merged 2 commits into from
Mar 22, 2019

Conversation

mcshaz
Copy link
Contributor

@mcshaz mcshaz commented Mar 22, 2019

I think this will meet requirements for #811. It is in 2 commits (which I would advise squashing if you accept pull request). I ran all tests with the 1st commit, and all passed.

I think this is attaching the _global (ECMAScript) Promise high enough in the dependency chain that it is the native Promise implementation being added. I would assume if I was attaching the Dexie.promise at the wrong stage to the _global.Promise, the tests would fail after the 1st commit.

I also change template literal (back tick) to simple string as I think it is slightly more readable - I kept looking for the ${ insertion point, which wasn't there.

Thanks for creating this great library by the way.

Also removed template literal to plain string, as not templating needed
all 239 tests passed on my machine with the prior commit (which would have been bypassed with the current if clause when running on a browser)
Copy link
Collaborator

@dfahlander dfahlander left a comment

Choose a reason for hiding this comment

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

Esnext change of removing Promise from global was new to me. I will need to read more about this. The code changes are trivial and as I understand it, by making sure Promise is put on global also in Esnext, the existing Dexie code will continue to work as before. Thanks for finding out a solution.

@dfahlander dfahlander merged commit 01dc4c3 into dexie:master Mar 22, 2019
dfahlander added a commit that referenced this pull request Mar 22, 2019
Old browsers that do not have Promise on window seems to fail. Fixing by verifying typeof Promise === 'object' before applying the #812 workaround.
@dfahlander dfahlander mentioned this pull request Mar 22, 2019
dfahlander added a commit that referenced this pull request Mar 22, 2019
Old browsers that do not have Promise on window seems to fail. Fixing by verifying typeof Promise === 'object' before applying the #812 workaround.
dfahlander added a commit that referenced this pull request Mar 25, 2019
typeof Promise is either "undefined" or "function".
Also added some comments explaining why this statement is there.
#812
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.

None yet

2 participants