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

[BUGFIX beta] Ensure Mixin.prototype.toString is defined. #12636

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Nov 21, 2015

Mixin.prototype is sealed after its initial definition, but Mixin.prototype.toString is assigned later in ember-runtime/namespace. This causes issues when ember-template-compiler.js is loaded before the rest of Ember (because the Mixin.prototype is sealed). Unfortunately, the debug functions (for Object.seal) does not work in the ember-metal package at this time.

This fix is a temporary fix ensures that the slot for toString exists on Mixin.prototype to allow the loading of ember-template-compiler.js to be before or after ember.debug.js. The more permanent fix is to ensure that debugSeal works in ember-metal properly.

Fixes #12623.

`Mixin.prototype` is sealed after its initial definition, but
`Mixin.prototype.toString` is assigned later in `ember-runtime/namespace`.
This causes issues when `ember-template-compiler.js` is loaded before
the rest of Ember (because the `Mixin.prototype` is sealed).
Unfortunately, the debug functions (for `Object.seal`) does not work in
the `ember-metal` package at this time.

This fix is a temporary fix to allow the loading of
`ember-template-compiler.js` to be before or after `ember.debug.js`. The
more permanent fix is to ensure that `debugSeal` works in ember-metal
properly.
@rwjblue
Copy link
Member Author

rwjblue commented Nov 21, 2015

And alternate solution to this, would be to remove this line.

stefanpenner added a commit that referenced this pull request Nov 27, 2015
…xin-prototype

[BUGFIX beta] Ensure Mixin.prototype.toString is defined.
@stefanpenner stefanpenner merged commit ca85208 into emberjs:master Nov 27, 2015
@stefanpenner
Copy link
Member

would be to remove this line.

would love to remove all that code :P But it would pwn globals toString without an alternative. I suspect finding an alternative would be good. #someday

@rwjblue rwjblue deleted the ensure-tostring-has-slot-on-mixin-prototype branch August 24, 2017 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ember.Object is undefined
2 participants