debian-mirror-gitlab/spec/frontend/helpers/dom_shims/image_element_properties.js
2020-06-23 00:09:42 +05:30

12 lines
237 B
JavaScript

Object.defineProperty(global.HTMLImageElement.prototype, 'src', {
get() {
return this.$_jest_src || this.getAttribute('src');
},
set(val) {
this.$_jest_src = val;
if (this.onload) {
this.onload();
}
},
});