Hopefully last attribute inheritance bug fix, solves a lot of the console warnings.

Just swapping the function parameter order, since we called the function from every constructor.
This commit is contained in:
nathangray 2020-02-10 11:41:40 -07:00
parent 81b12cf9ee
commit 39590368bf
2 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ var ClassWithAttributes = /** @class */ (function () {
class_prototype = Object.getPrototypeOf(class_prototype); class_prototype = Object.getPrototypeOf(class_prototype);
} while (class_prototype !== ClassWithAttributes && n < 50); } while (class_prototype !== ClassWithAttributes && n < 50);
for (var i = class_tree.length - 1; i >= 0; i--) { for (var i = class_tree.length - 1; i >= 0; i--) {
attributes = ClassWithAttributes.extendAttributes(class_tree[i]._attributes, attributes); attributes = ClassWithAttributes.extendAttributes(attributes, class_tree[i]._attributes);
} }
return attributes; return attributes;
}; };
@ -138,7 +138,7 @@ var ClassWithAttributes = /** @class */ (function () {
* @param _attributes * @param _attributes
* @param _parent * @param _parent
*/ */
ClassWithAttributes.extendAttributes = function (_attributes, _parent) { ClassWithAttributes.extendAttributes = function (_parent, _attributes) {
function _copyMerge(_new, _old) { function _copyMerge(_new, _old) {
var result = {}; var result = {};
// Copy the new object // Copy the new object

View File

@ -168,7 +168,7 @@ export class ClassWithAttributes
for(let i = class_tree.length - 1; i >= 0; i--) for(let i = class_tree.length - 1; i >= 0; i--)
{ {
attributes = ClassWithAttributes.extendAttributes(class_tree[i]._attributes,attributes); attributes = ClassWithAttributes.extendAttributes(attributes, class_tree[i]._attributes);
} }
return attributes; return attributes;
} }
@ -180,7 +180,7 @@ export class ClassWithAttributes
* @param _attributes * @param _attributes
* @param _parent * @param _parent
*/ */
static extendAttributes(_attributes : object, _parent : object) : object static extendAttributes(_parent : object, _attributes : object) : object
{ {
function _copyMerge(_new, _old) function _copyMerge(_new, _old)
{ {