<commit_before>var Listener = require('asteroids-listener');

var epsilon = 0.0001;
function different(a, b) {
    return Math.abs(a - b) > epsilon;
}

var BaseObject = module.exports = function(){
    Listener.call(this);
    this._x = 0;
    this._y = 0;
};
BaseObject.prototype = new Listener();
BaseObject.prototype.position = function(position){
    if (position){
	var oldX = this._x;
	var oldY = this._y;
	this._x = position.x || oldX;
	this._y = position.y || oldY;
	if(different(oldX, this._x) || different(oldY, this._y)) {
	    this.notifyOf('position');
	}
    }
    return { 'x': this._x, 'y': this._y };
}
BaseObject.prototype.x = function(value){
    if (value) {
	this.position({ x: value });<commit_msg>use asteroids-different<commit_after>var Listener = require('asteroids-listener');
var different = require('asteroids-different')(0.0001);

var BaseObject = module.exports = function(){
    Listener.call(this);
    this._x = 0;
    this._y = 0;
};
BaseObject.prototype = new Listener();
BaseObject.prototype.position = function(position){
    if (position){
	var oldX = this._x;
	var oldY = this._y;
	this._x = position.x || oldX;
	this._y = position.y || oldY;
	if(different(oldX, this._x) || different(oldY, this._y)) {
	    this.notifyOf('position');
	}
    }
    return { 'x': this._x, 'y': this._y };
}
BaseObject.prototype.x = function(value){
    if (value) {
	this.position({ x: value });
{'fraction_non_alphanumeric': 0.1730225988700565, 'fraction_numerical': 0.009887005649717515, 'mean_word_length': 3.723333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5848953', 'n_tokens_mistral': 514, 'n_tokens_neox': 494, 'n_words': 110}