From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../legacy-factor-function-subclass.window.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js (limited to 'testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js') diff --git a/testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js b/testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js new file mode 100644 index 0000000000..1fd64f41bb --- /dev/null +++ b/testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js @@ -0,0 +1,13 @@ +"use strict"; + +test(() => { + class CustomImage extends Image {} + var instance = new CustomImage(); + + assert_equals( + Object.getPrototypeOf(instance), CustomImage.prototype, + "Object.getPrototypeOf(instance) === CustomImage.prototype"); + + assert_true(instance instanceof CustomImage, "instance instanceof CustomImage"); + assert_true(instance instanceof HTMLImageElement, "instance instanceof HTMLImageElement"); +}, "[LegacyFactoryFunction] can be subclassed and correctly handles NewTarget"); -- cgit v1.2.3