Log.log(Platform.class, "WPAD detection failed due to:");
if (e instanceof EcmaError) Log.log(HTTP.class, ((EcmaError)e).getMessage() + " at " +
((EcmaError)e).getSourceName() + ":" + ((EcmaError)e).getLineNumber());
+ else if (e instanceof JavaScriptException) {
+ try {
+ XWT.recursivePrintObject.call(Context.enter(), null, null, new Object[] {
+ ((JavaScriptException)e).getValue() });
+ } catch (Exception e2) {
+ Log.log(Platform.class, e);
+ }
+ }
else Log.log(Platform.class, e);
}
return null;
};
private static boolean match(String[] arr, String s, int index) {
- if (index == arr.length) return true;
+ if (index >= arr.length) return true;
for(int i=0; i<s.length(); i++) {
String s2 = s.substring(i);
- if (s2.startsWith(arr[index]) && match(arr, s.substring(arr[index].length()), index + 1)) return true;
+ if (s2.startsWith(arr[index]) && match(arr, s2.substring(arr[index].length()), index + 1)) return true;
}
return false;
}