mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-10-31 18:38:45 +01:00
Improved exportFunctionWithName
To reduce the need of double exports.
This commit is contained in:
parent
c16068ca85
commit
d5417cf807
@ -95,7 +95,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
scope.exportFunctionWithName = function exportFunctionWithName(func, context, name){
|
scope.exportFunctionWithName = function exportFunctionWithName(func, context, name){
|
||||||
const exportedTry = exportFunction(func, context, {allowCrossOriginArguments: true});
|
const targetObject = scope.getWrapped(context).Object.create(null);
|
||||||
|
const exportedTry = exportFunction(func, targetObject, {allowCrossOriginArguments: true, defineAs: name});
|
||||||
if (exportedTry.name === name){
|
if (exportedTry.name === name){
|
||||||
return exportedTry;
|
return exportedTry;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user