Hi @sean12341
The syntax you see here totally aligns with JS standard. It is just that the name "Class" that makes the whole thing confusing.
Now check Js file in libs which is /libs/clientlibs/granite/richtext/base/Class.js.
Here, Class is being defined as JS Object which is then declared to be a function and takes one parameter which it expects to be js object. Check lines in js file mentioned:
var Class, Exception;
(function() {
var e = function(a) {
var b = a.bind(this);
b._methodName = a._methodName;
return this[b._methodName] = b
}
, a = function(a) {
a.extend = this;
return new Class(a)
};
Class = function(b) {
b = b || {};
Now, if you check https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new "new" operator can then be used on any function to declare further objects as explained in documentation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new like
car1 = new Car('Eagle', 'Talon TSi', 1993);
Hope it explains.
Thanks,
Nupur