mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
small changes
This commit is contained in:
parent
30adf894aa
commit
a0ef702b54
16 changed files with 124 additions and 113 deletions
|
@ -1,16 +1,18 @@
|
|||
import { rewriteJs } from "../bundle";
|
||||
|
||||
const FunctionProxy = new Proxy(Function, {
|
||||
construct(target, argArray) {
|
||||
if (argArray.length === 1) {
|
||||
return Reflect.construct(target, self.__scramjet$bundle.rewriters.rewriteJs(argArray[0]));
|
||||
return Reflect.construct(target, rewriteJs(argArray[0]));
|
||||
} else {
|
||||
return Reflect.construct(target, self.__scramjet$bundle.rewriters.rewriteJs(argArray[argArray.length - 1]))
|
||||
return Reflect.construct(target, rewriteJs(argArray[argArray.length - 1]))
|
||||
}
|
||||
},
|
||||
apply(target, thisArg, argArray) {
|
||||
if (argArray.length === 1) {
|
||||
return Reflect.apply(target, undefined, self.__scramjet$bundle.rewriters.rewriteJs(argArray[0]));
|
||||
return Reflect.apply(target, undefined, rewriteJs(argArray[0]));
|
||||
} else {
|
||||
return Reflect.apply(target, undefined, [...argArray.map((x, index) => index === argArray.length - 1), self.__scramjet$bundle.rewriters.rewriteJs(argArray[argArray.length - 1])])
|
||||
return Reflect.apply(target, undefined, [...argArray.map((x, index) => index === argArray.length - 1), rewriteJs(argArray[argArray.length - 1])])
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue