*/
public static ScriptHandle validScript(ScriptHandle script, List<SomeHandle> refs,
V8ContextFilter contextFilter) {
Long contextRef = V8ProtocolUtil.getObjectRef(script.context());
for (int i = 0, size = refs.size(); i < size; i++) {
SomeHandle ref = refs.get(i);
if (ref.handle() != contextRef.longValue()) {
continue;
}
ContextHandle contextHandle;
try {
contextHandle = ref.asContextHandle();
} catch (JsonProtocolParseException e) {
throw new RuntimeException(e);
}
if (!contextFilter.isContextOurs(contextHandle)) {
return null;