From d24f2da3ddbb9f334a53e57b1d3f72a7fc441550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Sat, 28 Mar 2026 15:36:51 +0100 Subject: [PATCH] fix: replace __proto__ by setPrototypeOf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Lal --- lib/datasource.js | 2 +- lib/list.js | 2 +- lib/model-builder.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datasource.js b/lib/datasource.js index 9e4fcc0ff..a29a1ce12 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -2328,7 +2328,7 @@ DataSource.prototype.copyModel = function copyModel(Master) { util.inherits(Slave, Master); // Delegating static properties - Slave.__proto__ = Master; + Object.setPrototypeOf(Slave, Master); hiddenProperty(Slave, 'dataSource', dataSource); hiddenProperty(Slave, 'modelName', className); diff --git a/lib/list.js b/lib/list.js index fff8c19b2..79347443f 100644 --- a/lib/list.js +++ b/lib/list.js @@ -36,7 +36,7 @@ function List(items, itemType, parent) { } const arr = []; - arr.__proto__ = List.prototype; + Object.setPrototypeOf(arr, List.prototype); items = items || []; if (!Array.isArray(items)) { diff --git a/lib/model-builder.js b/lib/model-builder.js index 5f0535770..49b0e3ab8 100644 --- a/lib/model-builder.js +++ b/lib/model-builder.js @@ -801,7 +801,7 @@ ModelBuilder.prototype.copyModel = function copyModel(Master) { util.inherits(Slave, Master); - Slave.__proto__ = Master; + Object.setPrototypeOf(Slave, Master); hiddenProperty(Slave, 'modelBuilder', modelBuilder); hiddenProperty(Slave, 'modelName', className);