Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.linker.js.object;
 
 
import static java.lang.invoke.MethodHandles.lookup;
import static java.lang.invoke.MethodType.methodType;

Author(s):
Bob McWhirter
public class JSObjectConstructLink extends SmartLink implements Guard {
    public JSObjectConstructLink(LinkBuilder builderthrows Exception {
        super(builder);
        this. = this..guardWiththis );
    }
    public boolean guard(Object receiverObject contextObject[] args) {
        return (receiver instanceof JSFunction);
    }
    @Override
    public MethodHandle guardMethodHandle(MethodType inputTypethrows Exception {
        return lookup()
                .findVirtual(JSObjectConstructLink.class"guard"methodType(boolean.classObject.classObject.classObject[].class))
                .bindTo(this);
    }
    public MethodHandle guard() throws Exception {
        return this..getGuard();
    }
    public MethodHandle target() throws Exception {
        return this.
                .permute(1, 0, 2)
                .convert(Object.classExecutionContext.classJSFunction.classObject[].class)
                .insert(1, new Class[]{Object.class}, new Object[]{null})
                .invoke(lookup().findVirtual(ExecutionContext.class"construct"methodType(Object.classObject.classJSFunction.classObject[].class)))
                .target();
    }
New to GrepCode? Check out our FAQ X