src/third_party/mozjs/extract/js/src/builtin/intl/CommonFunctions.js
/**
 * Extracts a property value from the provided options object, converts it to
 * the required type, checks whether it is one of a list of allowed values,
 * and fills in a fallback value if necessary.
 *
 * Spec: ECMAScript Internationalization API Specification, 9.2.10.
 */
Extracts a property value from the provided options object, converts it to
the required type, checks whether it is one of a list of allowed values,
and fills in a fallback value if necessary.

ECMAScript Internationalization API Specification, 9.2.10.
Extracts a property value from the provided options object converts it to the required type checks whether it is one of a list of allowed values and fills in a fallback value if necessary . ECMAScript Internationalization API Specification 9 . 2 . 10 .
function GetOption(options, property, type, values, fallback) {
    var value = options[property];
    if (value !== undefined) {
        if (type === "boolean")
            value = ToBoolean(value);
        else if (type === "string")
            value = ToString(value);
        else
            assert(false, "GetOption");
        d.
        if (values !== undefined && callFunction(ArrayIndexOf, values, value) === -1)
            ThrowRangeError(JSMSG_INVALID_OPTION_VALUE, property, `"${value}"`);
        e.
        return value;
    }
    return fallback;
}
function GetOption ( options , property , type , values , fallback ) { var value = options [ property ] ; if ( value !== undefined ) { if ( type === "boolean" ) value = ToBoolean ( value ) ; else if ( type === "string" ) value = ToString ( value ) ; else assert ( false , "GetOption" ) ; if ( values !== undefined && callFunction ( ArrayIndexOf , values , value ) === - 1 ) ThrowRangeError ( JSMSG_INVALID_OPTION_VALUE , property , ` ${ value } ` ) ; return value ; } return fallback ; }
Extracts a property value from the provided options object, converts it to
 the required type, checks whether it is one of a list of allowed values,
 and fills in a fallback value if necessary.
Extracts a property value from the provided options object converts it to the required type checks whether it is one of a list of allowed values and fills in a fallback value if necessary .
// Step 1. // Step 2. // Steps 2.a-c. // Step 2.d. // Step 2.e. // Step 3.