Rolled back change to IgniteObject. Added ability to use a function for the class name and simplified the code.

This commit is contained in:
2023-04-27 10:54:01 -07:00
parent a171b3da4d
commit 4f215dd375
2 changed files with 29 additions and 20 deletions

View File

@ -463,7 +463,21 @@ Array.prototype.getOldPropertyValues = function (property, oldValue) {
* The outline of an IgniteObject which contains IgniteProperties.
*/
class IgniteObject {
constructor() {
/**
* Creates a new ignite object with an optional object to create from.
* @param {Any} obj
*/
constructor(obj = null) {
//Only do this if the object is not an ignite object already.
if (obj && !(obj instanceof IgniteObject)) {
Object.keys(obj).forEach(name => {
var prop = new IgniteProperty(obj[name]);
Object.defineProperty(this, name, {
get: () => { return (IgniteRendering.rendering ? prop : prop.value); },
set: (value) => { prop.value = value; }
});
});
}
}
/**