-
-
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
Observable#unbind: unbinding attribute which is not bound throws ambiguous error #4865
Comments
I've just stumbled upon this. Still an issue... as in my feature I'm binding/unbinding stuff and there is no way to check if a binding already exists (AFAIK). |
IMO unbinding a non-existent attribute should not throw an error. Since |
Just to be clear, this sounds like another problem. If you meant double bindings like A.bind( 'x' ).to( B, 'a' );
A.bind( 'x' ).to( B, 'a' ); // -> this one throws this should be a separate issue. Perhaps we should not throw in such situation. |
@oleq I'm describing problem from you first comment: const a = new ObservableClass();
a.unbind( 'foo' ); // whoopsie :( On the second I don't have an opinion... maybe it is OK to throw as we allow only one binding per attribute. |
OK. I've created a rather simple fix for that issue only. |
Other: `ObservableMixin#unbind` should not throw if used for an attribute which is not bound. Closes #5.
Moved from https://github.com/ckeditor/ckeditor5-core/issues/153
Actual:
TypeError: Cannot read property 'to' of undefined
Expected: A meaningful error.
The text was updated successfully, but these errors were encountered: