Skip to content

Commit

Permalink
[FEATURE ember-routing-htmlbars-improved-actions] Enable by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed May 11, 2015
1 parent 44fd58d commit 92bf6ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
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

0 comments on commit 92bf6ef

Please sign in to comment.