Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _isType(o, typeName) {
if (!o._isType) {
o._isType = {};
}
var res = o._isType[typeName];
if (res === undefined) {
try {
res = java.instanceOf(o, typeName);
} catch(err) {
res = false;
}
o._isType[typeName] = res;
}
return res;
}
function coerce(result) {
if (result === void 0 || result === null)
return null;
if (typeof result !== 'object')
return result;
if (java.instanceOf(result, classPaths.WebElement))
return new WebElement(result);
if (java.instanceOf(result, classPaths.Long))
return result.longValue;
if (java.instanceOf(result, classPaths.List)) {
return toArray(result, coerce);
}
if (java.instanceOf(result, classPaths.Map)) {
return toObject(result, coerce);
}
return result;
}
function coerce(result) {
if (result === void 0 || result === null)
return null;
if (typeof result !== 'object')
return result;
if (java.instanceOf(result, classPaths.WebElement))
return new WebElement(result);
if (java.instanceOf(result, classPaths.Long))
return result.longValue;
if (java.instanceOf(result, classPaths.List)) {
return toArray(result, coerce);
}
if (java.instanceOf(result, classPaths.Map)) {
return toObject(result, coerce);
}
return result;
}
function instanceOf(javaObject, className) {
var fullName = fullyQualifiedName(className) || className;
return smellsLikeJavaObject(javaObject) && _java.instanceOf(javaObject, fullName);
}
Java.instanceOf = instanceOf;
function coerce(result) {
if (result === void 0 || result === null)
return null;
if (typeof result !== 'object')
return result;
if (java.instanceOf(result, classPaths.WebElement))
return new WebElement(result);
if (java.instanceOf(result, classPaths.Long))
return result.longValue;
if (java.instanceOf(result, classPaths.List)) {
return toArray(result, coerce);
}
if (java.instanceOf(result, classPaths.Map)) {
return toObject(result, coerce);
}
return result;
}
function isJavaObject(e) {
return smellsLikeJavaObject(e) && _java.instanceOf(e, 'java.lang.Object');
}
Java.isJavaObject = isJavaObject;
function coerce(result) {
if (result === void 0 || result === null)
return null;
if (typeof result !== 'object')
return result;
if (java.instanceOf(result, classPaths.WebElement))
return new WebElement(result);
if (java.instanceOf(result, classPaths.Long))
return result.longValue;
if (java.instanceOf(result, classPaths.List)) {
return toArray(result, coerce);
}
if (java.instanceOf(result, classPaths.Map)) {
return toObject(result, coerce);
}
return result;
}
function isJavaObject(e) {
return smellsLikeJavaObject(e) && _java.instanceOf(e, 'java.lang.Object');
}
Java.isJavaObject = isJavaObject;
function asInstanceOf(obj, className) {
var fullName = fullyQualifiedName(className) || className;
if (_java.instanceOf(obj, fullName)) {
return obj;
}
else {
throw new Error('asInstanceOf fails, obj is not a ' + fullName);
}
}
Java.asInstanceOf = asInstanceOf;