You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in jsface.extend-method nested objects instead of extending just replace each other.
Example
var Man = Class({
config: {
prefix: 'Mr',
name: '',
eyes: 'green',
hair: 'blonde',
rightHanded: true
},
constructor: function (name) {
this.config.name = name;
},
echo: function () {
console.log(JSON.stringify(this.config));
}
});
var Woman = Class(Man, {
config: {
prefix: 'Ms',
eyes: 'blue'
}
});
var jack = new Man("Jack");
jack.echo();
var rika = new Woman("Rika");
rika.echo();
and as a result we've got {"prefix":"Mr","name":"Jack","eyes":"green","hair":"blonde","rightHanded":true} {"prefix":"Ms","eyes":"blue","name":"Rika"} (name presents because of contructor)
In my opinion its incorrect behavior, all properties must inherit instead of whole object replacing, but only in case of simple objects (not for classes).
The text was updated successfully, but these errors were encountered:
in jsface.extend-method nested objects instead of extending just replace each other.
Example
and as a result we've got
{"prefix":"Mr","name":"Jack","eyes":"green","hair":"blonde","rightHanded":true}
{"prefix":"Ms","eyes":"blue","name":"Rika"}
(name presents because of contructor)
In my opinion its incorrect behavior, all properties must inherit instead of whole object replacing, but only in case of simple objects (not for classes).
The text was updated successfully, but these errors were encountered: