mirror of
https://github.com/crypto-pro-web/crypto-pro-js.git
synced 2024-11-24 00:55:00 +03:00
рефакторинг
This commit is contained in:
parent
c3525905d2
commit
e607b0cd6b
20
dist/1.crypto-pro.js
vendored
20
dist/1.crypto-pro.js
vendored
@ -604,26 +604,32 @@ webpackJsonpCryptoPro([1],[
|
|||||||
];
|
];
|
||||||
|
|
||||||
function execute(cb) {
|
function execute(cb) {
|
||||||
|
var canAsync = cadesplugin.CreateObjectAsync;
|
||||||
|
|
||||||
cb = String(cb);
|
cb = String(cb);
|
||||||
|
|
||||||
var args = cb.match(/^function\s*?\((.*?)\)/);
|
var args = cb.match(/^function\s*?\((.*?)\)/);
|
||||||
|
|
||||||
args = (args && args[1]) || '';
|
args = (args && args[1]) || '';
|
||||||
|
|
||||||
|
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
||||||
|
|
||||||
function GeneratorFunction() {
|
function GeneratorFunction() {
|
||||||
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cadesplugin.CreateObjectAsync) {
|
cb = String(new (canAsync ? GeneratorFunction() : Function)(args, cb));
|
||||||
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
|
||||||
|
|
||||||
cb = String(new (GeneratorFunction())(args, cb));
|
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObject' + (canAsync ? 'Async' : '') + '$1');
|
||||||
|
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, canAsync ? '$2 ' : '');
|
||||||
|
|
||||||
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObjectAsync$1');
|
if (!canAsync) {
|
||||||
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, '$2 ');
|
cb = cb.replace(/propset_(.*?)\((.*?)\)/gm, '.$1 = $2');
|
||||||
|
|
||||||
return 'cadesplugin.async_spawn(' + cb + ');';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return canAsync ?
|
||||||
|
'cadesplugin.async_spawn(' + cb + ');'
|
||||||
|
: '(' + cb + ')();';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
dist/1.crypto-pro.js.map
vendored
2
dist/1.crypto-pro.js.map
vendored
File diff suppressed because one or more lines are too long
20
dist/2.crypto-pro.js
vendored
20
dist/2.crypto-pro.js
vendored
@ -47,26 +47,32 @@ webpackJsonpCryptoPro([2],[
|
|||||||
];
|
];
|
||||||
|
|
||||||
function execute(cb) {
|
function execute(cb) {
|
||||||
|
var canAsync = cadesplugin.CreateObjectAsync;
|
||||||
|
|
||||||
cb = String(cb);
|
cb = String(cb);
|
||||||
|
|
||||||
var args = cb.match(/^function\s*?\((.*?)\)/);
|
var args = cb.match(/^function\s*?\((.*?)\)/);
|
||||||
|
|
||||||
args = (args && args[1]) || '';
|
args = (args && args[1]) || '';
|
||||||
|
|
||||||
|
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
||||||
|
|
||||||
function GeneratorFunction() {
|
function GeneratorFunction() {
|
||||||
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cadesplugin.CreateObjectAsync) {
|
cb = String(new (canAsync ? GeneratorFunction() : Function)(args, cb));
|
||||||
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
|
||||||
|
|
||||||
cb = String(new (GeneratorFunction())(args, cb));
|
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObject' + (canAsync ? 'Async' : '') + '$1');
|
||||||
|
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, canAsync ? '$2 ' : '');
|
||||||
|
|
||||||
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObjectAsync$1');
|
if (!canAsync) {
|
||||||
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, '$2 ');
|
cb = cb.replace(/propset_(.*?)\((.*?)\)/gm, '.$1 = $2');
|
||||||
|
|
||||||
return 'cadesplugin.async_spawn(' + cb + ');';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return canAsync ?
|
||||||
|
'cadesplugin.async_spawn(' + cb + ');'
|
||||||
|
: '(' + cb + ')();';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
dist/2.crypto-pro.js.map
vendored
2
dist/2.crypto-pro.js.map
vendored
File diff suppressed because one or more lines are too long
@ -38,26 +38,32 @@ var subjectNameTagsTranslations = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function execute(cb) {
|
function execute(cb) {
|
||||||
|
var canAsync = cadesplugin.CreateObjectAsync;
|
||||||
|
|
||||||
cb = String(cb);
|
cb = String(cb);
|
||||||
|
|
||||||
var args = cb.match(/^function\s*?\((.*?)\)/);
|
var args = cb.match(/^function\s*?\((.*?)\)/);
|
||||||
|
|
||||||
args = (args && args[1]) || '';
|
args = (args && args[1]) || '';
|
||||||
|
|
||||||
|
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
||||||
|
|
||||||
function GeneratorFunction() {
|
function GeneratorFunction() {
|
||||||
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
return (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cadesplugin.CreateObjectAsync) {
|
cb = String(new (canAsync ? GeneratorFunction() : Function)(args, cb));
|
||||||
cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1');
|
|
||||||
|
|
||||||
cb = String(new (GeneratorFunction())(args, cb));
|
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObject' + (canAsync ? 'Async' : '') + '$1');
|
||||||
|
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, canAsync ? '$2 ' : '');
|
||||||
|
|
||||||
cb = cb.replace(/cryptoCommon\.createObj(\([\s\S]*?\))/gm, 'cadesplugin.CreateObjectAsync$1');
|
if (!canAsync) {
|
||||||
cb = cb.replace(/("|')(yield)(\1)\s*?\+\s*?\b/gm, '$2 ');
|
cb = cb.replace(/propset_(.*?)\((.*?)\)/gm, '.$1 = $2');
|
||||||
|
|
||||||
return 'cadesplugin.async_spawn(' + cb + ');';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return canAsync ?
|
||||||
|
'cadesplugin.async_spawn(' + cb + ');'
|
||||||
|
: '(' + cb + ')();';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user