Setup an aura component to include a lwc child
child component should have a public method which returns no value
Call the child's public method from the aura parent
notice the javascript exception
InteropComponent.prototype.setupMethods = function () {
var self = this;
this.getPublicMethodNames().forEach(function (m) {
self[m] = function () {
if (!self.rendered) {
return $A.warning('Methods are not available until the component is rendered');
}
var elmt = this.getElement();
var rv = elmt[m].apply(elmt, arguments);
return $A.componentService.moduleEngine['unwrap'](rv); **// rv can be undefined**
};
});
};
Expected Results
return undefined and not fail with a javascript error
Actual Results
Browsers Affected
all
Version
LWC: x.x.x
Possible Solution
guard unwrap() against falsy arguments
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
I don't think we need this function anymore. We can just export observable membrane's unwrap. If user needs to get original iframe content window, HTMLIFrameElement.prototype.contentWindow is available.
Description
https://github.com/salesforce/lwc/blob/master/packages/lwc-engine/src/framework/membrane.ts#L27 unwrap() method fails with a javascript exception if passed an undefined value
Steps to Reproduce
Setup an aura component to include a lwc child child component should have a public method which returns no value Call the child's public method from the aura parent notice the javascript exception
http://playground.sfdc.es/projects/edit
Expected Results
return undefined and not fail with a javascript error
Actual Results
Browsers Affected
all
Version
Possible Solution
guard unwrap() against falsy arguments
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.