src/static/js/Intl.js
function /*9.2.9 */$$core$$GetOption (options, property, type, values, fallback) {
        var
            // 1. Let value be the result of calling the [[Get]] internal method of
            //    options with argument property.
            value = options[property];

        // 2. If value is not undefined, then
        if (value !== undefined) {
            // a. Assert: type is "boolean" or "string".
            // b. If type is "boolean", then let value be ToBoolean(value).
            // c. If type is "string", then let value be ToString(value).
            value = type === 'boolean' ? Boolean(value)
                      : (type === 'string' ? String(value) : value);

            // d. If values is not undefined, then
            if (values !== undefined) {
                // i. If values does not contain an element equal to value, then throw a
                //    RangeError exception.
                if ($$core$$arrIndexOf.call(values, value) === -1)
                    throw new RangeError("'" + value + "' is not an allowed value for `" + property +'`');
            }

            // e. Return value.
            return value;
        }
        // Else return fallback.
        return fallback;
    }
function /*9.2.9 */$$core$$GetOption (options, property, type, values, fallback) {
        var
            // 1. Let value be the result of calling the [[Get]] internal method of
            //    options with argument property.
            value = options[property];

        // 2. If value is not undefined, then
        if (value !== undefined) {
            // a. Assert: type is "boolean" or "string".
            // b. If type is "boolean", then let value be ToBoolean(value).
            // c. If type is "string", then let value be ToString(value).
            value = type === 'boolean' ? Boolean(value)
                      : (type === 'string' ? String(value) : value);

            // d. If values is not undefined, then
            if (values !== undefined) {
                // i. If values does not contain an element equal to value, then throw a
                //    RangeError exception.
                if ($$core$$arrIndexOf.call(values, value) === -1)
                    throw new RangeError("'" + value + "' is not an allowed value for `" + property +'`');
            }

            // e. Return value.
            return value;
        }
        // Else return fallback.
        return fallback;
    }
function /*9.2.9 */ $$core$$GetOption ( options , property , type , values , fallback ) { var // 1. Let value be the result of calling the [[Get]] internal method of //    options with argument property. value = options [ property ] ; // 2. If value is not undefined, then if ( value !== undefined ) { // a. Assert: type is "boolean" or "string". // b. If type is "boolean", then let value be ToBoolean(value). // c. If type is "string", then let value be ToString(value). value = type === 'boolean' ? Boolean ( value ) : ( type === 'string' ? String ( value ) : value ) ; // d. If values is not undefined, then if ( values !== undefined ) { // i. If values does not contain an element equal to value, then throw a //    RangeError exception. if ( $$core$$arrIndexOf . call ( values , value ) === - 1 ) throw new RangeError ( "'" + value + "' is not an allowed value for `" + property + '`' ) ; } // e. Return value. return value ; } // Else return fallback. return fallback ; }
The GetOption abstract operation extracts the value of the property named
property 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.
The GetOption abstract operation extracts the value of the property named property 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 .