prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
69 lines (51 loc) • 1.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AreSameResidualBinding = AreSameResidualBinding;
exports.ReactStatistics = exports.BodyReference = void 0;
var _environment = require("../environment.js");
var _index = require("../values/index.js");
var _abstract = require("../methods/abstract.js");
var _realm = require("../realm.js");
var _invariant = _interopRequireDefault(require("../invariant.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
/* strict-local */
function AreSameResidualBinding(realm, x, y) {
if (x.serializedValue === y.serializedValue) return true;
if (x.value && x.value === y.value) return true;
if (x.value instanceof _index.ConcreteValue && y.value instanceof _index.ConcreteValue) {
return (0, _abstract.SameValue)(realm, x.value, y.value);
}
return false;
}
class BodyReference {
constructor(body, index) {
(0, _invariant.default)(index >= 0);
this.body = body;
this.index = index;
}
isNotEarlierThan(other) {
return this.body === other.body && this.index >= other.index;
}
}
exports.BodyReference = BodyReference;
class ReactStatistics {
constructor() {
this.optimizedTrees = 0;
this.inlinedComponents = 0;
this.evaluatedRootNodes = [];
this.componentsEvaluated = 0;
this.optimizedNestedClosures = 0;
}
}
exports.ReactStatistics = ReactStatistics;
//# sourceMappingURL=types.js.map