Skip to content

Commit e21d42c

Browse files
ExE-Bossdomenic
authored andcommitted
[WebIDL] Test subclassing of legacy factory functions
1 parent e4f56f6 commit e21d42c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
3+
test(() => {
4+
class CustomImage extends Image {}
5+
var instance = new CustomImage();
6+
7+
assert_equals(
8+
Object.getPrototypeOf(instance), CustomImage.prototype,
9+
"Object.getPrototypeOf(instance) === CustomImage.prototype");
10+
11+
assert_true(instance instanceof CustomImage, "instance instanceof CustomImage");
12+
assert_true(instance instanceof HTMLImageElement, "instance instanceof HTMLImageElement");
13+
}, "[LegacyFactoryFunction] can be subclassed and correctly handles NewTarget");

0 commit comments

Comments
 (0)