MCPcopy Create free account
hub / github.com/dynjs/dynjs / call

Method call

src/main/java/org/dynjs/runtime/BoundFunction.java:35–53  ·  view source on GitHub ↗
(ExecutionContext context)

Source from the content-addressed store, hash-verified

33 }
34
35 @Override
36 public Object call(ExecutionContext context) {
37
38 Arguments argsObj = (Arguments) context.resolve("arguments").getValue(context);
39 int numExtraArgs = (int) argsObj.get(context, "length");
40 Object[] args = new Object[ this.boundArgs.length + numExtraArgs ];
41
42 System.arraycopy(this.boundArgs, 0, args, 0, this.boundArgs.length);
43
44 for ( int i = 0 ; i < numExtraArgs ; ++i ) {
45 Object v = argsObj.get( context, "" + i );
46 if ( v instanceof Reference ) {
47 v = ((Reference) v).getValue(context);
48 }
49 args[i + this.boundArgs.length ] = v;
50 }
51
52 return context.call(this.target, this.boundThis, args);
53 }
54
55
56 /*

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
resolveMethod · 0.80
callMethod · 0.65
getValueMethod · 0.45

Tested by

no test coverage detected