Skip to content
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

[Bug]: set symbol on factory objects only in Prod for sealed objects #19470

Merged
merged 7 commits into from
Mar 21, 2021
Merged
Changes from 5 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
4 changes: 4 additions & 0 deletions packages/@ember/-internals/metal/lib/mixin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
@module @ember/object
*/
import { INIT_FACTORY } from '@ember/-internals/container';
import { ENV } from '@ember/-internals/environment';
import { Meta, meta as metaFor, peekMeta } from '@ember/-internals/meta';
import {
Expand Down Expand Up @@ -575,6 +576,9 @@ export default class Mixin {
this.ownerConstructor = undefined;
this._without = undefined;

// Eagerly add INIT_FACTORY to avoid issues in DEBUG as a result of Object.seal(mixin)
this[INIT_FACTORY] = null;
pzuraq marked this conversation as resolved.
Show resolved Hide resolved

if (DEBUG) {
/*
In debug builds, we seal mixins to help avoid performance pitfalls.
Expand Down