Skip to content

Commit 14b3d81

Browse files
authored
Merge pull request #19849 from danwenzel/patch-1
Fix typo in error messages
2 parents 942dca8 + 4afbe91 commit 14b3d81

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/@ember/-internals/container/lib/container.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default class Container {
145145
*/
146146
lookup(fullName: string, options: LookupOptions): any {
147147
if (this.isDestroyed) {
148-
throw new Error(`Can not call \`.lookup\` after the owner has been destroyed`);
148+
throw new Error(`Cannot call \`.lookup\` after the owner has been destroyed`);
149149
}
150150
assert('fullName must be a proper full name', this.registry.isValidFullName(fullName));
151151
return lookup(this, this.registry.normalize(fullName), options);
@@ -212,7 +212,7 @@ export default class Container {
212212
*/
213213
factoryFor<T, C>(fullName: string): Factory<T, C> | undefined {
214214
if (this.isDestroyed) {
215-
throw new Error(`Can not call \`.factoryFor\` after the owner has been destroyed`);
215+
throw new Error(`Cannot call \`.factoryFor\` after the owner has been destroyed`);
216216
}
217217
let normalizedName = this.registry.normalize(fullName);
218218

@@ -500,7 +500,7 @@ export class FactoryManager<T, C> {
500500

501501
if (container.isDestroyed) {
502502
throw new Error(
503-
`Can not create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`
503+
`Cannot create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`
504504
);
505505
}
506506

packages/@ember/-internals/container/tests/container_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ moduleFor(
608608

609609
assert.throws(() => {
610610
container.lookup('service:foo');
611-
}, /Can not call `.lookup` after the owner has been destroyed/);
611+
}, /Cannot call `.lookup` after the owner has been destroyed/);
612612
}
613613

614614
[`@test assert when calling factoryFor after destroy on a container`](assert) {
@@ -626,7 +626,7 @@ moduleFor(
626626

627627
assert.throws(() => {
628628
container.factoryFor('service:foo');
629-
}, /Can not call `.factoryFor` after the owner has been destroyed/);
629+
}, /Cannot call `.factoryFor` after the owner has been destroyed/);
630630
}
631631

632632
// this is skipped until templates and the glimmer environment do not require `OWNER` to be
@@ -690,7 +690,7 @@ moduleFor(
690690

691691
assert.throws(() => {
692692
Factory.create();
693-
}, /Can not create new instances after the owner has been destroyed \(you attempted to create service:other\)/);
693+
}, /Cannot create new instances after the owner has been destroyed \(you attempted to create service:other\)/);
694694
}
695695
}
696696
);

0 commit comments

Comments
 (0)