if (!inNewExpr) {
return cx.newObject(ctorObj, CLASS_NAME, args);
}
ScriptRunner runner = getRunner(cx);
NIOSocketHandle handle = objArg(args, 0, NIOSocketHandle.class, false);
if (handle == null) {
handle = new NIOSocketHandle(runner);
}
// Unlike other types of handles, every open socket "pins" the server explicitly and keeps it
// running until it is either closed or "unref" is called.
TCPImpl tcp = new TCPImpl(handle, runner);