рефакторинг

This commit is contained in:
vgoma 2017-11-29 14:33:41 +03:00
parent 6fd7a3db79
commit 2033a15ae3
2 changed files with 15 additions and 15 deletions

28
dist/crypto-pro.js vendored
View File

@ -1397,7 +1397,7 @@ var CryptoPro =
{possibleNames: ['L'], translation: 'Город'} {possibleNames: ['L'], translation: 'Город'}
]; ];
function execute(cb) { function generateAsyncFn(cb) {
var canAsync = cadesplugin.CreateObjectAsync; var canAsync = cadesplugin.CreateObjectAsync;
cb = String(cb); cb = String(cb);
@ -1653,7 +1653,7 @@ var CryptoPro =
} }
module.exports = { module.exports = {
execute: execute, generateAsyncFn: generateAsyncFn,
subjectNameTagsTranslations: subjectNameTagsTranslations, subjectNameTagsTranslations: subjectNameTagsTranslations,
issuerNameTagsTranslations: issuerNameTagsTranslations, issuerNameTagsTranslations: issuerNameTagsTranslations,
parseCertInfo: parseCertInfo, parseCertInfo: parseCertInfo,
@ -1885,7 +1885,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var result; var result;
try { try {
@ -1908,7 +1908,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var result; var result;
try { try {
@ -1930,7 +1930,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var base64; var base64;
try { try {
@ -1952,7 +1952,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var result = {}, var result = {},
algorithm; algorithm;
@ -1995,7 +1995,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var OIDS = [], var OIDS = [],
count, count,
item; item;
@ -2036,7 +2036,7 @@ var CryptoPro =
* */ * */
function isValidEDSSettings() { function isValidEDSSettings() {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var result; var result;
try { try {
@ -2055,7 +2055,7 @@ var CryptoPro =
* */ * */
function getCadesCert(hash) { function getCadesCert(hash) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var oStore = 'yield' + cryptoCommon.createObj('CAdESCOM.Store'), var oStore = 'yield' + cryptoCommon.createObj('CAdESCOM.Store'),
certs, certs,
certCnt, certCnt,
@ -2120,7 +2120,7 @@ var CryptoPro =
var cert = this._cert; var cert = this._cert;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var propInfo; var propInfo;
try { try {
@ -2148,7 +2148,7 @@ var CryptoPro =
return; return;
} }
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var oStore = 'yield' + cryptoCommon.createObj('CAdESCOM.Store'), var oStore = 'yield' + cryptoCommon.createObj('CAdESCOM.Store'),
result = [], result = [],
certs, certs,
@ -2265,7 +2265,7 @@ var CryptoPro =
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
getCadesCert(hash).then(function (cert) { getCadesCert(hash).then(function (cert) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var clientTime = new Date(), var clientTime = new Date(),
oAttrs = 'yield' + cryptoCommon.createObj('CADESCOM.CPAttribute'), oAttrs = 'yield' + cryptoCommon.createObj('CADESCOM.CPAttribute'),
oSignedData = 'yield' + cryptoCommon.createObj('CAdESCOM.CadesSignedData'), oSignedData = 'yield' + cryptoCommon.createObj('CAdESCOM.CadesSignedData'),
@ -2323,7 +2323,7 @@ var CryptoPro =
function signDataXML(hash, dataXML) { function signDataXML(hash, dataXML) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
getCadesCert(hash).then(function (cert) { getCadesCert(hash).then(function (cert) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var oSigner = 'yield' + cryptoCommon.createObj('CAdESCOM.CPSigner'), var oSigner = 'yield' + cryptoCommon.createObj('CAdESCOM.CPSigner'),
signerXML = 'yield' + cryptoCommon.createObj('CAdESCOM.SignedXML'), signerXML = 'yield' + cryptoCommon.createObj('CAdESCOM.SignedXML'),
cnts = cryptoConstants, cnts = cryptoConstants,
@ -2365,7 +2365,7 @@ var CryptoPro =
var sysInfo = cryptoCommon.getEnvInfo(); var sysInfo = cryptoCommon.getEnvInfo();
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
eval(cryptoCommon.execute(function () { eval(cryptoCommon.generateAsyncFn(function () {
var e; var e;
try { try {

File diff suppressed because one or more lines are too long