use of com.gargoylesoftware.htmlunit.javascript.configuration.ClassConfiguration in project htmlunit by HtmlUnit.
the class RecursiveFunctionObject method get.
/**
* {@inheritDoc}
*/
@Override
public Object get(final String name, final Scriptable start) {
final String superFunctionName = super.getFunctionName();
if ("prototype".equals(name)) {
if ("Proxy".equals(superFunctionName)) {
return NOT_FOUND;
}
}
Object value = super.get(name, start);
if (value == NOT_FOUND && !"Image".equals(superFunctionName) && !"Option".equals(superFunctionName) && (!"WebGLContextEvent".equals(superFunctionName) || getBrowserVersion().hasFeature(JS_WEBGL_CONTEXT_EVENT_CONSTANTS))) {
Class<?> klass = getPrototypeProperty().getClass();
final BrowserVersion browserVersion = getBrowserVersion();
while (value == NOT_FOUND && HtmlUnitScriptable.class.isAssignableFrom(klass)) {
final ClassConfiguration config = AbstractJavaScriptConfiguration.getClassConfiguration(klass.asSubclass(HtmlUnitScriptable.class), browserVersion);
if (config != null) {
final List<ConstantInfo> constants = config.getConstants();
if (constants != null) {
for (final ConstantInfo constantInfo : constants) {
if (constantInfo.getName().equals(name)) {
value = ScriptableObject.getProperty((Scriptable) getPrototypeProperty(), name);
break;
}
}
}
}
klass = klass.getSuperclass();
}
}
return value;
}
Aggregations