There is no sense in using String.prototype.match if the retrieved matched results
are not used.
By the way, if a bit of performance (especially RAM usage) is preferred over
unification, then, obviously, conditions like
if (/SIGNED MESSAGE/.test(header[1])) {
can be changed to
if (header[1].indexOf('SIGNED MESSAGE') !== -1) {
Starting from two pull requests by @tanx and @Mithgol this commit implement the following:
- add testing of node version 4.2 LTS;
- move testing to the new TravisCI environment that is expected to be more fast;
- parallelize tests making possible to end first and to test more lasting less;
- make possible for browsertests to fail without impacting on the overall result.
It fixes error when running the example code (in Node.js with enforced strict
mode) from README.md:
[ReferenceError: data is not defined]
Error: Error generating keypair using js fallback!
at /tmp/fff/node_modules/openpgp/src/openpgp.js:266:13
at process._tickDomainCallback (node.js:399:9)
The problem was:
arzeth /tmp/test % npm install openpgp
openpgp@1.2.0 node_modules/openpgp
├── node-localstorage@0.3.6
├── es6-promise@1.0.0
└── zlibjs@0.2.0
arzeth /tmp/test % node --version
v3.0.0
arzeth /tmp/test % node
> var openpgp = require('openpgp');
undefined
>
arzeth /tmp/test % node --use_strict
> var openpgp = require('openpgp');
ReferenceError: txt is not defined
at md51 (/tmp/test/node_modules/openpgp/src/crypto/hash/md5.js:135:7)
at md5 (/tmp/test/node_modules/openpgp/src/crypto/hash/md5.js:198:14)
at Object.<anonymous> (/tmp/test/node_modules/openpgp/src/crypto/hash/md5.js:211:5)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/tmp/test/node_modules/openpgp/src/crypto/hash/index.js:10:8)