Skip to content

Change assert to warn for unneeded restriction around creating sub-applications #20915

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getOwner } from '@ember/-internals/owner';
import { assert } from '@ember/debug';
import { assert, warn } from '@ember/debug';
import { get, set } from '@ember/-internals/metal';
import EmberObject from '@ember/object';
import { getElementView } from './utils';
Expand Down Expand Up @@ -162,7 +162,7 @@ export default class EventDispatcher extends EmberObject {
`You cannot use the same root element (${specifiedRootElement}) multiple times in an Ember.Application`,
!rootElement.classList.contains(ROOT_ELEMENT_CLASS)
);
assert(
warn(
'You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application',
(() => {
let target = rootElement.parentNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/@ember/application/tests/application_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ moduleFor(
}

[`@test you cannot make a new application that is a descendant of an existing application`]() {
expectAssertion(() => {
expectWarning(() => {
runTask(() =>
this.createSecondApplication({
rootElement: '#one-child',
Expand Down
Loading