TODO : PR to wilmogrod to make this function protected instead of private
6558
private function cacheAsset(AssetInterface $asset)
    {
    	return $this->configuration->getCacheEnabled()
    	? new AssetCache($asset, new FilesystemCache($this->configuration->getCachePath()))
    	: $asset;
    }
630402
function( params ){
      var defaults = { 
        field: 'data',
        event: 'data',
        triggerFnName: 'trigger',
        triggerEvent: false,
        immutableKeys: {} // key => true if immutable
      };
      params = $$.util.extend({}, defaults, params);

      return function removeDataImpl( names ){
        var p = params;
        var self = this;
        var selfIsArrayLike = self.length !== undefined;
        var all = selfIsArrayLike ? self : [self]; // put in array if not array-like
        var single = selfIsArrayLike ? self[0] : self;
        
        // .removeData('foo bar')
        if( $$.is.string(names) ){ // then get the list of keys, and delete them
          var keys = names.split(/\s+/);
          var l = keys.length;

          for( var i = 0; i < l; i++ ){ // delete each non-empty key
            var key = keys[i];
            if( $$.is.emptyString(key) ){ continue; }

            var valid = !p.immutableKeys[ key ]; // not valid if immutable
            if( valid ){
              for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
                delete all[ i_a ]._private[ p.field ][ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }

        // .removeData()
        } else if( names === undefined ){ // then delete all keys

          for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
            var _privateFields = all[ i_a ]._private[ p.field ];
            
            for( var key in _privateFields ){
              var validKeyToDelete = !p.immutableKeys[ key ];

              if( validKeyToDelete ){
                delete _privateFields[ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }
        }

        return self; // maintain chaining
      }; // function
    }
920198
public static int setProtected(int modifier, boolean b) {
        if (b) {
            return (modifier | PROTECTED) & (~PUBLIC & ~PRIVATE);
        }
        else {
            return modifier & ~PROTECTED;
        }
    }
323817
function privateBrowsing(controller) {
  this._controller = controller;
  this._handler = null;

  /**
   * Menu item in the main menu to enter/leave Private Browsing mode
   * @private
   */
  this._pbMenuItem = new elementslib.Elem(this._controller.menus['tools-menu'].privateBrowsingItem);
  this._pbTransitionItem = new elementslib.ID(this._controller.window.document, "Tools:PrivateBrowsing");

  this.__defineGetter__('_pbs', function() {
    delete this._pbs;
    return this._pbs = Cc["@mozilla.org/privatebrowsing;1"].
                       getService(Ci.nsIPrivateBrowsingService);
  });
}
1217508
function setProtectedValues(node, protectSaltGenerator) {
    traverse(node, function(node) {
        if (strToBoolean(node.getAttribute(XmlNames.Attr.Protected))) {
            try {
                var value = ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(node.textContent));
                if (value.byteLength) {
                    var salt = protectSaltGenerator.getSalt(value.byteLength);
                    node.protectedValue = new ProtectedValue(value, salt);
                }
            } catch (e) {
                throw new KdbxError(Consts.ErrorCodes.FileCorrupt, 'bad protected value at line ' +
                node.lineNumber + ': ' + e);
            }
        }
    });
}
153774
function borrowFromVanilla(params, constructor) {
        // The members borrowed must be interpreted as public
        // This is because they do not use the $binds and maybe calling protected/private members
        // from anonymous functions

        var key,
            value,
            opts = { forcePublic: true };

        // Grab mixin members
        for (key in params) {
            // Ignore the constructor
            if (/^(_){0,2}initialize$/.test(key)) {
                continue;
            }

            value = params[key];

            if (!hasOwn(constructor.prototype, key)) {    // Already defined members are not overwritten
                if (isFunction(value) && !value[$class] && !value[$interface]) {
                    addMethod(key, value, constructor, opts);
                } else {
                    addProperty(key, value, constructor, opts);
                }
            }
        }

        constructor[$class].forceUnlocked = true;
    }
918524
function Scope(parent) {
  var map = Object.create(null);
  var api = {};
  api.markAsUsed = function(k) {
    if (typeof k !== "string") {
      throw new Error("Scope keys must be strings: " + k);
    }
    if (api.hasOwnVar(k)) {
      map[k].used = true;
      return api;
    }
    if (parent) {
      return parent.markAsUsed(k);
    }
    throw new Error("tried to use a variable before declaration: " + k);
  };
  api.ownUnusedVars = function() {
    return Object
      .keys(map)
      .filter(function(k) { return !map[k].used; })
      .map(function(k) { return map[k]; });
  };
  api.get = function(k) {
    if (api.hasOwnVar(k)) {
      return map[k];
    }
    if (parent) {
      return parent.get(k);
    }
    throw new Error("no such variable " + k);
  };
  api.declare = function(k, v) {
    // v.line :: number
    // v.column :: number
    // v.used :: boolean

    // Underscore is not a valid variable, so don't put it in the scope.
    if (k === "_") {
      return api;
    }
    v.name = k;
    // TODO: Unbreak the linter so I can use this check. Redeclaring a variable is not ok, but it's currently happening due to hoisting.
    // if (api.hasOwnVar(k)) {
    //     throw new Error("cannot redeclare variable " + k);
    // }
    if (api.hasOwnVar(k)) {
      v.used = api.get(k).used;
    }
    map[k] = v;
    return api;
  };
  api.hasVar = function(k) {
    if (api.hasOwnVar(k)) {
      return true;
    }
    if (parent) {
      return parent.hasVar(k);
    }
    return false;
  };
  api.hasOwnVar = function(k) {
    return {}.hasOwnProperty.call(map, k);
  };
  api.ownVars = function() {
    return Object.keys(map);
  };
  api.bareToString = function() {
    var innards = Object
      .keys(map)
      .map(function(k) {
        return k + ":" + (map[k].used ? "T" : "F");
      })
      .join(" ");
    var s = "{" + innards + "}";
    if (parent) {
      return parent.bareToString() + " > " + s;
    }
    return s;
  };
  api.toString = function() {
    return "#Scope[" + api.bareToString() + "]";
  };
  api.parent = parent;
  return Object.freeze(api);
}
922248
function(objName, createObj, templateName, contents, quoteChar, indentString, useStrict, htmlmin) {

  var content = getContent(contents, quoteChar, indentString, htmlmin);
  var doubleIndent = indentString + indentString;
  var strict = (useStrict) ? indentString + quoteChar + 'use strict' + quoteChar + ';\n' : '';
  var result = '';
  if(createObj) {
    result += 'if(typeof ' + objName + ' === \'undefined\') {' +
    	'var ' +  objName + ' = {};' +
    '}\n';
  }

  result += objName + '[\'' + templateName + '\'] = ' +
  quoteChar +  content + quoteChar + '; ';

  return result;
}
59325
function safeInvokeForConfig({ fn, context, params, onNotInvoked }) {
    if (typeof fn === 'function') {
        let fnParams = params;
        if (typeof params === 'function') {
            fnParams = params();
        }

        // Warn if params or lazily evaluated params were given but not in an array
        if (fnParams != null && !Array.isArray(fnParams)) {
            if (process.env.NODE_ENV !== 'production') {
                // eslint-disable-next-line no-console
                console.warn("Params to pass into safeInvoke's fn is not an array. Ignoring...",
                             fnParams);
            }

            fnParams = null;
        }

        return {
            invoked: true,
            result: fn.apply(context, fnParams)
        };
    } else {
        if (typeof onNotInvoked === 'function') {
            onNotInvoked();
        }

        return { invoked: false };
    }
}
39547
function validateCommonReservedWords(name){
  // Using regular expressions to find string literals can often have a
  // negative effect on performance.
  if (name ==='break') { return false; }
  if (name === 'case') { return false; }
  if (name === 'catch') { return false; }
  if (name === 'continue') { return false; }
  if (name === 'debugger') { return false; }
  if (name === 'default') { return false; }
  if (name === 'delete') { return false; }
  if (name === 'do') { return false; }
  if (name === 'else') { return false; }
  if (name === 'finally') { return false; }
  if (name === 'for') { return false; }
  if (name === 'function') { return false; }
  if (name === 'if') { return false; }
  if (name === 'in') { return false; }
  if (name === 'instanceof') { return false; }
  if (name === 'new') { return false; }
  if (name === 'return') { return false; }
  if (name === 'switch') { return false; }
  if (name === 'this') { return false; }
  if (name === 'throw') { return false; }
  if (name === 'try') { return false; }
  if (name === 'typeof') { return false; }
  if (name === 'var') { return false; }
  if (name === 'void') { return false; }
  if (name === 'while') { return false; }
  if (name === 'with') { return false; }
  if (name === 'class') { return false; }
  if (name === 'const') { return false; }
  if (name === 'export') { return false; }
  if (name === 'extends') { return false; }
  if (name === 'import') { return false; }
  if (name === 'super') { return false; }
  if (name === 'implements') { return false; }
  if (name === 'interface') { return false; }
  if (name === 'let') { return false; }
  if (name === 'package') { return false; }
  if (name === 'private') { return false; }
  if (name === 'protected') { return false; }
  if (name === 'public') { return false; }
  if (name === 'static') { return false; }
  if (name === 'yield') { return false; }
  if (name === 'null') { return false; }
  if (name === 'true') { return false; }
  if (name === 'false') { return false; }
  if (name === 'NaN') { return false; }
  if (name === 'Infinity') { return false; }
  if (name === 'undefined') { return false; }

  return true;
}
1174325
function(method, username, privateKey, sandbox) {
  return function(uri, data, cb) {
    if (typeof data === 'function') {
      cb = data;
      data = {};
    } else if (['string', 'number'].indexOf(typeof data) !== -1) {
      data = { id: data };
    }
    
    var options = {
      method: method,
      uri: (sandbox ? SANDBOX_API_URL : API_URL) + uri,
      headers: { 
        Accept: 'application/json',
        'Content-Type': 'application/json',
        Authorization: 'ApiKey ' + username + ':' + privateKey
      }
    };
    //If no params in URL, close with /
    if(options.uri.indexOf('?') === -1) options.uri += '/';
    
    // Add data to request
    if (method === 'GET' || method === 'DELETE') options.qs = data || {};
    else options.body = JSON.stringify(data) || {};

    request(options, globalResponseHandler(cb));
  };
}
921687
@Override
    public R visitHidden(HiddenTree node, P p) {
        return defaultAction(node, p);
    }
242388
function expose(){

    // TODO test this
    // if(!isDefined(defaultValue)){
    //  throw new Error("model.addPublicProperty() is being " +
    //    "invoked with an undefined default value. Default values for exposed properties " +
    //    "must be defined, to guarantee predictable behavior. For exposed properties that " +
    //    "are optional and should have the semantics of an undefined value, " +
    //    "use null as the default value.");
    //}

    // TODO test this
    if(!lastPropertyAdded){
      throw Error("Expose() was called without first adding a property.");
    }

    var propertyName = lastPropertyAdded;

    if(!exposedProperties){
      exposedProperties = [];
    }
    exposedProperties.push(propertyName);

    // Destroy the previous reactive function that was listening for changes
    // in all exposed properties except the newly added one.
    // TODO think about how this might be done only once, at the same time isFinalized is set.
    if(configurationReactiveFunction){
      configurationReactiveFunction.destroy();
    }

    // Set up the new reactive function that will listen for changes
    // in all exposed properties including the newly added one.
    var inputPropertyNames = exposedProperties;

    //console.log(inputPropertyNames);
    configurationReactiveFunction = ReactiveFunction({
      inputs: inputPropertyNames.map(getProperty),
      output: configurationProperty,
      callback: function (){
        var configuration = {};
        inputPropertyNames.forEach(function (propertyName){
          var property = getProperty(propertyName);

          // Omit default values from the returned configuration object.
          if(property() !== property.default()){
            configuration[propertyName] = property();
          }
        });
        return configuration;
      }
    });

    // Support method chaining.
    return model;
  }
255063
function List(parameters) {
    abstractions.Collection.call(this, utilities.types.LIST, parameters);

    // the array is a private attribute so methods that use it are defined in the constructor
    const array = [];

    this.acceptVisitor = function(visitor) {
        visitor.visitList(this);
    };
    
    this.toArray = function() {
        return array.slice();  // copy the array
    };

    this.getSize = function() {
        return array.length;
    };
    
    this.getItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        return array[index];
    };
    
    this.setItem = function(index, item) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        item = this.convert(item);
        const oldItem = array[index];
        array[index] = item;
        return oldItem;
    };
    
    this.addItem = function(item) {
        item = this.convert(item);
        array.push(item);
        return true;
    };
    
    this.insertItem = function(index, item) {
        item = this.convert(item);
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        array.splice(index, 0, item);
    };
    
    this.insertItems = function(index, items) {
        const iterator = items.getIterator();
        while (iterator.hasNext()) {
            const item = iterator.getNext();
            this.insertItem(index++, item);
        }
    };
    
    this.removeItem = function(index) {
        index = this.normalizeIndex(index) - 1;  // JS uses zero based indexing
        const oldItem = array[index];
        if (oldItem) array.splice(index, 1);
        return oldItem;
    };
    
    this.removeItems = function(range) {
        const items = new List(this.getParameters());
        const iterator = range.getIterator();
        while (iterator.hasNext()) {
            const index = iterator.getNext();
            const item = this.removeItem(index);
            items.addItem(item);
        }
        return items;
    };
    
    this.sortItems = function(sorter) {
        sorter = sorter || new utilities.Sorter();
        sorter.sortCollection(this);
    };
    
    this.reverseItems = function() {
        array.reverse();
    };

    this.shuffleItems = function() {
        const size = this.getSize();
        for (var index = size; index > 1; index--) {
            const randomIndex = utilities.random.index(index);  // in range [1..index] ordinal indexing
            const item = this.getItem(index);
            this.setItem(index, this.getItem(randomIndex));
            this.setItem(randomIndex, item);
        }
    };
    
    this.deleteAll = function() {
        array.splice(0);
    };

    return this;
}
69989
function HAPEncryption() {
  // initialize member vars with null-object values
  this.clientPublicKey = bufferShim.alloc(0);
  this.secretKey = bufferShim.alloc(0);
  this.publicKey = bufferShim.alloc(0);
  this.sharedSec = bufferShim.alloc(0);
  this.hkdfPairEncKey = bufferShim.alloc(0);
  this.accessoryToControllerCount = { value: 0 };
  this.controllerToAccessoryCount = { value: 0 };
  this.accessoryToControllerKey = bufferShim.alloc(0);
  this.controllerToAccessoryKey = bufferShim.alloc(0);
  this.extraInfo = {};
}
171503
function (tpl) {
      var tree = []
      var openTag
      var tag
      var name
      var paramStr
      var node
      var closeTag
      var usedExtends = 0

      for (openTag = this.findTag('', tpl); openTag; openTag = this.findTag('', tpl)) {
        if (openTag.index) {
          tree = tree.concat(this.parseText(tpl.slice(0, openTag.index)))
        }
        tpl = tpl.slice((openTag.index + openTag[0].length))
        tag = openTag[1].match(/^\s*(\w+)(.*)$/)
        if (tag) {
          // Function?!
          name = tag[1]
          paramStr = (tag.length > 2) ? tag[2].replace(/^\s+|\s+$/g, '') : ''
          if (name in this.buildInFunctions) {
            var buildIn = this.buildInFunctions[name]
            var params = ('parseParams' in buildIn ? buildIn.parseParams.bind(this) : this.parseParams.bind(this))(paramStr)
            if (buildIn.type === 'block') {
              // Remove new line after block open tag (like in Smarty)
              tpl = tpl.replace(/^\n/, '')
              closeTag = this.findCloseTag('/' + name, name + ' +[^}]*', tpl)
              var functionTree = buildIn.parse.call(this, params, tpl.slice(0, closeTag.index))
              if (functionTree) {
                // Some functions return false like {php} and {function}
                tree = tree.concat(functionTree)
              }
              tpl = tpl.slice(closeTag.index + closeTag[0].length)
            } else {
              if (name === 'extends') {
                // Anything before {extends} should be stripped.
                tree.splice(0, tree.length)
              }
              tree = tree.concat(buildIn.parse.call(this, params))
              if (name === 'extends') {
                usedExtends = tree.length
              }
            }
            tpl = tpl.replace(/^\n/, '')
          } else if (name in this.runTimePlugins) {
            // Possible it is function name. give it a priority before plugin.
            tree = tree.concat(this.parsePluginFunc(name, this.parseParams(paramStr)))
          } else if (name in this.plugins) {
            var plugin = this.plugins[name]
            if (plugin.type === 'block') {
              closeTag = this.findCloseTag('/' + name, name + ' +[^}]*', tpl)
              tree = tree.concat(this.parsePluginBlock(name, this.parseParams(paramStr), tpl.slice(0, closeTag.index)))
              tpl = tpl.slice(closeTag.index + closeTag[0].length)
            } else if (plugin.type === 'function') {
              tree = tree.concat(this.parsePluginFunc(name, this.parseParams(paramStr)))
            }
            if (name === 'append' || name === 'assign' || name === 'capture' || name === 'eval' || name === 'include') {
              tpl = tpl.replace(/^\n/, '')
            }
          } else {
            // Variable.
            node = this.buildInFunctions.expression.parse.call(this, openTag[1])
            tree.push(node)
          }
        } else {
          // Variable.
          node = this.buildInFunctions.expression.parse.call(this, openTag[1])
          if (node.expression.type === 'build-in' && node.expression.name === 'operator' && node.expression.op === '=') {
            tpl = tpl.replace(/^\n/, '')
          }
          tree.push(node)
        }
      }
      if (tpl) {
        tree = tree.concat(this.parseText(tpl))
      }
      tree.usedExtends = usedExtends
      return tree
    }
288644
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $children = $functionChildren;
        $parameters = $functionParameters;
        $name = null;
        if ( isset( $parameters["name"] ) )
             $name = $tpl->elementValue( $parameters["name"], $rootNamespace, $currentNamespace, $functionPlacement );
        if ( $name === null )
        {
            $name = $currentNamespace;
        }
        else
        {
            if ( $currentNamespace != "" )
                $name = "$currentNamespace:$name";
        }

        $loopItem = null;
        $hasLoopItemParameter = false;
        if ( isset( $parameters["loop"] ) )
        {
            $hasLoopItemParameter = true;
            $loopItem = $tpl->elementValue( $parameters["loop"], $rootNamespace, $currentNamespace, $functionPlacement );
        }

        $variableIterator = null;
        if ( isset( $parameters['var'] ) )
        {
            $variableIterator = $tpl->elementValue( $parameters['var'], $rootNamespace, $currentNamespace, $functionPlacement );
        }

        $noLastValue = true;
        if ( isset( $parameters['last-value'] ) )
        {
            $lastValue = $tpl->elementValue( $parameters['last-value'], $rootNamespace, $currentNamespace, $functionPlacement );
            $noLastValue = !$lastValue;
        }

        $reverseLoop = false;
        if ( isset( $parameters['reverse'] ) )
        {
            $reverseLoop = $tpl->elementValue( $parameters['reverse'], $rootNamespace, $currentNamespace, $functionPlacement );
        }
        if ( $hasLoopItemParameter and $loopItem === null )
            return;

        $showItem = null;
        $showSet = isset( $parameters["show"] );
        if ( $showSet )
            $showItem = $tpl->elementValue( $parameters["show"], $rootNamespace, $currentNamespace, $functionPlacement );

        $sequenceStructure = null;
        if ( isset( $parameters["sequence"] ) )
            $sequenceStructure = $tpl->elementValue( $parameters["sequence"], $rootNamespace, $currentNamespace, $functionPlacement );

        $iterationMaxCount = false;
        if ( isset( $parameters["max"] ) )
        {
            $iterationMaxCount = $tpl->elementValue( $parameters["max"], $rootNamespace, $currentNamespace, $functionPlacement );
            if ( is_array( $iterationMaxCount ) )
            {
                $iterationMaxCount = count( $iterationMaxCount );
            }
            else if ( !is_numeric( $iterationMaxCount ) )
            {
                $tpl->warning( $functionName, "Wrong parameter type '" . gettype( $iterationMaxCount ) . "' for 'max', use either numericals or arrays", $functionPlacement );
            }
            $iterationMaxCount = (int)$iterationMaxCount;
        }

        $iterationOffset = false;
        if ( isset( $parameters["offset"] ) )
        {
            $iterationOffset = $tpl->elementValue( $parameters["offset"], $rootNamespace, $currentNamespace, $functionPlacement );
            if ( is_array( $iterationOffset ) )
            {
                $iterationOffset = count( $iterationOffset );
            }
            else if ( !is_numeric( $iterationOffset ) )
            {
                $tpl->warning( $functionName, "Wrong parameter type '" . gettype( $iterationOffset ) . "' for 'offset', use either numericals or arrays", $functionPlacement );
            }
            $iterationOffset = (int)$iterationOffset;
            if ( $iterationOffset < 0 )
            {
                $tpl->warning( $functionName, "The 'offset' parameter can only be negative, $iterationOffset is not accepteed, the value will be reset to 0", $functionPlacement );
                $iterationOffset = 0;
            }
        }

        $elseName = $functionName . "-else";
        $delimiterStructure = null;
        $filterStructure = array();
        $else = null;
        $shown = 1;
        $items = array();
        $items[0] = array();
        $items[1] = array();
        if ( is_array( $children ) )
        {
            foreach ( array_keys( $children ) as $childKey )
            {
                $child =& $children[$childKey];
                $childType = $child[0];
                if ( $childType == eZTemplate::NODE_FUNCTION )
                {
                    switch ( $child[2] )
                    {
                        case "delimiter":
                        {
                            if ( $shown === 1 and $delimiterStructure === null )
                            {
                                $delimiterStructure =& $child;
                            }
                        } break;
                        case "section-exclude":
                        case "section-include":
                        {
                            if ( $shown === 1 )
                                $filterStructure[] =& $child;
                        } break;
                        case $elseName:
                        {
                            $else =& $child;
                            $shown = 0;
                        } break;
                        default:
                        {
                            $items[$shown][] =& $child;
                        } break;
                    }
                }
                else
                {
                    $items[$shown][] =& $child;
                }
            }
        }

        $canShowBlock = true;
        if( $showSet and ( ( is_array( $showItem ) and count( $showItem ) == 0 ) or
                           ( is_numeric( $showItem ) and $showItem == 0 ) or
                           ( is_string( $showItem ) > 0 and strlen( $showItem ) == 0 ) or
                           !$showItem ) )
            $canShowBlock = false;

        if ( ( !$showSet or ( $showSet and $canShowBlock ) ) and $loopItem === null )
        {
            $this->processChildrenOnce( $textElements, $items[1], $tpl, $rootNamespace, $name );
        }
        else
        {
            $iteratorData = array( 'iterator' => false );
            $showMainBody = true;
            if ( $showSet )
            {
                if( !$canShowBlock )
                    $showMainBody = false;
            }
            if ( $showMainBody )
            {
                $isFirstRun = true;
                $index = 0;
                if ( is_array( $loopItem ) )
                {
                    $array =& $loopItem;
                    $arrayKeys = array_keys( $array );
                    if ( $reverseLoop )
                        $arrayKeys = array_reverse( $arrayKeys );
                    if ( $iterationOffset !== false )
                        $arrayKeys = array_splice( $arrayKeys, $iterationOffset );
                    $currentCount = 0;
                    foreach ( $arrayKeys as $key )
                    {
                        unset( $item );
                        $item =& $array[$key];
                        $usedElement = $this->processChildren( $textElements, $items[1], $key, $item, $index, $isFirstRun,
                                                               $delimiterStructure, $sequenceStructure, $filterStructure,
                                                               $tpl, $rootNamespace, $name, $functionPlacement,
                                                               $variableIterator, $noLastValue,
                                                               $iteratorData );
                        if ( $usedElement )
                        {
                            if ( $iterationMaxCount !== false )
                            {
                                ++$currentCount;
                                if ( $currentCount >= $iterationMaxCount )
                                    break;
                            }
                        }
                    }
                }
                else if ( is_numeric( $loopItem ) )
                {
                    $value = $loopItem;
                    $count = $value;
                    if ( $value < 0 )
                        $count = -$count;
                    $loopStart = 0;
                    if ( $iterationOffset !== false )
                        $loopStart = $iterationOffset;
                    $currentCount = 0;
                    for ( $i = $loopStart; $i < $count; ++$i )
                    {
                        unset( $iterator );
                        if ( $reverseLoop )
                            $iterator = ( $count - $i ) - 1;
                        else
                            $iterator = $i;
                        unset( $key );
                        unset( $item );
                        if ( $value < 0 )
                        {
                            $key = $iterator;
                            $item = -$iterator - 1;
                        }
                        else
                        {
                            $key = $iterator;
                            $item = $iterator + 1;
                        }
                        $usedElement = $this->processChildren( $textElements, $items[1], $key, $item, $index, $isFirstRun,
                                                               $delimiterStructure, $sequenceStructure, $filterStructure,
                                                               $tpl, $rootNamespace, $name, $functionPlacement,
                                                               $variableIterator, $noLastValue,
                                                               $iteratorData );
                        if ( $usedElement )
                        {
                            if ( $iterationMaxCount !== false )
                            {
                                ++$currentCount;
                                if ( $currentCount >= $iterationMaxCount )
                                    break;
                            }
                        }
                    }
                }
                else if ( is_string( $loopItem ) )
                {
                    $text =& $loopItem;
                    $stringLength = strlen( $text );
                    $loopStart = 0;
                    if ( $iterationOffset !== false )
                        $loopStart = $iterationOffset;
                    $currentCount = 0;
                    for ( $i = $loopStart; $i < $stringLength; ++$i )
                    {
                        if ( $reverseLoop )
                            $iterator = ($stringLength - $i) - 1;
                        else
                            $iterator = $i;
                        unset( $key );
                        unset( $item );
                        $key = $iterator;
                        $item = $text[$iterator];
                        $usedElement = $this->processChildren( $textElements, $items[1], $key, $item, $index, $isFirstRun,
                                                               $delimiterStructure, $sequenceStructure, $filterStructure,
                                                               $tpl, $rootNamespace, $name, $functionPlacement,
                                                               $variableIterator, $noLastValue,
                                                               $iteratorData );
                        if ( $usedElement )
                        {
                            if ( $iterationMaxCount !== false )
                            {
                                ++$currentCount;
                                if ( $currentCount >= $iterationMaxCount )
                                    break;
                            }
                        }
                    }
                }
                if ( !$isFirstRun )
                {
                    if ( $variableIterator !== null )
                    {
                        $tpl->unsetVariable( $variableIterator, $name );
                    }
                    else
                    {
                        $tpl->unsetVariable( "key", $name );
                        $tpl->unsetVariable( "item", $name );
                        $tpl->unsetVariable( "index", $name );
                        $tpl->unsetVariable( "number", $name );
                        if ( $sequenceStructure !== null and is_array( $sequenceStructure ) )
                            $tpl->unsetVariable( "sequence", $name );
                    }
                }
            }
            else
            {
                $this->processChildrenOnce( $textElements, $items[0], $tpl, $rootNamespace, $name );
            }
        }
    }