From 66d2637b3fc627b7c7b49da92e90053640110547 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 10 Dec 2016 17:23:46 +0100 Subject: [PATCH] Fix errors reported by the `yoda` ESLint rule http://eslint.org/docs/rules/yoda --- src/core/crypto.js | 6 +++--- src/display/canvas.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/crypto.js b/src/core/crypto.js index 5803f52ab..d1fa3929a 100644 --- a/src/core/crypto.js +++ b/src/core/crypto.js @@ -2057,17 +2057,17 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() { return new NullCipher(); }; } - if ('V2' === cfm.name) { + if (cfm.name === 'V2') { return function cipherTransformFactoryBuildCipherConstructorV2() { return new ARCFourCipher(buildObjectKey(num, gen, key, false)); }; } - if ('AESV2' === cfm.name) { + if (cfm.name === 'AESV2') { return function cipherTransformFactoryBuildCipherConstructorAESV2() { return new AES128Cipher(buildObjectKey(num, gen, key, true)); }; } - if ('AESV3' === cfm.name) { + if (cfm.name === 'AESV3') { return function cipherTransformFactoryBuildCipherConstructorAESV3() { return new AES256Cipher(key); }; diff --git a/src/display/canvas.js b/src/display/canvas.js index 76f194931..47d07a901 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -1780,13 +1780,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { this.save(); this.baseTransformStack.push(this.baseTransform); - if (isArray(matrix) && 6 === matrix.length) { + if (isArray(matrix) && matrix.length === 6) { this.transform.apply(this, matrix); } this.baseTransform = this.ctx.mozCurrentTransform; - if (isArray(bbox) && 4 === bbox.length) { + if (isArray(bbox) && bbox.length === 4) { var width = bbox[2] - bbox[0]; var height = bbox[3] - bbox[1]; this.ctx.rect(bbox[0], bbox[1], width, height); @@ -1947,7 +1947,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { matrix) { this.save(); - if (isArray(rect) && 4 === rect.length) { + if (isArray(rect) && rect.length === 4) { var width = rect[2] - rect[0]; var height = rect[3] - rect[1]; this.ctx.rect(rect[0], rect[1], width, height);