(function () {
var _0 = NativeEnvironment;
var _$0 = _0.someStringProperty;
if (typeof _$0 !== "string") {
throw new Error("Prepack model invariant violation: " + _$0);
}
var _2 = _$0 + " ";
var _1 = _2 + _$0;
console.log(_1);
var _4 = NativeEnvironment;
var _3 = _4;
_3.someStringProperty = "abc";
console.log(_1);
})();
Note that the modification to NativeEnvironment.someStringProperty is not reflected in the value output by the subsequent console.log statement.
My understanding of what is going on here is that the value of "NativeEnvironment.someStringProperty" is treated as non temporal, which means that it can be read at any point and is not expected to ever change.
If that is what we want, the assignment NativeEnvironment.someStringProperty = "abc"; should be flagged as a likely error.
Consider this program:
Prepacking it gives this output:
Note that the modification to NativeEnvironment.someStringProperty is not reflected in the value output by the subsequent console.log statement.
My understanding of what is going on here is that the value of "NativeEnvironment.someStringProperty" is treated as non temporal, which means that it can be read at any point and is not expected to ever change.
If that is what we want, the assignment
NativeEnvironment.someStringProperty = "abc";
should be flagged as a likely error.