Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
decorate({ value } : { value : CrossDomainWindowType | ProxyWindow }) : ProxyWindow {
return toProxyWindow(value);
}
},
return ZalgoPromise.try(() => {
if (props.window) {
return toProxyWindow(props.window).getType();
}
if (context) {
if (context !== CONTEXT.IFRAME && context !== CONTEXT.POPUP) {
throw new Error(`Unrecognized context: ${ context }`);
}
return context;
}
return this.defaultContext;
});
}
}).then(win => {
return toProxyWindow(win);
});
});
return ZalgoPromise.try(() => {
const windowProp = this.props.window;
if (windowProp) {
const proxyWin = toProxyWindow(windowProp);
this.clean.register(() => windowProp.close());
return proxyWin;
}
return new ProxyWindow({ send });
});
}