Skip to content

Commit 56cabff

Browse files
kapouerdhmlau
authored andcommitted
fix: replace __proto__ by setPrototypeOf
Signed-off-by: Jérémy Lal <kapouer@melix.org>
1 parent 10a57ef commit 56cabff

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/datasource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ DataSource.prototype.copyModel = function copyModel(Master) {
23282328
util.inherits(Slave, Master);
23292329

23302330
// Delegating static properties
2331-
Slave.__proto__ = Master;
2331+
Object.setPrototypeOf(Slave, Master);
23322332

23332333
hiddenProperty(Slave, 'dataSource', dataSource);
23342334
hiddenProperty(Slave, 'modelName', className);

lib/list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function List(items, itemType, parent) {
3636
}
3737

3838
const arr = [];
39-
arr.__proto__ = List.prototype;
39+
Object.setPrototypeOf(arr, List.prototype);
4040

4141
items = items || [];
4242
if (!Array.isArray(items)) {

lib/model-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ ModelBuilder.prototype.copyModel = function copyModel(Master) {
801801

802802
util.inherits(Slave, Master);
803803

804-
Slave.__proto__ = Master;
804+
Object.setPrototypeOf(Slave, Master);
805805

806806
hiddenProperty(Slave, 'modelBuilder', modelBuilder);
807807
hiddenProperty(Slave, 'modelName', className);

0 commit comments

Comments
 (0)