|
|
@@ -62,7 +62,7 @@ const ObservableMixin = {
|
|
|
*
|
|
|
* @error observable-set-cannot-override
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-set-cannot-override: Cannot override an existing property.' );
|
|
|
+ throw new CKEditorError( 'observable-set-cannot-override: Cannot override an existing property.', this );
|
|
|
}
|
|
|
|
|
|
Object.defineProperty( this, name, {
|
|
|
@@ -107,7 +107,7 @@ const ObservableMixin = {
|
|
|
*
|
|
|
* @error observable-bind-wrong-properties
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-wrong-properties: All properties must be strings.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-wrong-properties: All properties must be strings.', this );
|
|
|
}
|
|
|
|
|
|
if ( ( new Set( bindProperties ) ).size !== bindProperties.length ) {
|
|
|
@@ -116,7 +116,7 @@ const ObservableMixin = {
|
|
|
*
|
|
|
* @error observable-bind-duplicate-properties
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-duplicate-properties: Properties must be unique.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-duplicate-properties: Properties must be unique.', this );
|
|
|
}
|
|
|
|
|
|
initObservable( this );
|
|
|
@@ -130,7 +130,7 @@ const ObservableMixin = {
|
|
|
*
|
|
|
* @error observable-bind-rebind
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-rebind: Cannot bind the same property more that once.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-rebind: Cannot bind the same property more that once.', this );
|
|
|
}
|
|
|
} );
|
|
|
|
|
|
@@ -186,7 +186,7 @@ const ObservableMixin = {
|
|
|
*
|
|
|
* @error observable-unbind-wrong-properties
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-unbind-wrong-properties: Properties must be strings.' );
|
|
|
+ throw new CKEditorError( 'observable-unbind-wrong-properties: Properties must be strings.', this );
|
|
|
}
|
|
|
|
|
|
unbindProperties.forEach( propertyName => {
|
|
|
@@ -246,6 +246,7 @@ const ObservableMixin = {
|
|
|
*/
|
|
|
throw new CKEditorError(
|
|
|
'observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.',
|
|
|
+ this,
|
|
|
{ object: this, methodName }
|
|
|
);
|
|
|
}
|
|
|
@@ -380,7 +381,7 @@ function bindTo( ...args ) {
|
|
|
*
|
|
|
* @error observable-bind-no-callback
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-to-no-callback: Binding multiple observables only possible with callback.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-to-no-callback: Binding multiple observables only possible with callback.', this );
|
|
|
}
|
|
|
|
|
|
// Eliminate A.bind( 'x', 'y' ).to( B, callback )
|
|
|
@@ -390,7 +391,10 @@ function bindTo( ...args ) {
|
|
|
*
|
|
|
* @error observable-bind-to-extra-callback
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.' );
|
|
|
+ throw new CKEditorError(
|
|
|
+ 'observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.',
|
|
|
+ this
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
parsedArgs.to.forEach( to => {
|
|
|
@@ -401,7 +405,7 @@ function bindTo( ...args ) {
|
|
|
*
|
|
|
* @error observable-bind-to-properties-length
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-to-properties-length: The number of properties must match.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-to-properties-length: The number of properties must match.', this );
|
|
|
}
|
|
|
|
|
|
// When no to.properties specified, observing source properties instead i.e.
|
|
|
@@ -442,7 +446,7 @@ function bindToMany( observables, attribute, callback ) {
|
|
|
*
|
|
|
* @error observable-bind-to-many-not-one-binding
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().' );
|
|
|
+ throw new CKEditorError( 'observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().', this );
|
|
|
}
|
|
|
|
|
|
this.to(
|
|
|
@@ -501,7 +505,7 @@ function parseBindToArgs( ...args ) {
|
|
|
*
|
|
|
* @error observable-bind-to-parse-error
|
|
|
*/
|
|
|
- throw new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.', this );
|
|
|
}
|
|
|
|
|
|
const parsed = { to: [] };
|
|
|
@@ -518,7 +522,7 @@ function parseBindToArgs( ...args ) {
|
|
|
lastObservable = { observable: a, properties: [] };
|
|
|
parsed.to.push( lastObservable );
|
|
|
} else {
|
|
|
- throw new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.' );
|
|
|
+ throw new CKEditorError( 'observable-bind-to-parse-error: Invalid argument syntax in `to()`.', this );
|
|
|
}
|
|
|
} );
|
|
|
|