Fetches all bindings from template

@param {object} mBinding - map of bindings from Control (mBindingsInfo)
@returns {Array} - Returns a flattened array of found bindings
@private
326394
function flattenBindingsFromTemplate(mBinding) {
		var aBindings = [];
		var aParts = mBinding.parts;

		// TODO: check if we need to filter bindings by modelName, relative indicator ("/")
		aParts.forEach(function (mPart) {
			aBindings.push({
				parts: [mPart]
			});
		});

		return aBindings;
	}
1227725
function getThisBinding(thisEnvFn, inConstructor) {
  return getBinding(thisEnvFn, "this", thisBinding => {
    if (!inConstructor || !hasSuperClass(thisEnvFn)) return t.thisExpression();

    const supers = new WeakSet();
    thisEnvFn.traverse({
      Function(child) {
        if (child.isArrowFunctionExpression()) return;
        child.skip();
      },
      ClassProperty(child) {
        child.skip();
      },
      CallExpression(child) {
        if (!child.get("callee").isSuper()) return;
        if (supers.has(child.node)) return;
        supers.add(child.node);

        child.replaceWithMultiple([
          child.node,
          t.assignmentExpression(
            "=",
            t.identifier(thisBinding),
            t.identifier("this"),
          ),
        ]);
      },
    });
  });
}
341789
private void collectBindings(List<SitebricksModule.LinkingBinder> bindings,
                               Set<PageBook.Page> pagesToCompile) {

    // Reverse the method map for easy lookup of HTTP method annotations.
    Map<Class<? extends Annotation>, String> methodSet = null;

    //go thru bindings and obtain pages from them.
    for (SitebricksModule.LinkingBinder binding : bindings) {

      if (EMBEDDED == binding.bindingKind) {
        if (null == binding.embedAs) {
          // This can happen if embed() is not followed by an .as(..)
          throw new IllegalStateException("embed() missing .as() clause: " + binding.pageClass);
        }
        registry.addEmbed(binding.embedAs);
        pagesToCompile.add(pageBook.embedAs(binding.pageClass, binding.embedAs));

      } else if (PAGE == binding.bindingKind) {
        pagesToCompile.add(pageBook.at(binding.uri, binding.pageClass));

      } else if (STATIC_RESOURCE == binding.bindingKind) {
        //localize the resource to the SitebricksModule's package.
        resourcesService.add(SitebricksModule.class, binding.getResource());
      } else if (SERVICE == binding.bindingKind) {
        pagesToCompile.add(pageBook.serviceAt(binding.uri, binding.pageClass));
      } else if (ACTION == binding.bindingKind) {
        // Lazy create this inverse lookup map, once.
        if (null == methodSet) {
          methodSet = HashBiMap.create(methodMap).inverse();
        }
        pageBook.at(binding.uri, binding.actionDescriptors, methodSet);
      }
    }
  }
57549
function getBindingsForNode(fragments, node, view) {
  var bindings = [];
  var Binder, binding, expr, bound, match, attr, i, l;

  if (node.nodeType === Node.TEXT_NODE) {
    splitTextNode(fragments, node);

    // Find any binding for the text node
    if (fragments.isBound('text', node.nodeValue)) {
      expr = fragments.codifyExpression('text', node.nodeValue);
      node.nodeValue = '';
      Binder = fragments.findBinder('text', expr);
      if (Binder.expression) {
        // the expression is the wildcard inside a text binder
        expr = expr.match(Binder.expression)[1];
      }
      binding = new Binder({ node: node, view: view, expression: expr, fragments: fragments });
      if (binding.compiled() !== false) {
        bindings.push(binding);
      }
    }
  } else {
    // If the element is removed from the DOM, stop. Check by looking at its parentNode
    var parent = node.parentNode;
    var DefaultBinder = fragments.getAttributeBinder('__default__');
    bound = [];

    // Find any binding for the element
    Binder = fragments.findBinder('element', node.tagName.toLowerCase());
    if (Binder) {
      bound.push([ Binder ]);
    }

    // Find and add any attribute bindings on an element. These can be attributes whose name matches a binding, or
    // they can be attributes which have a binding in the value such as `href="/post/{{ post.id }}"`.
    var attributes = slice.call(node.attributes);
    for (i = 0, l = attributes.length; i < l; i++) {
      attr = attributes[i];
      Binder = fragments.findBinder('attribute', attr.name, attr.value);
      if (Binder) {
        bound.push([ Binder, attr ]);
      }
    }

    // Make sure to create and process them in the correct priority order so if a binding create a template from the
    // node it doesn't process the others.
    bound.sort(sortBindings);

    for (i = 0; i < bound.length; i++) {
      Binder = bound[i][0];
      attr = bound[i][1];

      if (attr) {
        if (!node.hasAttribute(attr.name)) {
          // If this was removed already by another binding, don't process.
          continue;
        }
        var name = attr.name;
        var value = attr.value;
        if (Binder.expression) {
          match = name.match(Binder.expression);
          if (match) match = match[1];
        } else {
          match = null;
        }

        if (attr && node.hasAttribute(attr.name)) {
          node.removeAttribute(attr.name);
        }

        binding = new Binder({
          node: node,
          view: view,
          name: name,
          match: match,
          expression: value ? fragments.codifyExpression('attribute', value, Binder !== DefaultBinder) : null,
          fragments: fragments
        });
      } else {
        binding = new Binder({ node: node, view: view, fragments: fragments });
      }

      if (binding.compiled() !== false) {
        bindings.push(binding);
      } else if (attr && Binder !== DefaultBinder && fragments.isBound('attribute', value)) {
        // Revert to default if this binding doesn't take
        bound.push([ DefaultBinder, attr ]);
      } else if (attr) {
        node.setAttributeNode(attr);
      }

      if (node.parentNode !== parent) {
        break;
      }
    }
  }

  return bindings;
}
939968
function () {
  /**
   * Returns inflected values from a string ie. application => applications, Application, etc.
   * @param  {Object} options Configurable options
   * @param {string} options.model_name String that should be inflected
   * @return {Object}         Object containing inflected values indexed by type of inflection
   */
  return function getViewModelProperties (options = {}) {
    let model_name = options.model_name;
    let viewmodel = {
      name: model_name,
      name_plural: pluralize(model_name)
    };
    return Object.assign(viewmodel, {
      capital_name: capitalize(model_name),
      page_plural_title: capitalize(viewmodel.name_plural),
      page_plural_count: `${ viewmodel.name_plural }count`,
      page_plural_query: `${ viewmodel.name_plural }query`,
      page_single_count: `${ model_name }count`,
      page_pages: `${ model_name }pages`
    });
  };
}
1026934
function () {
            var selectedIndexes = this.getSelectedIndexes();
            var retVal = [];
            var items = this._data.items;
            for (var i = 0, length = selectedIndexes.length; i < length; i++) {
                retVal[i] = items[selectedIndexes[i]];
            }
            return retVal;
        }
244582
function camelComponentBinds(binds) {
    var result = [];
    each(binds, function (bind) {
        result.push({
            name: kebab2camel(bind.name),
            expr: bind.expr,
            x: bind.x,
            raw: bind.raw
        });
    });

    return result;
}
671057
function buildBindsMap(bindsArray)
{
  var bindsMap = {};
  var isArrayBinding = bindsArray.length >0 && Util.isArray(bindsArray[0]);
  var singleArray = isArrayBinding ? bindsArray[0] : bindsArray;

  for (var index = 0, length = singleArray.length; index < length; index++)
  {
    var value = singleArray[index];

    // pick the appropriate logical data type based on the bind value
    var type;
    if (Util.isBoolean(value))
    {
      type = 'BOOLEAN';
    }
    else if (Util.isObject(value) || Util.isArray(value))
    {
      type = 'VARIANT';
    }
    else if (Util.isNumber(value))
    {
      type = 'REAL';
    }
    else 
    {
      type = 'TEXT';
    }

    // convert non-null values to a string if necessary; we don't convert null
    // because the client might want to run something like
    //   sql text = update t set name = :1 where id = 1;, binds = [null]
    // and converting null to a string would result in us executing
    //   sql text = update t set name = 'null' where id = 1;
    // instead of
    //   sql text = update t set name = null where id = 1;
    if (!isArrayBinding)
    {
      if (value !== null && !Util.isString(value))
      {
        value = JSON.stringify(value);
      }
    }
    else
    {
      value = [];
      for (var rowIndex = 0; rowIndex < bindsArray.length; rowIndex++)
      {
        var value0 = bindsArray[rowIndex][index];
        if (value0 !== null && !Util.isString(value0))
        {
          value0 = JSON.stringify(value0);
        }
        value.push(value0);
      }
    }

    // add an entry for the bind variable to the map
    bindsMap[index + 1] =
    {
      type  : type,
      value : value
    };
  }

  return bindsMap;
}
607773
public static Map<Key<?>, Binding<?>> findBindingsInScope(Injector injector, Class<? extends Annotation>... scopeAnnotations) {
    Map<Key<?>,Binding<?>> bindings = new LinkedHashMap<Key<?>, Binding<?>>();
    ALL_BINDINGS: for( Map.Entry<Key<?>, Binding<?>> entry : injector.getAllBindings().entrySet() ) {
      for( Class<? extends Annotation> scopeAnnotation : scopeAnnotations ) {
        if( inScope(injector, entry.getValue(), scopeAnnotation )) {
          bindings.put(entry.getKey(), entry.getValue());
          continue ALL_BINDINGS;
        }
      }
    }
    return bindings;
  }
266658
function()
	{
		var model, attr, result, result2, modelPathArray, i, ret, modelArgs;
		var dataBindAttr = this.element.getAttribute(settings.DATA_BIND_ATTR);
		var modelName;

		this._modelBindersMap = new BinderMap();

		if(dataBindAttr == null) return;

		var parsedBindings = matchBindings(dataBindAttr);

		if(process.env.NODE_ENV !== 'production')
		{
			if(parsedBindings.error)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('Error parsing binding expression: ');
				console.error(parsedBindings.error);
				console.log(this.element);
			}
		}

		if(parsedBindings.match && parsedBindings.match.bindings)
		{
			parsedBindings = parsedBindings.match.bindings;

			for(var i = 0, l = parsedBindings.length; i < l; i++)
			{
				var parsedBinding = parsedBindings[i];

				if(parsedBinding.binder === 'each')
				{
					if(process.env.NODE_ENV !== 'production')
					{
						if(this._collectionBinder)
						{
							if(this.element && this.element.parentNode)
							{
								this.element.parentNode.scrollIntoView();
								this.element.parentNode.style.outline = '2px dashed red';
							}
							console.error('You cannot have two :each binders on the same element');
							console.log(this.element);
						}
					}
					if(!this.options.isBoundView)
					{
						var animate = null;
						var keyProp = null;
						var alias = null;

						if(parsedBinding.operators)
						{
							for(var j = 0, k = parsedBinding.operators.length; j < k; j++)
							{
								var operator = parsedBinding.operators[j];
								if(operator.args.length >= 1 && operator.args[0].type === 'ident')
								{
									if(operator.name === 'animate') animate = operator.args[0].value;
									if(operator.name === 'key') keyProp = operator.args[0].value;
									if(operator.name === 'as') alias = operator.args[0].value;
								}
							}
						}

						this._collectionBinder = new CollectionBinder({
							view: this,
							keyPath: parsedBinding.keyPath,
							collectionArgs: parsedBinding.modelArgs,
							animate: animate,
							keyProp: keyProp
						});

						if(alias)
						{
							this._itemAlias = alias;
						}
						else this._itemAlias = settings.defaultItemAlias;
					}
				}
				else
				{
					if(!(parsedBinding.binder in View.binders)) break;

					var scope = this.scope;
					var isIdent = function(v){ return v != null && v.type === 'ident'; }
					var identToParser = function(v)
					{
						if(scope[v.value]) return { fn: scope[v.value], args: [] };
						else if(View.helpers[v.value]) return { fn: View.helpers[v.value], args: [] };
					}
					var argToValue = function(v)
					{
						return v.value;
					}
					var isNotNull = function(v)
					{
						return v != null;
					}

					var binderConfig = {
						view: this,
						element: this.element,
						params: parsedBinding.binderArgs.filter(isNotNull),
						keyPath: parsedBinding.keyPath,
						modelArgs: parsedBinding.modelArgs.filter(isNotNull),
						formatters: [],
						parsers: [],
						dispatch: null,
						// dispatchNamedParams: ret.dispatchNamedParams,
						eventNames: [],
						eventFilters: null,
						fill: false,
						nopreventdef: false,
						animate: null,
						indexed: false
					};


					for(var j = 0, k = parsedBinding.operators.length; j < k; j++)
					{
						var operator = parsedBinding.operators[j];
						switch(operator.name)
						{
							case 'format':
							case 'f':
								binderConfig.formatters = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'parse':
							case 'p':
								binderConfig.parsers = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'dispatch':
								if(operator.args.length > 0)
								{
									binderConfig.dispatch = operator.args;
								}
								break;
							case 'on':
								if(operator.args.length > 0)
								{
									binderConfig.eventNames = operator.args.filter(isIdent).map(argToValue);
								}
								break;
							case 'evf':
								binderConfig.eventFilters = operator.args.filter(isIdent).map(identToParser);
								break;
							case 'fill':
								binderConfig.fill = true;
								break;
							case 'nopreventdef':
								binderConfig.nopreventdef = true;
								break;
							case 'animate':
								binderConfig.animate = operator.args[0].value;
								break;
						}
					}

					for(var j = binderConfig.formatters.length - 1; j >= 0; j--)
					{
						if(binderConfig.formatters[j].fn.indexed === true) binderConfig.indexed = true;
					}

					var modelBinder = new View.binders[parsedBinding.binder](binderConfig);

					this._modelBindersMap.add(modelBinder);
				}
			}
		}

		// Check for invalid combination of :each and :if binders:
		if(process.env.NODE_ENV !== 'production')
		{
			var ifBinders = this._modelBindersMap.binders.filter(function(binder){ return binder instanceof View.binders.if || binder instanceof View.binders.ifnot; });

			if(this._collectionBinder && ifBinders.length > 0)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('You cannot combine :each binder with :if binder on the same element');
				console.log(this.element);
			}

			if(ifBinders.length > 2)
			{
				if(this.element && this.element.parentNode)
				{
					this.element.parentNode.scrollIntoView();
					this.element.parentNode.style.outline = '2px dashed red';
				}
				console.error('You cannot combine multiple :if binders on the same element');
				console.log(this.element);
			}
		}

	}
1088979
function bind( fn, scope ) {
    var bound, args;
    if ( fn.bind === nativeBind && nativeBind ) return nativeBind.apply( fn, Array.prototype.slice.call( arguments, 1 ) );
    args = Array.prototype.slice.call( arguments, 2 );
    // @todo: don't link this
    bound = function() {
        if ( !(this instanceof bound) ) return fn.apply( scope, args.concat( Array.prototype.slice.call( arguments ) ) );
        W.ctor.prototype = fn.prototype;
        var self = new ctor();
        var result = fn.apply( self, args.concat( Array.prototype.slice.call( arguments ) ) );
        if ( Object( result ) === result ) return result;
        return self;
    };
    return bound;
}
511846
def ng_bindings(binding, opt = {})
    opt[:root_selector] ||= ng_root_selector
    ng.get_nodes_2 :findBindingsIds, [binding, opt[:exact] == true], opt
  end
567902
function(model) {

    const modelPrev = model.collection.prev(model);
    const modelNext = model.collection.next(model);
    let mPrevSel, mNextSel;
    if ((typeof modelPrev !== "undefined" && modelPrev !== null)) { mPrevSel = this._getSelection(modelPrev); }
    if ((typeof modelNext !== "undefined" && modelNext !== null)) { mNextSel = this._getSelection(modelNext); }
    return [mPrevSel,mNextSel];
  }
530076
function getVisualizersDescriptor() {
        //we merge the contents of the CONFIG.visualizerDescriptors by id
        var indexById = function (objectArray, id) {
                var i,
                    index = -1;
                for (i = 0; i < objectArray.length; i++) {
                    if (objectArray[i].id === id) {
                        index = i;
                        break;
                    }
                }

                return index;
            },
            getVisualizerDescriptor = function (path) {
                try {
                    var descriptor = fs.readFileSync(path, 'utf-8');
                    descriptor = JSON.parse(descriptor);
                    return descriptor;
                } catch (e) {
                    //we do not care much of the error just give back an empty array
                    logger.error(e);
                    return [];
                }
            },
            allVisualizersDescriptor = [],
            i, j;

        for (i = 0; i < gmeConfig.visualization.visualizerDescriptors.length; i++) {
            var descriptor = getVisualizerDescriptor(gmeConfig.visualization.visualizerDescriptors[i]);
            if (descriptor.length) {
                for (j = 0; j < descriptor.length; j++) {
                    var index = indexById(allVisualizersDescriptor, descriptor[j].id);
                    if (index !== -1) {
                        allVisualizersDescriptor[index] = descriptor[j];
                    } else {
                        allVisualizersDescriptor.push(descriptor[j]);
                    }
                }
            }
        }
        return allVisualizersDescriptor.sort(function (a, b) {
            if (a.id < b.id) {
                return -1;
            }
            if (a.id > b.id) {
                return 1;
            }
            return 0;
        });
    }
1359247
function extendBinding(binding, extension){
    /** @cut */ var info = basis.dev.getInfo(extension, 'map');

    binding.bindingId = bindingSeed++;

    for (var key in extension)
    {
      var def = null;
      var value = extension[key];

      // NOTE: check for Node, because first extendBinding invoke before Node class declared
      if ((Node && value instanceof Node) || basis.resource.isResource(value))
      {
        def = {
          events: 'satelliteChanged',
          getter: (function(key, satellite){
            var resource = typeof satellite == 'function' ? satellite : null;
            var init = function(node){
              init = false;

              if (resource)
              {
                satellite = resource();
                if (satellite instanceof Node == false)
                  return;
                resource = null;
              }

              node.setSatellite(key, satellite);

              /** @cut */ if (node.satellite[key] !== satellite)
              /** @cut */   basis.dev.warn('basis.ui.binding: implicit satellite `' + key + '` attach to owner failed');
            };
            return function(node){
              if (init)
                init(node);

              return resource || (node.satellite[key] ? node.satellite[key].element : null);
            };
          })(key, value)
        };
      }
      else
      {
        if (value)
        {
          if (typeof value == 'string')
            value = BINDING_PRESET.process(key, value);
          else
            // if value has bindingBridge means that it can update itself
            if (value.bindingBridge)
              value = basis.fn.$const(value);

          if (typeof value != 'object')
          {
            def = {
              getter: typeof value == 'function' ? value : basis.getter(value)
            };
          }
          else
            if (Array.isArray(value))
            {
              def = {
                events: value[0],
                getter: basis.getter(value[1])
              };
            }
            else
            {
              def = {
                events: value.events,
                getter: basis.getter(value.getter)
              };
            }
        }
      }

      /** @cut */ if (def && info && info.hasOwnProperty(key))
      /** @cut */   def.loc = info[key];

      binding[key] = def;
    }
  }
524423
function queryDef(flags, id, bindings) {
    var bindingDefs = [];
    for (var propName in bindings) {
        var bindingType = bindings[propName];
        bindingDefs.push({ propName: propName, bindingType: bindingType });
    }
    return {
        // will bet set by the view definition
        nodeIndex: -1,
        parent: null,
        renderParent: null,
        bindingIndex: -1,
        outputIndex: -1,
        // regular values
        // TODO(vicb): check
        checkIndex: -1, flags: flags,
        childFlags: 0,
        directChildFlags: 0,
        childMatchedQueries: 0,
        ngContentIndex: -1,
        matchedQueries: {},
        matchedQueryIds: 0,
        references: {},
        childCount: 0,
        bindings: [],
        bindingFlags: 0,
        outputs: [],
        element: null,
        provider: null,
        text: null,
        query: { id: id, filterId: filterQueryId(id), bindings: bindingDefs },
        ngContent: null
    };
}
299479
function () {

            var bindings = this._cfg.bind;
            var isBound = false;
            // it doesn't make sense to bind both index and value,
            // so we just state that the index takes precedence on the value
            if (bindings.selectedIndex) {
                var index = this._transform(bindings.selectedIndex.transform, bindings.selectedIndex.inside[bindings.selectedIndex.to], "toWidget");
                if (index != null) {
                    if (!this.isIndexValid(index)) {
                        index = -1;
                    }
                    return index;
                }
                isBound = true;
            }
            if (bindings.value) {
                var newValue = this._transform(bindings.value.transform, bindings.value.inside[bindings.value.to], "toWidget");
                if (newValue != null) {
                    return this.getIndex(newValue);
                }
                isBound = true;
            }

            if (!isBound) {
                this.$logWarn(this.BINDING_NEEDED, [this.$class, "selectedIndex"]);
            }
        }