mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
bbee3c6f60
Summary: All minor changes since we were already on the beta: most notable is that destructors are required in pooling to help prevent memory leaks. public Reviewed By: sebmarkbage Differential Revision: D2608692 fb-gh-sync-id: acdad38768f7f48c0f0e7e44cbff6f0db316f4ca
33 lines
706 B
JavaScript
33 lines
706 B
JavaScript
/**
|
|
* @providesModule Position
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
var PooledClass = require('PooledClass');
|
|
|
|
var twoArgumentPooler = PooledClass.twoArgumentPooler;
|
|
|
|
/**
|
|
* Position does not expose methods for construction via an `HTMLDOMElement`,
|
|
* because it isn't meaningful to construct such a thing without first defining
|
|
* a frame of refrence.
|
|
*
|
|
* @param {number} windowStartKey Key that window starts at.
|
|
* @param {number} windowEndKey Key that window ends at.
|
|
*/
|
|
function Position(left, top) {
|
|
this.left = left;
|
|
this.top = top;
|
|
}
|
|
|
|
Position.prototype.destructor = function() {
|
|
this.left = null;
|
|
this.top = null;
|
|
};
|
|
|
|
PooledClass.addPoolingTo(Position, twoArgumentPooler);
|
|
|
|
module.exports = Position;
|
|
|