Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE ember-routing-htmlbars-improved-actions] Enable by default. #11116

Merged
merged 1 commit into from
May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ember-views-component-block-info": null,
"ember-routing-core-outlet": null,
"ember-libraries-isregistered": null,
"ember-routing-htmlbars-improved-actions": null
"ember-routing-htmlbars-improved-actions": true
},
"debugStatements": [
"Ember.warn",
Expand Down
22 changes: 14 additions & 8 deletions packages/ember-routing-htmlbars/lib/keywords/element-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { readUnwrappedModel } from "ember-views/streams/utils";
import { isSimpleClick } from "ember-views/system/utils";
import ActionManager from "ember-views/system/action_manager";

function assert(message, test) {
// This only exists to prevent defeatureify from error when attempting
// to transform the same source twice (tldr; you can't nest stripped statements)
Ember.assert(message, test);
}

export default {
setupState: function(state, env, scope, params, hash) {
var getStream = env.hooks.get;
Expand All @@ -13,15 +19,15 @@ export default {
var actionName = read(params[0]);

if (Ember.FEATURES.isEnabled("ember-routing-htmlbars-improved-actions")) {
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' || typeof actionName === 'function');
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' || typeof actionName === 'function');
} else {
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');
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');
}

var actionArgs = [];
Expand Down