-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add is() method to other model/view objects #4479
Comments
I search through CKE5 repositories and I couldn't find any relations outside of engine package. Do you have some example where it is used? Maybe I make wrong search query. |
@msamsel some of them were removed already or doesn't really existed for view entries. You can double check it with imports from engine - they shouldn't be necessary for affected elements. Ie I've only see imports of Observers (separate issue), |
Thx @jodator for the hint. So I make double check for the |
What do you think about this? cc @pjasiun |
I've already make this change as it was quite simple and I already work with related code. |
Ugh, no. If you don't know if you are dealing with the view or with the model you did something horribly wrong. Is there any use case for this? I can't imagine... |
It's quite good point. I haven't thought about it from such perspective. |
@scofalik, that may be a part of some method's input validation. That you check whether the input are the proper positions. And if you'd do |
We almost never did this kind of validation and simply disregarded issues when people use wrong parameters in functions. I still think this is not needed. |
Really? I would love if e.g. all writer methods were secured. And perhaps a lot of conversion and other plugin-developer-facing things. Also, I'm really unsure if we can say that we're not doing this yet. Whenever we use However, we don't plan to change the engine (the only place where we use |
Feature: Introduced the `is()` method to additional objects from the model and view realms. Closes #1667.
After https://github.com/ckeditor/ckeditor5-engine/issues/1663 Range, Position, Marker and perhaps something else will still miss this method. Let's add it.
Also, lets remove as many
instanceof
checks from packages other than engine.One remaining thing to check would be how often we use
instanceof
to distinguish between model and view things. Perhaps we could also haveis( 'view:element' )
and secure our code a bit with this.The text was updated successfully, but these errors were encountered: