fix(core): trace instead of throw

This commit is contained in:
Nathan Walker
2021-03-24 09:07:16 -07:00
parent b1d2c97b6a
commit cc592b63fd

View File

@ -88,10 +88,12 @@ export class View extends ViewCommon implements ViewDefinition {
this.onMeasure(widthMeasureSpec, heightMeasureSpec);
this._privateFlags |= PFLAG_LAYOUT_REQUIRED;
// flag not set, setMeasuredDimension() was not invoked, we raise
// an exception to warn the developer
// flag not set, setMeasuredDimension() was not invoked, we trace
// the exception to warn the developer
if ((this._privateFlags & PFLAG_MEASURED_DIMENSION_SET) !== PFLAG_MEASURED_DIMENSION_SET) {
throw new Error('onMeasure() did not set the measured dimension by calling setMeasuredDimension() ' + this);
if (Trace.isEnabled()) {
Trace.write('onMeasure() did not set the measured dimension by calling setMeasuredDimension() ' + this, Trace.categories.Layout, Trace.messageType.error);
}
}
}
}