Remove 'user strict'

'use strict' is unnecessary inside modules because module code is always strict mode code. Ref: https://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code
This commit is contained in:
BafS 2018-02-12 17:20:34 +01:00
parent 790799f2e7
commit de6ffc2f76
96 changed files with 147 additions and 339 deletions

View File

@ -1,5 +1,3 @@
'use strict';
module.exports = function(grunt) {
var lintFiles = [

View File

@ -24,8 +24,6 @@
* @module cleartext
*/
'use strict';
import config from './config';
import armor from './encoding/armor';
import enums from './enums';

View File

@ -21,8 +21,6 @@
* @module config/config
*/
'use strict';
import enums from '../enums.js';
export default {

View File

@ -3,6 +3,4 @@
* @module config
*/
'use strict';
export { default } from './config.js';

View File

@ -3,8 +3,6 @@
* @module config/localStorage
*/
'use strict';
/**
* @constructor
*/

View File

@ -22,8 +22,6 @@
* @module crypto/cfb
*/
'use strict';
import cipher from './cipher';
export default {

View File

@ -2,8 +2,6 @@
* @module crypto/cipher/aes
*/
'use strict';
import asmCrypto from 'asmcrypto-lite';
// TODO use webCrypto or nodeCrypto when possible.

View File

@ -7,8 +7,6 @@
* @module crypto/cipher/blowfish
*/
'use strict';
/*
* Javascript implementation based on Bruce Schneier's reference implementation.
*

View File

@ -16,8 +16,6 @@
/** @module crypto/cipher/cast5 */
'use strict';
function OpenpgpSymencCast5() {
this.BlockSize = 8;
this.KeySize = 16;

View File

@ -25,8 +25,6 @@
* @module crypto/cipher/des
*/
'use strict';
function des(keys, message, encrypt, mode, iv, padding) {
//declaring this locally speeds things up a bit
var spfunction1 = new Array(0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400,

View File

@ -6,8 +6,6 @@
* @module crypto/cipher
*/
'use strict';
import aes from './aes.js';
import desModule from './des.js';
import cast5 from './cast5.js';

View File

@ -28,8 +28,6 @@
* @module crypto/crypto
*/
'use strict';
import random from './random.js';
import cipher from './cipher';
import publicKey from './public_key';

View File

@ -20,8 +20,6 @@
* the WebCrypto api as well as node.js' crypto api.
*/
'use strict';
import asmCrypto from 'asmcrypto-lite';
import util from '../util.js';
import config from '../config';

View File

@ -5,8 +5,6 @@
* @module crypto/hash
*/
'use strict';
import Rusha from 'rusha';
import RIPEMD160 from 'ripemd160';
import asmCrypto from 'asmcrypto-lite';

View File

@ -17,8 +17,6 @@
* @module crypto/hash/md5
*/
'use strict';
import util from '../../util.js';
/**

View File

@ -19,8 +19,6 @@
* 1 = SHA-1, 2 = SHA-224/SHA-256, 4 = SHA-384/SHA-512
*/
"use strict";
var SUPPORTED_ALGS = 4 | 2 | 1;
/**

View File

@ -3,8 +3,6 @@
* @module crypto
*/
'use strict';
import cipher from './cipher';
import hash from './hash';
import cfb from './cfb';

View File

@ -25,8 +25,6 @@
* @module crypto/pkcs1
*/
'use strict';
import random from './random.js';
import util from '../util.js';
import BigInteger from './public_key/jsbn.js';

View File

@ -25,8 +25,6 @@
* @module crypto/public_key/dsa
*/
'use strict';
import BigInteger from './jsbn.js';
import random from '../random.js';
import hashModule from '../hash';

View File

@ -24,8 +24,6 @@
* @module crypto/public_key/elgamal
*/
'use strict';
import BigInteger from './jsbn.js';
import random from '../random.js';
import util from '../../util.js';

View File

@ -25,8 +25,6 @@
* @module crypto/public_key/elliptic/curve
*/
'use strict';
import { ec as EC, eddsa as EdDSA } from 'elliptic';
import { KeyPair } from './key';
import BigInteger from '../jsbn';

View File

@ -30,8 +30,6 @@
* @module crypto/public_key/elliptic/ecdh
*/
'use strict';
import curves from './curves';
import BigInteger from '../jsbn';
import cipher from '../../cipher';

View File

@ -24,8 +24,6 @@
* @module crypto/public_key/elliptic/ecdsa
*/
'use strict';
import hash from '../../hash';
import curves from './curves';
import BigInteger from '../jsbn';

View File

@ -24,8 +24,6 @@
* @module crypto/public_key/elliptic/eddsa
*/
'use strict';
import BN from 'bn.js';
import hash from '../../hash';
import curves from './curves';

View File

@ -25,8 +25,6 @@
* @module crypto/public_key/elliptic
*/
'use strict';
import {get, generate, getPreferredHashAlgo} from './curves';
import ecdsa from './ecdsa';
import eddsa from './eddsa';

View File

@ -30,8 +30,6 @@
* @module crypto/public_key/elliptic/key
*/
'use strict';
import curves from './curves';
import BigInteger from '../jsbn';
import hash from '../../hash';

View File

@ -6,8 +6,6 @@
* @module crypto/public_key
*/
'use strict';
/** @see module:crypto/public_key/rsa */
import rsa from './rsa.js';
/** @see module:crypto/public_key/elgamal */

View File

@ -24,8 +24,6 @@
* @module crypto/public_key/rsa
*/
'use strict';
import BigInteger from './jsbn.js';
import util from '../../util.js';
import random from '../random.js';

View File

@ -23,8 +23,6 @@
* @module crypto/random
*/
'use strict';
import type_mpi from '../type/mpi.js';
import util from '../util.js';

View File

@ -5,8 +5,6 @@
* @requires crypto/public_key
* @module crypto/signature */
'use strict';
import util from '../util';
import publicKey from './public_key';
import pkcs1 from './pkcs1.js';

View File

@ -22,8 +22,6 @@
* @module encoding/armor
*/
'use strict';
import base64 from './base64.js';
import enums from '../enums.js';
import config from '../config';

View File

@ -15,8 +15,6 @@
* @module encoding/base64
*/
'use strict';
var b64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // Standard radix-64
var b64u = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; // URL-safe radix-64

View File

@ -1,5 +1,3 @@
'use strict';
/**
* @module enums
*/

View File

@ -20,8 +20,6 @@
* in order to lookup and upload keys on standard public key servers.
*/
'use strict';
import config from './config';
/**

View File

@ -1,7 +1,5 @@
/* eslint-disable import/newline-after-import, import/first */
'use strict';
/**
* Export high level api as default.
* Usage:

View File

@ -25,8 +25,6 @@
* @module key
*/
'use strict';
import config from './config';
import crypto from './crypto';
import armor from './encoding/armor';

View File

@ -1,5 +1,3 @@
'use strict';
/**
* @see module:keyring/keyring
* @module keyring

View File

@ -23,8 +23,6 @@
* @param {keyring/localstore} [storeHandler] class implementing loadPublic(), loadPrivate(), storePublic(), and storePrivate() methods
*/
'use strict';
import { readArmored } from '../key';
import LocalStore from './localstore';

View File

@ -24,8 +24,6 @@
* @param {String} prefix prefix for itemnames in localstore
*/
'use strict';
import config from '../config';
import { readArmored } from '../key';
import util from '../util';

View File

@ -27,8 +27,6 @@
* @module message
*/
'use strict';
import config from './config';
import crypto from './crypto';
import armor from './encoding/armor';

View File

@ -32,8 +32,6 @@
* for extending and developing on top of the base library.
*/
'use strict';
import * as messageLib from './message';
import { CleartextMessage } from './cleartext';
import { generate, reformat } from './key';

View File

@ -3,8 +3,6 @@
* @module packet
*/
'use strict';
import enums from '../enums.js';
import * as packets from './all_packets.js'; // re-import module to parse packets from tag

View File

@ -21,8 +21,6 @@
* the structured cloning algorithm.
*/
'use strict';
import { Key } from '../key';
import { Message } from '../message';
import { CleartextMessage } from '../cleartext';

View File

@ -29,8 +29,6 @@
* @module packet/compressed
*/
'use strict';
import enums from '../enums.js';
import util from '../util.js';
import Zlib from '../compression/zlib.min.js';

View File

@ -1,5 +1,3 @@
'use strict';
import * as packets from './all_packets.js';
import * as clone from './clone.js';
import List from './packetlist.js';

View File

@ -25,8 +25,6 @@
* @module packet/literal
*/
'use strict';
import util from '../util.js';
import enums from '../enums.js';

View File

@ -29,8 +29,6 @@
* @module packet/marker
*/
'use strict';
import enums from '../enums.js';
/**

View File

@ -29,8 +29,6 @@
* @module packet/one_pass_signature
*/
'use strict';
import util from '../util.js';
import enums from '../enums.js';
import type_keyid from '../type/keyid.js';

View File

@ -21,8 +21,6 @@
* @module packet/packet
*/
'use strict';
import util from '../util.js';
export default {

View File

@ -10,8 +10,6 @@
* @module packet/packetlist
*/
'use strict';
import util from '../util';
import packetParser from './packet.js';
import * as packets from './all_packets.js';

View File

@ -29,8 +29,6 @@
* @module packet/public_key
*/
'use strict';
import crypto from '../crypto';
import enums from '../enums';
import util from '../util';

View File

@ -38,8 +38,6 @@
* @module packet/public_key_encrypted_session_key
*/
'use strict';
import type_keyid from '../type/keyid.js';
import util from '../util.js';
import type_ecdh_symkey from '../type/ecdh_symkey.js';

View File

@ -21,8 +21,6 @@
* @module packet/public_subkey
*/
'use strict';
import publicKey from './public_key.js';
import enums from '../enums.js';

View File

@ -31,8 +31,6 @@
* @module packet/secret_key
*/
'use strict';
import publicKey from './public_key.js';
import enums from '../enums.js';
import util from '../util.js';

View File

@ -21,8 +21,6 @@
* @module packet/secret_subkey
*/
'use strict';
import secretKey from './secret_key.js';
import enums from '../enums.js';

View File

@ -20,8 +20,6 @@
* {@link https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1}: AEAD Protected Data Packet
*/
'use strict';
import util from '../util.js';
import crypto from '../crypto';
import enums from '../enums.js';

View File

@ -32,8 +32,6 @@
* @module packet/sym_encrypted_integrity_protected
*/
'use strict';
import asmCrypto from 'asmcrypto-lite';
import util from '../util.js';
import crypto from '../crypto';

View File

@ -36,8 +36,6 @@
* @module packet/sym_encrypted_session_key
*/
'use strict';
import util from '../util.js';
import type_s2k from '../type/s2k.js';
import enums from '../enums.js';

View File

@ -28,8 +28,6 @@
* @module packet/symmetrically_encrypted
*/
'use strict';
import crypto from '../crypto';
import enums from '../enums.js';
import config from '../config';

View File

@ -3,8 +3,6 @@
* @module packet/trust
*/
'use strict';
import enums from '../enums.js';
/**

View File

@ -36,8 +36,6 @@
* @module packet/user_attribute
*/
'use strict';
import util from '../util.js';
import packet from './packet.js';
import enums from '../enums.js';

View File

@ -28,8 +28,6 @@
* @module packet/userid
*/
'use strict';
import util from '../util.js';
import enums from '../enums.js';

View File

@ -24,8 +24,6 @@
* @module signature
*/
'use strict';
import packet from './packet';
import enums from './enums.js';
import armor from './encoding/armor.js';

View File

@ -22,8 +22,6 @@
* @module type/ecdh_symkey
*/
'use strict';
import util from '../util';
module.exports = ECDHSymmetricKey;

View File

@ -22,8 +22,6 @@
* @module type/kdf_params
*/
'use strict';
import enums from '../enums.js';
module.exports = KDFParams;

View File

@ -26,8 +26,6 @@
* @module type/keyid
*/
'use strict';
import util from '../util.js';
/**

View File

@ -34,8 +34,6 @@
* @module type/mpi
*/
'use strict';
import BigInteger from '../crypto/public_key/jsbn';
import util from '../util';

View File

@ -23,8 +23,6 @@
* @module type/oid
*/
'use strict';
import util from '../util.js';
module.exports = OID;

View File

@ -29,8 +29,6 @@
* @module type/s2k
*/
'use strict';
import enums from '../enums.js';
import util from '../util.js';
import crypto from '../crypto';

View File

@ -21,8 +21,6 @@
* @module util
*/
'use strict';
import config from './config';
export default {

View File

@ -15,8 +15,6 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
'use strict';
import util from '../util.js';
import crypto from '../crypto';
import packet from '../packet';

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var expect = require('chai').expect;

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp');
var util = openpgp.util,

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var expect = require('chai').expect;

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai'),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai'),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai'),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var keyring = new openpgp.Keyring(),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var expect = require('chai').expect;

View File

@ -1,7 +1,5 @@
/* globals tryTests: true */
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var sinon = require('sinon'),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai');

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai'),

View File

@ -1,5 +1,3 @@
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var elliptic = openpgp.crypto.publicKey.elliptic;

View File

@ -1,7 +1,5 @@
/* globals tryTests: true */
'use strict';
var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp');
var chai = require('chai'),