src/aria/utils/Path.js
function (path) {
            // edge case
            if (!path) {
                return [];
            }

            // first letter will give the type
            var first = path.charAt(0), closing, part, next, nextParse;

            // case brackets
            if (first == "[") {
                closing = path.indexOf("]");
                if (closing != -1) {
                    part = path.substring(1, closing);
                    next = path.substring(closing + 1);
                    if (/^\d+$/.test(part)) {
                        nextParse = this._paramParse(next);
                        nextParse.unshift(parseInt(part, 10));
                        return nextParse;
                    } else {
                        // check that part is "something" or 'somethingelse'
                        var strMarker = part.charAt(0), utilString = ariaUtilsString;
                        if ((strMarker == "'" || strMarker == '"')
                                && utilString.indexOfNotEscaped(part, strMarker, 1) == part.length - 1) {
                            nextParse = this._paramParse(next);
                            nextParse.unshift(part.substring(1, part.length - 1).replace(new RegExp("\\\\" + strMarker, "gi"), strMarker));
                            return nextParse;
                        }
                    }
                }
            } else if (first == ".") {
                part = /^[_A-z\$]\w*/.exec(path.substring(1));
                if (part.length) {
                    part = part[0];
                    next = path.substring(part.length + 1);
                    nextParse = this._paramParse(next);
                    nextParse.unshift(part);
                    return nextParse;
                }
            }

            // nothing returned -> throws an exception
            throw {
                error : this.WRONG_PATH_SYNTAX,
                args : [path]
            };
        }
function (path) {
            // edge case
            if (!path) {
                return [];
            }

            // first letter will give the type
            var first = path.charAt(0), closing, part, next, nextParse;

            // case brackets
            if (first == "[") {
                closing = path.indexOf("]");
                if (closing != -1) {
                    part = path.substring(1, closing);
                    next = path.substring(closing + 1);
                    if (/^\d+$/.test(part)) {
                        nextParse = this._paramParse(next);
                        nextParse.unshift(parseInt(part, 10));
                        return nextParse;
                    } else {
                        // check that part is "something" or 'somethingelse'
                        var strMarker = part.charAt(0), utilString = ariaUtilsString;
                        if ((strMarker == "'" || strMarker == '"')
                                && utilString.indexOfNotEscaped(part, strMarker, 1) == part.length - 1) {
                            nextParse = this._paramParse(next);
                            nextParse.unshift(part.substring(1, part.length - 1).replace(new RegExp("\\\\" + strMarker, "gi"), strMarker));
                            return nextParse;
                        }
                    }
                }
            } else if (first == ".") {
                part = /^[_A-z\$]\w*/.exec(path.substring(1));
                if (part.length) {
                    part = part[0];
                    next = path.substring(part.length + 1);
                    nextParse = this._paramParse(next);
                    nextParse.unshift(part);
                    return nextParse;
                }
            }

            // nothing returned -> throws an exception
            throw {
                error : this.WRONG_PATH_SYNTAX,
                args : [path]
            };
        }
function ( path ) { // edge case if ( ! path ) { return [ ] ; } // first letter will give the type var first = path . charAt ( 0 ) , closing , part , next , nextParse ; // case brackets if ( first == "[" ) { closing = path . indexOf ( "]" ) ; if ( closing != - 1 ) { part = path . substring ( 1 , closing ) ; next = path . substring ( closing + 1 ) ; if ( / ^\d+$ / . test ( part ) ) { nextParse = this . _paramParse ( next ) ; nextParse . unshift ( parseInt ( part , 10 ) ) ; return nextParse ; } else { // check that part is "something" or 'somethingelse' var strMarker = part . charAt ( 0 ) , utilString = ariaUtilsString ; if ( ( strMarker == "'" || strMarker == '"' ) && utilString . indexOfNotEscaped ( part , strMarker , 1 ) == part . length - 1 ) { nextParse = this . _paramParse ( next ) ; nextParse . unshift ( part . substring ( 1 , part . length - 1 ) . replace ( new RegExp ( "\\\\" + strMarker , "gi" ) , strMarker ) ) ; return nextParse ; } } } } else if ( first == "." ) { part = / ^[_A-z\$]\w* / . exec ( path . substring ( 1 ) ) ; if ( part . length ) { part = part [ 0 ] ; next = path . substring ( part . length + 1 ) ; nextParse = this . _paramParse ( next ) ; nextParse . unshift ( part ) ; return nextParse ; } } // nothing returned -> throws an exception throw { error : this . WRONG_PATH_SYNTAX , args : [ path ] } ; }
Parse parameters in path
@protected
@param {String} path like .param1[0]["param2"]
@return {Array}
Parse parameters in path