Skip to content

Commit 92bf6ef

Browse files
committed
[FEATURE ember-routing-htmlbars-improved-actions] Enable by default.
1 parent 44fd58d commit 92bf6ef

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

features.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ember-views-component-block-info": null,
1919
"ember-routing-core-outlet": null,
2020
"ember-libraries-isregistered": null,
21-
"ember-routing-htmlbars-improved-actions": null
21+
"ember-routing-htmlbars-improved-actions": true
2222
},
2323
"debugStatements": [
2424
"Ember.warn",

packages/ember-routing-htmlbars/lib/keywords/element-action.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { readUnwrappedModel } from "ember-views/streams/utils";
55
import { isSimpleClick } from "ember-views/system/utils";
66
import ActionManager from "ember-views/system/action_manager";
77

8+
function assert(message, test) {
9+
// This only exists to prevent defeatureify from error when attempting
10+
// to transform the same source twice (tldr; you can't nest stripped statements)
11+
Ember.assert(message, test);
12+
}
13+
814
export default {
915
setupState: function(state, env, scope, params, hash) {
1016
var getStream = env.hooks.get;
@@ -13,15 +19,15 @@ export default {
1319
var actionName = read(params[0]);
1420

1521
if (Ember.FEATURES.isEnabled("ember-routing-htmlbars-improved-actions")) {
16-
Ember.assert("You specified a quoteless path to the {{action}} helper " +
17-
"which did not resolve to an action name (a string). " +
18-
"Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).",
19-
typeof actionName === 'string' || typeof actionName === 'function');
22+
assert("You specified a quoteless path to the {{action}} helper " +
23+
"which did not resolve to an action name (a string). " +
24+
"Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).",
25+
typeof actionName === 'string' || typeof actionName === 'function');
2026
} else {
21-
Ember.assert("You specified a quoteless path to the {{action}} helper " +
22-
"which did not resolve to an action name (a string). " +
23-
"Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).",
24-
typeof actionName === 'string');
27+
assert("You specified a quoteless path to the {{action}} helper " +
28+
"which did not resolve to an action name (a string). " +
29+
"Perhaps you meant to use a quoted actionName? (e.g. {{action 'save'}}).",
30+
typeof actionName === 'string');
2531
}
2632

2733
var actionArgs = [];

0 commit comments

Comments
 (0)