From b63c40e7abf7e3e399996ee4f5b588af27ab4e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20Wa=CC=88rting?= Date: Sat, 20 May 2023 22:16:48 +0200 Subject: [PATCH] simplify inheritance test with classes --- test/file.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/file.js b/test/file.js index 90b0f44..583e329 100644 --- a/test/file.js +++ b/test/file.js @@ -753,15 +753,7 @@ function suite(moduleName) { }); it('supports inheritance', function (done) { - function ExtendedFile() { - File.apply(this, arguments); - } - ExtendedFile.prototype = Object.create(File.prototype); - ExtendedFile.prototype.constructor = ExtendedFile; - // Just copy static stuff since Object.setPrototypeOf is node >=0.12 - Object.keys(File).forEach(function (key) { - ExtendedFile[key] = File[key]; - }); + class ExtendedFile extends File { } var file = new ExtendedFile(); var file2 = file.clone();