Skip to content
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

CKEDITOR.tools.createClass is unable to overwrite members #3120

Closed
jacekbogdanski opened this issue May 21, 2019 · 1 comment · Fixed by #3125
Closed

CKEDITOR.tools.createClass is unable to overwrite members #3120

jacekbogdanski opened this issue May 21, 2019 · 1 comment · Fixed by #3125
Assignees
Labels
browser:ie8 The issue can only be reproduced in the Internet Explorer 8 browser. core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@jacekbogdanski
Copy link
Member

jacekbogdanski commented May 21, 2019

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open IE8 with CKEditor4 sample page e.g. https://ckeditor.com/latest/samples
  2. Open console.
  3. Execute script:
var CreateClass = CKEDITOR.tools.createClass( {
	$: function() {
		this.message = 'Message from CreateClass!';
	},
	proto: {
			toString: function() {
				return this.message;
			},
		}
} );

function NativeClass () {
	this.message = 'Message from Native class!';
}

NativeClass.prototype.toString = function() {
	return this.message;
}

console.log( 'CreateClass', new CreateClass().toString() );
console.log( 'NativeClass', new NativeClass().toString() );

Expected result

In both console logs, you can see overwritten toString methods.

Actual result

Console log for the class created using CKEDITOR.tools.createClass prints [object Object] which means that the toString method has not been overwritten.

Other details

It may be related only to the native members.

  • CKEditor version: from implementation
@jacekbogdanski jacekbogdanski added type:bug A bug. browser:ie8 The issue can only be reproduced in the Internet Explorer 8 browser. core The issue is caused by the editor core code. labels May 21, 2019
@f1ames f1ames added this to the 4.12.0 milestone May 21, 2019
@f1ames f1ames added the status:confirmed An issue confirmed by the development team. label May 21, 2019
@jacekbogdanski
Copy link
Member Author

The issue is caused by CKEDITOR.tools.extend method used internally by this function which doesn't support DontEnum attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser:ie8 The issue can only be reproduced in the Internet Explorer 8 browser. core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants