Closed mbrevda closed 6 years ago
Could you try replacing
new RegExp(expandsOnNFD, 'g')
with
new RegExp(expandsOnNFD.source, 'g')
?
I guess the copying of regex objects is an ES6 feature that Babel is not yet polyfilling.
If the fix above works, it'd be helpful to know whether there are any other issues in such older browsers (ideally tested against our various browser tests) as it'd be nicer to keep with the more succinct syntax if it's not going to be possible to support older browsers anyways (though of course, if we can support, that would be ideal).
I can confirm that on this Safari 6 esqueue browser, adding .source
prevents the error.
Sorry been busy--this should be addressed by https://github.com/babel/babel/issues/5978 for which I hope to get to a PR, though probably not at least for a week or so.
I think I mentioned that we didn't go with indexeddbshim in the end, so I'm not holding my breath. Thanks for the update thought!
On Wed, Jul 26, 2017, 8:15 PM Brett Zamir notifications@github.com wrote:
Sorry been busy--this should be addressed by babel/babel#5978 https://github.com/babel/babel/issues/5978 for which I hope to get to a PR, though probably not at least for a week or so.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/axemclion/IndexedDBShim/issues/311#issuecomment-318121603, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4jLsFhq5fqnfzdyJGBTRJAfNA37a9ks5sR3RIgaJpZM4ObNqj .
Sorry but when you were testing it, do you recall whether you were including the babel polyfill file or only the indexeddbshim file?
I think I tired with the polyfill, but don't recall
On Fri, Aug 4, 2017, 12:54 AM Brett Zamir notifications@github.com wrote:
Sorry but when you were testing it, do you recall whether you were including the babel polyfill file or only the indexeddbshim file?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/axemclion/IndexedDBShim/issues/311#issuecomment-320100662, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4jDTWhwvhiVyQVUQWRHN7eQvYqjveks5sUkGtgaJpZM4ObNqj .
Going to close this unless someone else can confirm the babel polyfill doesn't solve it...
Babel polyfill using Babel 7 with babel-preset-env useBuiltIns set to 'entry' doesn't work. It results in "Cannot supply flags when constructing one RegExp from another"
Docs about useBuiltIns: https://new.babeljs.io/docs/en/babel-preset-env.html#usebuiltins
I made an example here https://github.com/StabbarN/indexeddbshim-regexp
'@babel/polyfill'
to webpack entry, see https://github.com/StabbarN/indexeddbshim-regexp first commit, that is https://github.com/StabbarN/indexeddbshim-regexp/commit/3821b2959bb1ad920021fc1ee370c6c443efe29cIt seems like Babel's preset-env strips some regexp polyfill.
It'd be great if you could take a look at https://github.com/babel/babel/issues/5978 or at least report your test case there... I'm pretty limited atm to investigate more closely...
Thank you very much for building that test case and reporting this to Babel, @StabbarN (and @mbrevda for the original issue). Glad we can use more elegant code as well as solve things at the root, but if it takes too long, let me know and we can just add the longer way...
In publishing 3.6.0 just now, I went ahead and stomached the 7 extra characters to make it work for everybody. :-) I made a note to revert once Babel may apply a fix.
No release yet but this PR seems to fix it https://github.com/babel/babel/pull/7809
When duplicating regexes on some older browsers, flags cannot be added (testing Safari 6 atm, due to embedded device constraints). My particular error is being thrown on
in which case
expandsOnNFD
is already a regex, which is being duplicated.Here is a test case: http://jsbin.com/nidevotuqi Im currently including the code from here