This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 408
Overriding native function can lead to unwanted side effect #666
Comments
@ssougnez, thank you for reporting the issue, we will make isNative return true for all methods which were patched by zone.js |
Cool, thanks :-D |
Hi, would you have an estimate of the date for the release of the version with this fix? Thanks |
Sorry for the late reply,I will try to fix this one this weekend, I will update the status here. |
Awesome, thanks a lot. |
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 18, 2017
…ike before patched
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 18, 2017
…ike before patched
@ssougnez , can you test the attached zone.js to see the problem is gone or not? thank you. |
@JiaLiPassion , works like a charm ;-) |
@ssougnez , ok , thank you for confirm. |
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 19, 2017
…ike before patched
JiaLiPassion
added a commit
to JiaLiPassion/zone.js
that referenced
this issue
Mar 19, 2017
…ike before patched
mhevery
pushed a commit
that referenced
this issue
Mar 22, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm currently trying to start a project with "angular4" and "ckeditor5" and I noticed that I'm not able to use "ckeditor5" because of "zone.js". The thing is that "ckeditor5" is using "isNative" method from "lodash" library to determine if "addEventListener" is a native method or not and then, based on that, do its stuff. However, when "zone.js" is included un the page, "isNative" returns "false" for "addEventListener". Indeed:
document.getElementById('XXX').addEventListener
returns
function addEventListener() { [native code] }
when "zone.js" is not referenced and:
function addEventListener(){return f(this, arguments)}
when it is, making the "isNative" function of "lodash" not really reliable anymore (this could be argued as the function is indeed not native anymore, but at the end of the day, "addEventListener" is supposed to be native).
The real source of the issue is arguable. Indeed, separately, every library work correctly but it's once we associate them that the problem occurs. I posted an issue on "ckeditor github" (ckeditor/ckeditor5#413) as at first I didn't know where the issue came from and a dev over there said something interesting:
Maybe the solution he proposed could be the correct one if it makes "isNative" function returns the correct value.
Otherwise, I think it could be interesting to discuss about a solution.
The text was updated successfully, but these errors were encountered: