translates new bindings `var a = 3` into `self.a = 3` and existing bindings `var a = 3` into `a = 3` for re-assignments
162271
function globalizeDeclaration(node, bindings) {
  return node.declarations.map(declaration =>
    t.expressionStatement(
      t.assignmentExpression(
        "=",
        getAssignmentTarget(declaration.id, bindings),
        declaration.init || t.unaryExpression("void", t.numericLiteral(0))
      )
    )
  );
}
1347297
private Context translateArrayAssign(WyilFile.Expr.ArrayAccess lval, Expr rval, Context context) {
		// Translate src and index expressions
		Pair<Expr, Context> p1 = translateExpressionWithChecks(lval.getFirstOperand(), null, context);
		Pair<Expr, Context> p2 = translateExpressionWithChecks(lval.getSecondOperand(), null, p1.second());
		Expr source = p1.first();
		Expr index = p2.first();
		// Emit verification conditions to check access in bounds
		checkExpressionPreconditions(lval, p2.second());
		// Construct array update for "pass thru"
		Expr.Operator update = new Expr.ArrayUpdate(source, index, rval);
		return translateSingleAssignment((LVal) lval.getFirstOperand(), update, p2.second());
	}
1157392
function applyNew(cls, args) {
    args = _.toArray(args);
    args.unshift(null);
    return new (cls.bind.apply(cls, args));
  }
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;
}
1334848
private static Node varToAssign(Node var) {
    Node assign =
        IR.assign(var.getFirstChild().cloneNode(), var.getFirstChild().removeFirstChild());
    return IR.exprResult(assign).useSourceInfoIfMissingFromForTree(var);
  }
705655
function () {
            var value, binding = this._binding;
            if (!binding) {
                return;
            }
            value = binding.inside[binding.to];
            if (ariaUtilsType.isArray(value)) {
                // Constrain values to be between 0 and 1 and the first to be smaller
                this.value[0] = Math.max(0, Math.min(value[0], value[1], 1));
                this.value[1] = Math.min(1, Math.max(value[0], value[1], 0));
            }
            ariaUtilsJson.setValue(binding.inside, binding.to, this.value, this._bindingCallback);
        }
625259
public static java.util.function.Function<Identifier, SyntacticItem> removeFromBinding(
			java.util.function.Function<Identifier, SyntacticItem> binding, Tuple<Identifier> variables) {
		return (Identifier var) -> {
			// Sanity check whether this is a variable which is being removed
			for (int i = 0; i != variables.size(); ++i) {
				if (var.equals(variables.get(i))) {
					return null;
				}
			}
			// Not being removed, reuse existing binding
			return binding.apply(var);
		};
	}
165300
function makeVar(id, expr) {
  return assignmentExpression('=',
    memberExpression(identifier('vars'), literal(id), true),
    expr);
}
1137502
function genAssignmentCode (
  value,
  assignment
) {
  var modelRs = parseModel(value);
  if (modelRs.idx === null) {
    return (value + "=" + assignment)
  } else {
    return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
      "if (!Array.isArray($$exp)){" +
        value + "=" + assignment + "}" +
      "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  }
}
1227112
def _rebind_variables(self, new_inputs):
        
        expr = self._expr

        # If we have 11+ variables, some of our variable names may be
        # substrings of other variable names. For example, we might have x_1,
        # x_10, and x_100. By enumerating in reverse order, we ensure that
        # every variable name which is a substring of another variable name is
        # processed after the variable of which it is a substring. This
        # guarantees that the substitution of any given variable index only
        # ever affects exactly its own index. For example, if we have variables
        # with indices going up to 100, we will process all of the x_1xx names
        # before x_1x, which will be before x_1, so the substitution of x_1
        # will not affect x_1x, which will not affect x_1xx.
        for idx, input_ in reversed(list(enumerate(self.inputs))):
            old_varname = "x_%d" % idx
            # Temporarily rebind to x_temp_N so that we don't overwrite the
            # same value multiple times.
            temp_new_varname = "x_temp_%d" % new_inputs.index(input_)
            expr = expr.replace(old_varname, temp_new_varname)
        # Clear out the temp variables now that we've finished iteration.
        return expr.replace("_temp_", "_")
1846
@NonNull
    public final ItemBinding<T> bindExtra(int variableId, Object value) {
        if (extraBindings == null) {
            extraBindings = new SparseArray<>(1);
        }
        extraBindings.put(variableId, value);
        return this;
    }
1146782
def generate_binding(a_binding=binding)
      a_binding.local_variables do |local_var|
        a_binding.local_variable_set local_var, nil
      end
      @bound_procs.each_with_index do |bound_proc, index|
        a_binding.local_variable_set "proc_#{index}",  bound_proc
      end
      @bound_constants.each_with_index do |bound_const, index|
        a_binding.local_variable_set "const_#{index}", bound_const
      end
      a_binding
    end
6497
function resolveBindingValue(oldValue, value) {
    if (value === undefined && oldValue === null) {
      return value;
    }
    return (value === null || value === undefined) ? oldValue : value;
  }
942587
def construct(self, **bindings):
    
    context = _assign_values_to_unbound_vars(self._unbound_vars, bindings)
    context.update(self._partial_context)
    return self._construct(context)
1279978
private Context translateSingleAssignment(WyilFile.LVal lval, Expr rval, Context context) {

		// FIXME: this method is a bit of a kludge. It would be nicer,
		// eventually, to have all right-hand side expression represented in
		// WyTP directly. This could potentially be done by including an update
		// operation in WyTP ... ?

		switch (lval.getOpcode()) {
		case WyilFile.EXPR_arrayaccess:
		case WyilFile.EXPR_arrayborrow:
			return translateArrayAssign((WyilFile.Expr.ArrayAccess) lval, rval, context);
		case WyilFile.EXPR_dereference:
			return translateDereference((WyilFile.Expr.Dereference) lval, rval, context);
		case WyilFile.EXPR_recordaccess:
		case WyilFile.EXPR_recordborrow:
			return translateRecordAssign((WyilFile.Expr.RecordAccess) lval, rval, context);
		case WyilFile.EXPR_variablemove:
		case WyilFile.EXPR_variablecopy:
			return translateVariableAssign((WyilFile.Expr.VariableAccess) lval, rval, context);
		default:
			throw new SyntacticException("unknown lval encountered (" + lval + ")", context.getEnclosingFile().getEntry(),
					lval);
		}
	}
383618
function(set, clause, result, useSet) {
		if(result && typeof result === "object" && useSet !== false) {
			if( this.translators[clause] ) {
				set = this.translators.where.toSet(set, result);
			} else {
				set = assign(set, result);
			}
			return true;
		}
		else if(result) {
			return useSet === undefined ? undefined : false;
		}
		else {
			return false;
		}
	}
579826
function parseBindings(bindings) {
        var config = {};

        switch (typeof bindings.value) {
            case 'string':
            case 'function':
                config.title = bindings.value;
                break
            case 'object':
                config = Object.assign({}, bindings.value);
        }

        // Parse args (eg: v-d-tooltip:my-container)
        if (bindings.arg) {
            config.container = "#" + (bindings.arg); // #my-container
        }

        // Parse modifiers. eg: v-d-tooltip.my-modifier
        Object.keys(bindings.modifiers).forEach(function (mod) {
            // Parse if the title allows HTML
            if (/^html$/.test(mod)) {
                config.html = true;

            // Parse animation
            } else if (/^nofade$/.test(mod)) {
                config.animation = false;

            // Parse placement
            } else if (/^(auto|top(left|right)?|bottom(left|right)?|left(top|bottom)?|right(top|bottom)?)$/.test(mod)) {
                config.placement = mod;

            // Parse boundary
            } else if (/^(window|viewport)$/.test(mod)) {
                config.boundary = mod;

            // Parse delay
            } else if (/^d\d+$/.test(mod)) {
                var delay = parseInt(mod.slice(1), 10) || 0;
                if (delay) {
                    config.delay = delay;
                }

            // Parse offset
            }  else if (/^o-?\d+$/.test(mod)) {
                var offset = parseInt(mod.slice(1), 10) || 0;
                if (offset) {
                    config.offset = offset;
                }
            }
        });

        // Parse selected triggers.
        var selectedTriggers = {};
        var triggers = typeof config.trigger === 'string' ? config.trigger.trim().split(/\s+/) : [];

        triggers.forEach(function (trigger) {
            if (validTriggers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        // Parse trigger modifiers. eg: v-d-tooltip.click
        Object.keys(validTriggers).forEach(function (trigger) {
            if (bindings.modifiers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        config.trigger = Object.keys(selectedTriggers).join(' ');

        // Convert `blur` to `focus`
        if (config.trigger === 'blur') {
            config.trigger = 'focus';
        }

        // If there's no trigger assigned, just delete the key.
        if (!config.trigger) {
            delete config.trigger;
        }

        return config
    }