Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (childPayload.version !== __ZOID__.__VERSION__) {
throw new Error(`Parent window has zoid version ${ childPayload.version }, child window has version ${ __ZOID__.__VERSION__ }`);
}
const { parent, parentDomain, exports, context, props } = childPayload;
this.context = context;
this.parentComponentWindow = this.getParentComponentWindow(parent);
this.parentDomain = parentDomain;
this.parent = deserializeMessage(this.parentComponentWindow, parentDomain, exports);
this.checkParentDomain(parentDomain);
const initialProps = this.getPropsByRef(this.parentComponentWindow, parentDomain, props);
this.setProps(initialProps, parentDomain);
markWindowKnown(this.parentComponentWindow);
this.watchForClose();
return this.parent.init(this.buildExports());
}).then(() => {
return this.watchForResize();
parent = _parseChildWindowName.parent,
domain = _parseChildWindowName.domain,
exports = _parseChildWindowName.exports,
context = _parseChildWindowName.context,
props = _parseChildWindowName.props;
_this.context = context;
_this.parentComponentWindow = _this.getWindowByRef(parent);
_this.parentExports = deserializeMessage(_this.parentComponentWindow, domain, exports);
_this.checkParentDomain(domain);
window.xchild = _this.component.xchild = _this;
var initialProps = _this.getPropsByRef(_this.parentComponentWindow, domain, props);
_this.setProps(initialProps, domain);
markWindowKnown(_this.parentComponentWindow);
_this.watchForClose();
return _this.parentExports.init(_this.buildExports());
}).then(function () {
return _this.watchForResize();