legacy-factor-function-subclass.window.js (503B)
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");