lib/types/Enumeration.js
/**
     * The result of converting an IDL enumeration type value to an ECMAScript
     * value is the String value that represents the same sequence of code units
     * as the enumeration value.
     * @param {any} V - the value to verify.
     * @param {String[]} enumValues - the enum to check against.
     */
The result of converting an IDL enumeration type value to an ECMAScript
value is the String value that represents the same sequence of code units
as the enumeration value.
@param {any} V - the value to verify.
@param {String[]} enumValues - the enum to check against.
The result of converting an IDL enumeration type value to an ECMAScript value is the String value that represents the same sequence of code units as the enumeration value . @param { any } V - the value to verify . @param { String [] } enumValues - the enum to check against .
function converterValue(V, enumValues) {
        var S = String(V);
        for (var i = enumValues.length - 1, E; i >= 0; i--) {
            E = enumValues[i];
            if (E === S) {
                return E;
            }
        }
        throw new TypeError();
    }
function converterValue ( V , enumValues ) { var S = String ( V ) ; for ( var i = enumValues . length - 1 , E ; i >= 0 ; i -- ) { E = enumValues [ i ] ; if ( E === S ) { return E ; } } throw new TypeError ( ) ; }
The result of converting an IDL enumeration type value to an ECMAScript
 value is the String value that represents the same sequence of code units
 as the enumeration value.
The result of converting an IDL enumeration type value to an ECMAScript value is the String value that represents the same sequence of code units as the enumeration value .
//Let S be the result of calling ToString(V). //If S is not one of E’s enumeration values, then throw a TypeError. //Return the enumeration value of type E that is equal to S.