debian-mirror-gitlab/spec/frontend/helpers/dom_shims/image_element_properties.js

13 lines
237 B
JavaScript
Raw Normal View History

2020-04-08 14:13:33 +05:30
Object.defineProperty(global.HTMLImageElement.prototype, 'src', {
get() {
2020-06-23 00:09:42 +05:30
return this.$_jest_src || this.getAttribute('src');
2020-04-08 14:13:33 +05:30
},
set(val) {
this.$_jest_src = val;
if (this.onload) {
this.onload();
}
},
});