-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] Fix default args for calculateLocationDisplay. (#13312)
Ensure that undefined or null args are allowed for `calculateLocationDisplay`. Fixes an error transforming an inline `{{link-to}}` without legacy view support. (cherry picked from commit 05de8a5)
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
packages/ember-template-compiler/lib/system/calculate-location-display.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/ember-template-compiler/tests/plugins/transform-inline-link-to-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Ember from 'ember-metal/core'; | ||
import { compile } from 'ember-template-compiler'; | ||
import AssertNoViewAndControllerPaths from 'ember-template-compiler/plugins/assert-no-view-and-controller-paths'; | ||
import plugins, { registerPlugin } from 'ember-template-compiler/plugins'; | ||
|
||
function registerAstPlugin(plugin) { | ||
registerPlugin('ast', plugin); | ||
} | ||
|
||
function removeAstPlugin(plugin) { | ||
let index = plugins['ast'].indexOf(plugin); | ||
plugins['ast'].splice(index, 1); | ||
} | ||
|
||
let legacyViewSupportOriginalValue; | ||
|
||
import isEnabled from 'ember-metal/features'; | ||
if (!isEnabled('ember-glimmer')) { | ||
// jscs:disable | ||
|
||
QUnit.module('ember-template-compiler: assert-no-view-and-controller-paths without legacy view support', { | ||
setup() { | ||
legacyViewSupportOriginalValue = Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT; | ||
Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT = false; | ||
registerAstPlugin(AssertNoViewAndControllerPaths); | ||
}, | ||
|
||
teardown() { | ||
Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT = legacyViewSupportOriginalValue; | ||
removeAstPlugin(AssertNoViewAndControllerPaths); | ||
} | ||
}); | ||
|
||
QUnit.test('Can transform an inline {{link-to}} without error', function() { | ||
expect(0); | ||
|
||
compile(`{{link-to 'foo' 'index'}}`, { | ||
moduleName: 'foo/bar/baz' | ||
}); | ||
}); | ||
|
||
} |