(target, source, funcArgs, runtime2)
| 9057 | this.nameVal = nameVal; |
| 9058 | } |
| 9059 | install(target, source, funcArgs, runtime2) { |
| 9060 | const args = this.args; |
| 9061 | const start = this.start; |
| 9062 | const errorHandler = this.errorHandler; |
| 9063 | const errorSymbol = this.errorSymbol; |
| 9064 | const finallyHandler = this.finallyHandler; |
| 9065 | const nameVal = this.nameVal; |
| 9066 | const nameSpace = this.nameSpace; |
| 9067 | const funcName = this.name; |
| 9068 | const functionFeature = this; |
| 9069 | var func = function() { |
| 9070 | var ctx = runtime2.makeContext(source, functionFeature, target, null); |
| 9071 | ctx.meta.errorHandler = errorHandler; |
| 9072 | ctx.meta.errorSymbol = errorSymbol; |
| 9073 | ctx.meta.finallyHandler = finallyHandler; |
| 9074 | for (var i = 0; i < args.length; i++) { |
| 9075 | var name = args[i]; |
| 9076 | var argumentVal = arguments[i]; |
| 9077 | if (name) { |
| 9078 | ctx.locals[name.value] = argumentVal; |
| 9079 | } |
| 9080 | } |
| 9081 | ctx.meta.caller = arguments[args.length]; |
| 9082 | if (ctx.meta.caller) { |
| 9083 | ctx.meta.callingCommand = ctx.meta.caller.meta.command; |
| 9084 | } |
| 9085 | var resolve, reject; |
| 9086 | var promise = new Promise(function(theResolve, theReject) { |
| 9087 | resolve = theResolve; |
| 9088 | reject = theReject; |
| 9089 | }); |
| 9090 | start.execute(ctx); |
| 9091 | if (ctx.meta.returned) { |
| 9092 | return ctx.meta.returnValue; |
| 9093 | } else { |
| 9094 | ctx.meta.resolve = resolve; |
| 9095 | ctx.meta.reject = reject; |
| 9096 | return promise; |
| 9097 | } |
| 9098 | }; |
| 9099 | func.hyperfunc = true; |
| 9100 | func.hypername = nameVal; |
| 9101 | runtime2.assignToNamespace(target, nameSpace, funcName, func); |
| 9102 | } |
| 9103 | static parse(parser) { |
| 9104 | if (!parser.matchToken("def")) return; |
| 9105 | var functionName = parser.requireElement("dotOrColonPath"); |
nothing calls this directly
no test coverage detected