Skip to content

Commit

Permalink
Activate eqeqeq in JSHint
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Nov 8, 2013
1 parent c073b9a commit 18c9f18
Show file tree
Hide file tree
Showing 17 changed files with 197 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .jshintrc
Expand Up @@ -3,7 +3,7 @@
"bitwise": false,
"camelcase": false,
"curly": true,
"eqeqeq": false,
"eqeqeq": true,
"forin": false,
"immed": false,
//"indent": 2,
Expand Down
6 changes: 3 additions & 3 deletions src/alec/ui.js
Expand Up @@ -63,7 +63,7 @@ if (window['$']) {
* Contains the fullscreen API prefix or false if not supported.
* @type {string|boolean}
*/
var fullscreenSupport = JSSMS.Utils.getPrefix(['fullscreenEnabled', 'mozFullScreenEnabled']);
//var fullscreenSupport = JSSMS.Utils.getPrefix(['fullscreenEnabled', 'mozFullScreenEnabled']);

var requestAnimationFramePrefix = JSSMS.Utils.getPrefix(['requestAnimationFrame', 'mozRequestAnimationFrame'], window);

Expand Down Expand Up @@ -319,7 +319,7 @@ if (window['$']) {
complete: function(xhr, status) {
var data;

if (status == 'error') {
if (status === 'error') {
alert('The selected ROM file could not be loaded.');
return;
}
Expand Down Expand Up @@ -422,7 +422,7 @@ if (window['$']) {

for (; num < 16 && i <= length; i++) {
if (instructions[i]) {
html += '<div' + (instructions[i].address == currentAddress ? ' class="current"' : '') + '>' + instructions[i].hexAddress +
html += '<div' + (instructions[i].address === currentAddress ? ' class="current"' : '') + '>' + instructions[i].hexAddress +
(instructions[i].isJumpTarget ? ':' : ' ') +
'<code>' + instructions[i].inst + '</code></div>';

Expand Down
11 changes: 5 additions & 6 deletions src/compiler/generator.js
Expand Up @@ -49,7 +49,7 @@ var Generator = (function() {
return OP_CB_STATES[opcodes[1]];
case 0xDD:
case 0xFD:
if (opcodes.length == 2) {
if (opcodes.length === 2) {
return OP_DD_STATES[opcodes[1]];
}
return OP_INDEX_CB_STATES[opcodes[2]];
Expand All @@ -65,7 +65,7 @@ var Generator = (function() {
*/
function convertRegisters(ast) {
var convertRegistersFunc = function(node) {
if (node.type == 'Register') {
if (node.type === 'Register') {
node.type = 'Identifier';
}

Expand Down Expand Up @@ -98,7 +98,6 @@ var Generator = (function() {
}
];
var name = fn[0].address;
var jumpTargetNb = fn[0].jumpTargetNb;
var tstates = 0;

fn = fn
Expand Down Expand Up @@ -252,7 +251,7 @@ var Generator = (function() {
// Inject data about current branch into a comment.
fn[0][0].leadingComments = [].concat({
type: 'Line',
value: ' Nb of bytecodes jumping here: ' + jumpTargetNb
value: ' Nb of bytecodes jumping here: ' + fn[0].jumpTargetNb
}, fn[0][0].leadingComments);*/

// Flatten the array.
Expand All @@ -265,13 +264,13 @@ var Generator = (function() {

// Append `this` to all identifiers.
body = JSSMS.Utils.traverse(body, function(obj) {
if (obj.type && obj.type == 'Identifier' && whitelist.indexOf(obj.name) == -1) {
if (obj.type && obj.type === 'Identifier' && whitelist.indexOf(obj.name) === -1) {
obj.name = 'this.' + obj.name;
}
return obj;
});

return {
return {
'type': 'Program',
'body': [
{
Expand Down
4 changes: 3 additions & 1 deletion src/compiler/opcodes-CB.js
Expand Up @@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* global o */

'use strict';

var opcodeTableCB = [];
Expand All @@ -41,7 +43,7 @@ var regs = {
ast: o[op].apply(null, regs[reg])
});
// @todo Refactor and clean this section.
if (reg != '(HL)') {
if (reg !== '(HL)') {
opcodeTableDDCB.push({
name: 'LD ' + reg + ',' + op + ' (IX)',
ast: o['LD_' + op].apply(null, ['ixH', 'ixL'].concat(regs[reg]))
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/opcodes-DD-FD.js
Expand Up @@ -268,7 +268,7 @@ function generateIndexTable(index) {
ast: o.CP_X(registerH, registerL)
},
0xCB:
index == 'IX' ? opcodeTableDDCB : opcodeTableFDCB,
index === 'IX' ? opcodeTableDDCB : opcodeTableFDCB,
0xE1: {
name: 'POP ' + index,
ast: o.POP(registerH, registerL)
Expand Down

0 comments on commit 18c9f18

Please sign in to comment.