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
But this makes a reference to the array on the original model instead of cloning it. Therefor if when you inherit (or multiple inherit) schema's then all the models will hold the same labels.
To fix it simply rewrite to:
var labels = original.labels().slice(0);
So, combined with the other bug on line 143 the whole function could look like this:
// starting from line 136 in ModelMap.js
key: 'extend',
value: function extend(name, as, using) {
// Get Original Model
var original = this.models.get(name);
// Add new Labels
var labels = original.labels().slice(0);
labels.push(as);
labels.sort();
// Merge Schema
var schema = Object.assign({}, original.schema(), using);
// Create and set
var model = new _Model2.default(this._neode, as, schema);
model.setLabels.apply(model, _toConsumableArray(labels));
this.models.set(as, model);
return model;
}
The text was updated successfully, but these errors were encountered:
Hey me again, found another one :)
On line 142 of ModelMap.js it says:
var labels = original.labels();
But this makes a reference to the array on the original model instead of cloning it. Therefor if when you inherit (or multiple inherit) schema's then all the models will hold the same labels.
To fix it simply rewrite to:
var labels = original.labels().slice(0);
So, combined with the other bug on line 143 the whole function could look like this:
The text was updated successfully, but these errors were encountered: