Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (var prop in hash) {
var value = hash[prop];
// Classes are processed separately
if (prop === 'class' && isStream(value)) {
hash.classBinding = value._label;
delete hash['class'];
continue;
}
if (prop === 'classBinding') {
continue;
}
if (IS_BINDING.test(prop)) {
if (isStream(value)) {
Ember.warn("You're attempting to render a view by passing " +
prop + " " +
"to a view helper without a quoted value, " +
"but this syntax is ambiguous. You should either surround " +
prop + "'s value in quotes or remove `Binding` " +
"from " + prop + ".");
} else if (typeof value === 'string') {
hash[prop] = view._getBindingForStream(value);
}
} else {
if (isStream(value) && prop !== 'id') {
hash[prop + 'Binding'] = view._getBindingForStream(value);
delete hash[prop];
}
}
}
function makeBindings(hash, options, view) {
for (var prop in hash) {
var value = hash[prop];
// Classes are processed separately
if (prop === 'class' && isStream(value)) {
hash.classBinding = value._label;
delete hash['class'];
continue;
}
if (prop === 'classBinding') {
continue;
}
if (IS_BINDING.test(prop)) {
if (isStream(value)) {
Ember.warn("You're attempting to render a view by passing " +
prop + " " +
"to a view helper without a quoted value, " +
"but this syntax is ambiguous. You should either surround " +
prop + "'s value in quotes or remove `Binding` " +
export function readUnwrappedModel(object) {
if (isStream(object)) {
var result = object.value();
// If the path is exactly `controller` then we don't unwrap it.
if (object.label !== 'controller') {
while (ControllerMixin.detect(result)) {
result = get(result, 'model');
}
}
return result;
} else {
return object;
}
}
continue;
}
if (IS_BINDING.test(prop)) {
if (isStream(value)) {
Ember.warn("You're attempting to render a view by passing " +
prop + " " +
"to a view helper without a quoted value, " +
"but this syntax is ambiguous. You should either surround " +
prop + "'s value in quotes or remove `Binding` " +
"from " + prop + ".");
} else if (typeof value === 'string') {
hash[prop] = view._getBindingForStream(value);
}
} else {
if (isStream(value) && prop !== 'id') {
hash[prop + 'Binding'] = view._getBindingForStream(value);
delete hash[prop];
}
}
}
}
!element.getAttribute('class')
);
view.appendChild(classView);
}
var attrKeys = keys(hash);
var attr, path, lazyValue, attrView;
for (var i=0, l=attrKeys.length;i
function bind(property, hash, options, env, preserveContext, shouldDisplay, valueNormalizer, childProperties, _viewClass) {
var valueStream = isStream(property) ? property : this.getStream(property);
var lazyValue;
if (childProperties) {
lazyValue = new SimpleStream(valueStream);
var subscriber = function(childStream) {
childStream.value();
lazyValue.notify();
};
for (var i = 0; i < childProperties.length; i++) {
var childStream = valueStream.get(childProperties[i]);
childStream.value();
childStream.subscribe(subscriber);
}
} else {
export function partialHelper(params, hash, options, env) {
options.helperName = options.helperName || 'partial';
var name = params[0];
if (isStream(name)) {
options.template = createPartialTemplate(name);
bind.call(this, name, hash, options, env, true, exists);
} else {
return renderPartial(name, this, env, options.morph.contextualElement);
}
}
handler(event) {
if (!isAllowedEvent(event, allowedKeys)) { return true; }
if (options.preventDefault !== false) {
event.preventDefault();
}
if (options.bubbles === false) {
event.stopPropagation();
}
var target = options.target.value();
var actionName;
if (isStream(actionNameOrStream)) {
actionName = actionNameOrStream.value();
Ember.assert("You specified a quoteless path to the {{action}} helper " +
"which did not resolve to an action name (a string). " +
"Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).",
typeof actionName === 'string');
} else {
actionName = actionNameOrStream;
}
run(function runRegisteredAction() {
if (target.send) {
target.send.apply(target, actionArgs(parameters, actionName));
} else {
Ember.assert("The action '" + actionName + "' did not exist on " + target, typeof target[actionName] === 'function');
target[actionName].apply(target, actionArgs(parameters));
export default function attribute(morph, env, attrName, attrValue) {
if (boundAttributesEnabled) {
var attrNode = new AttrNode(attrName, attrValue);
attrNode._morph = morph;
env.data.view.appendChild(attrNode);
} else {
if (isStream(attrValue)) {
throw new EmberError('Bound attributes are not yet supported in Ember.js');
} else {
var sanitizedValue = sanitizeAttributeValue(env.dom, morph.element, attrName, attrValue);
env.dom.setProperty(morph.element, attrName, sanitizedValue);
}
}
}