-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
[weex]TypeError: CreateListFromArrayLike called on non-object #9124
Comments
@ts0307 Some vue code will probably help @Hanks10100 to check this |
@Hanks10100 @posva I have provided an example to reproduce this problem |
@ts0307 Thanks for your remind, I put your demo on the weex playground. The code you point out had been changed to this https://github.com/vuejs/vue/pull/7930/files#diff-c4874f4bae144c328950ba14ed7601abR35 . It will not throw errors when the type of |
Refer to #9139 |
good job! |
Version
2.5.17
Reproduction link
Steps to reproduce
What is expected?
If textStyle is set to 'red', the data.class type is String, so the following code runs incorrectly.
If textStyle is set to ['red'], the data.class type is Array, so the following code works fine.
What is actually happening?
This bug occurs in the platform "weex". In the function "src/platforms/weex/runtime/modules/class.js/updateClass", the following two lines of code:
if (oldData.class) { oldClassList.push.apply(oldClassList, oldData.class) }
if (data.class) { classList.push.apply(classList, data.class) }
Because the types of "oldData.class" and "data.class" are strings, not "Array" required by "apply".
The text was updated successfully, but these errors were encountered: