-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Cannot supply flags when constructing one RegExp from another. #311
Comments
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 |
Sorry been busy--this should be addressed by babel/babel#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 ***@***.***> wrote:
Sorry been busy--this should be addressed by babel/babel#5978
<babel/babel#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
<#311 (comment)>,
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 ***@***.***> 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
<#311 (comment)>,
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
It seems like Babel's preset-env strips some regexp polyfill. |
It'd be great if you could take a look at babel/babel#5978 or at least report your test case there... I'm pretty limited atm to investigate more closely... |
…porarily circumvent current limitations in Babel until <babel/babel#5978> addressed; (see also <indexeddbshim#311 (comment)>); fixes indexeddbshim#311 - Linting: Expand ESLint file coverage and apply minor linting fix to test file - npm: Update `eventtargeter` to avoid automatic `Object.setPrototypeOf` calls (make conditional on `CFG.fullIDLSupport`); fixes indexeddbshim#313 - npm: Bump to 3.6.0
…porarily circumvent current limitations in Babel until <babel/babel#5978> addressed; (see also <indexeddbshim#311 (comment)>); fixes indexeddbshim#311 - Linting: Expand ESLint file coverage and apply minor linting fix to test file - Testing: Update web-platform-tests and our tests accordingly - npm: Update `eventtargeter` to avoid automatic `Object.setPrototypeOf` calls (make conditional on `CFG.fullIDLSupport`); fixes indexeddbshim#313 - npm: Bump to 3.6.0
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 babel/babel#7809 |
- Linting (ESLint): As per latest ash-nazg - Build: Set `preventAssignment: true` in `@rollup/plugin-replace` - Refactoring: Switch to native `padStart` given minimum Node version - Refactoring: Switch to copy RegExp constructor now that Babel should have fixed (see #311) - npm: Update `unicode-10.0.0` to `@unicode/unicode-13.0.0` - npm: Change from deprecated `request`/`request-promise-native` to `got` - npm: Update `typeson`, `typeson-registry` deps. - npm: Remove `regenerator-runtime` dep. - npm: Remove `remark` - npm: Update devDeps. - npm: Bump to 7.1.0
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
The text was updated successfully, but these errors were encountered: