Permalink
Browse files

Fix linting errors

  • Loading branch information...
1 parent 9048efe commit 7ec8421d19541d188710b5a3f37fc13ad75106d8 @Kegsay Kegsay committed Oct 16, 2015
Showing with 15 additions and 16 deletions.
  1. +1 −1 .jshint
  2. +3 −3 lib/models/room.js
  3. +10 −11 lib/utils.js
  4. +1 −1 spec/unit/room.spec.js
View
@@ -5,7 +5,7 @@
"nonew": true,
"curly": true,
"forin": true,
- "freeze": true,
+ "freeze": false,
"undef": true,
"unused": "vars"
}
View
@@ -184,7 +184,7 @@ Room.prototype.addEvents = function(events, duplicateStrategy) {
this.currentState.setTypingEvent(events[i]);
}
else if (events[i].getType() === "m.receipt") {
- addReceipt(this, events[i]);
+ this.addReceipt(events[i]);
}
else {
if (duplicateStrategy) {
@@ -284,15 +284,15 @@ Room.prototype.addReceipt = function(event) {
var self = this;
utils.keys(event.getContent()).forEach(function(eventId) {
utils.keys(event.getContent()[eventId]).forEach(function(receiptType) {
- utils.keys(event.getContent()[eventId][receiptType]).forEach(function(userId) {
+ utils.keys(event.getContent()[eventId][receiptType]).forEach(
+ function(userId) {
var receipt = event.getContent()[eventId][receiptType][userId];
if (!self._receipts[receiptType]) {
self._receipts[receiptType] = {};
}
if (!self._receipts[receiptType][userId]) {
self._receipts[receiptType][userId] = {};
}
- var oldEventId = self._receipts[receiptType][userId].eventId;
self._receipts[receiptType][userId] = {
eventId: eventId,
data: receipt
View
@@ -238,7 +238,6 @@ module.exports.runPolyfills = function() {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
if (!Array.prototype.filter) {
Array.prototype.filter = function(fun/*, thisArg*/) {
- 'use strict';
if (this === void 0 || this === null) {
throw new TypeError();
@@ -282,15 +281,15 @@ module.exports.runPolyfills = function() {
var T, A, k;
- if (this == null) {
+ if (this === null || this === undefined) {
throw new TypeError(' this is null or not defined');
}
- // 1. Let O be the result of calling ToObject passing the |this|
+ // 1. Let O be the result of calling ToObject passing the |this|
// value as the argument.
var O = Object(this);
- // 2. Let lenValue be the result of calling the Get internal
+ // 2. Let lenValue be the result of calling the Get internal
// method of O with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = O.length >>> 0;
@@ -306,8 +305,8 @@ module.exports.runPolyfills = function() {
T = thisArg;
}
- // 6. Let A be a new array created as if by the expression new Array(len)
- // where Array is the standard built-in constructor with that name and
+ // 6. Let A be a new array created as if by the expression new Array(len)
+ // where Array is the standard built-in constructor with that name and
// len is the value of len.
A = new Array(len);
@@ -321,18 +320,18 @@ module.exports.runPolyfills = function() {
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
- // b. Let kPresent be the result of calling the HasProperty internal
+ // b. Let kPresent be the result of calling the HasProperty internal
// method of O with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
if (k in O) {
- // i. Let kValue be the result of calling the Get internal
+ // i. Let kValue be the result of calling the Get internal
// method of O with argument Pk.
kValue = O[k];
- // ii. Let mappedValue be the result of calling the Call internal
- // method of callback with T as the this value and argument
+ // ii. Let mappedValue be the result of calling the Call internal
+ // method of callback with T as the this value and argument
// list containing kValue, k, and O.
mappedValue = callback.call(T, kValue, k, O);
@@ -363,7 +362,7 @@ module.exports.runPolyfills = function() {
return A;
};
}
-}
+};
/**
* Inherit the prototype methods from one constructor into another. This is a
@@ -623,5 +623,5 @@ describe("Room", function() {
});
- })
+ });
});

0 comments on commit 7ec8421

Please sign in to comment.