Trigger invariant upon the React reconciler detecting an object without its bindings

Summary:
Release notes: none

During React reconciliation, detect objects whose bindings have not been correctly applied with the right effects and trigger an invariant as this will result in broken output.
Closes https://github.com/facebook/prepack/pull/1992

Differential Revision: D8088640

Pulled By: trueadm

fbshipit-source-id: 36e9ec74a513643f638f02c88d86b86068adb14b
This commit is contained in:
Dominic Gannaway 2018-05-22 02:36:40 -07:00 committed by Facebook Github Bot
parent b6536991b0
commit b3018aa6af

View File

@ -1360,7 +1360,12 @@ export class Reconciler {
) {
// terminal values
return value;
} else if (value instanceof AbstractValue) {
}
invariant(
!(value instanceof ObjectValue) || value._isFinal !== undefined,
`An object value was detected during React reconcilation without its bindings properly applied`
);
if (value instanceof AbstractValue) {
return this._resolveAbstractValue(componentType, value, context, branchStatus, branchState, evaluatedNode);
}
// TODO investigate what about other iterables type objects