Skip to content
Closed
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions packages/@ember/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ export function buildInitializerMethod<
B extends 'initializers' | 'instanceInitializers',
T extends B extends 'initializers' ? Engine : EngineInstance,
>(bucketName: B, humanName: string) {
if (bucketName === '__proto__' || bucketName === 'constructor' || bucketName === 'prototype') {
throw new Error(`Invalid bucketName: ${bucketName}`);
}
return function (this: typeof Engine, initializer: Initializer<T>) {
// If this is the first initializer being added to a subclass, we are going to reopen the class
// to make sure we have a new `initializers` object, which extends from the parent class' using
Expand Down