Java Code Examples for net.sourceforge.htmlunit.corejs.javascript.Context#FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK

The following examples show how to use net.sourceforge.htmlunit.corejs.javascript.Context#FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HtmlUnitContextFactory.java    From htmlunit with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected boolean hasFeature(final Context cx, final int featureIndex) {
    switch (featureIndex) {
        case Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER:
            return true;
        case Context.FEATURE_OLD_UNDEF_NULL_THIS:
            return true;
        case Context.FEATURE_NON_ECMA_GET_YEAR:
            return false;
        case Context.FEATURE_LITTLE_ENDIAN:
            return true;
        case Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW:
            return browserVersion_.hasFeature(JS_ARGUMENTS_READ_ONLY_ACCESSED_FROM_FUNCTION);
        case Context.FEATURE_HTMLUNIT_ERROR_STACK:
            return browserVersion_.hasFeature(JS_ERROR_STACK);
        case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK:
            return true;
        case Context.FEATURE_HTMLUNIT_ENUM_NUMBERS_FIRST:
            return true;
        case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME:
            return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NAME);
        case Context.FEATURE_HTMLUNIT_MEMBERBOX_NEWLINE:
            return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NEW_LINE);
        case Context.FEATURE_HTMLUNIT_ARRAY_PROPERTIES:
            return browserVersion_.hasFeature(JS_ARRAY_CONSTRUCTION_PROPERTIES);
        default:
            return super.hasFeature(cx, featureIndex);
    }
}
 
Example 2
Source File: HtmlUnitContextFactory.java    From HtmlUnit-Android with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected boolean hasFeature(final Context cx, final int featureIndex) {
    switch (featureIndex) {
        case Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER:
            return true;
        case Context.FEATURE_NON_ECMA_GET_YEAR:
            return false;
        case Context.FEATURE_HTMLUNIT_FN_ARGUMENTS_IS_RO_VIEW:
            return browserVersion_.hasFeature(JS_ARGUMENTS_READ_ONLY_ACCESSED_FROM_FUNCTION);
        case Context.FEATURE_HTMLUNIT_ERROR_STACK:
            return browserVersion_.hasFeature(JS_ERROR_STACK);
        case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK:
            return browserVersion_.hasFeature(JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK);
        case Context.FEATURE_HTMLUNIT_ENUM_NUMBERS_FIRST:
            return browserVersion_.hasFeature(JS_ENUM_NUMBERS_FIRST);
        case Context.FEATURE_HTMLUNIT_GET_PROTOTYPE_OF_STRING:
            return browserVersion_.hasFeature(JS_GET_PROTOTYPE_OF_STRING);
        case Context.FEATURE_HTMLUNIT_MEMBERBOX_NAME:
            return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NAME);
        case Context.FEATURE_HTMLUNIT_MEMBERBOX_NEWLINE:
            return browserVersion_.hasFeature(JS_PROPERTY_DESCRIPTOR_NEW_LINE);
        case Context.FEATURE_HTMLUNIT_ARRAY_PROPERTIES:
            return browserVersion_.hasFeature(JS_ARRAY_CONSTRUCTION_PROPERTIES);
        default:
            return super.hasFeature(cx, featureIndex);
    }
}