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-regexp caused a 'assign to read only property' error #461

Closed
RequireSun opened this issue Dec 6, 2018 · 6 comments
Closed

fix-regexp caused a 'assign to read only property' error #461

RequireSun opened this issue Dec 6, 2018 · 6 comments

Comments

@RequireSun
Copy link

I use it in a weex project, and when i called string.prototype.split function in my code, it goes wrong with Cannot assign to read only property 'exec' of obj '[object RegExp]' error, here's the screenshot:

image

image

my project is pretty big, so i can't give a demo here.

it associates to the commit: Fix RegExp methods in old browsers #453

@RequireSun
Copy link
Author

weex sometimes don't allow code to cover the native code, this code triggered the problem.

@RequireSun
Copy link
Author

weex's instructions here:

Weex JS engine features support

@nicolo-ribaudo
Copy link
Contributor

Core JS does a lot of monkey patching, I don't think that it can work with frozen builtins 🤔

@zloirock
Copy link
Owner

zloirock commented Dec 7, 2018

@RequireSun did it work with core-js@2.5.7?

@RequireSun
Copy link
Author

@RequireSun did it work with core-js@2.5.7?

yes, i locked my dependency in 2.5.7

@nicolo-ribaudo
Copy link
Contributor

We could use defineProperty instead of a normal assignment (unless Weex JS also makes everything non-configurable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants