Skip to content

Commit

Permalink
[WebIDL] Test subclassing of legacy factory functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss authored and domenic committed Mar 10, 2021
1 parent e4f56f6 commit e21d42c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit e21d42c

Please sign in to comment.