Skip to content

Commit

Permalink
add assertions that prevent reopening on native classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pzuraq committed Jan 28, 2018
1 parent 36b8034 commit 8b91e86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/ember-runtime/lib/system/core_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ let ClassMixinProps = {
@public
*/
reopen() {
assert(`You cannot reopen ${this} because it was defined with native class syntax`, this.hasOwnProperty('PrototypeMixin'));
this.willReopen();
reopen.apply(this.PrototypeMixin, arguments);
return this;
Expand Down Expand Up @@ -902,6 +903,7 @@ let ClassMixinProps = {
@public
*/
reopenClass() {
assert(`You cannot reopen ${this} because it was defined with native class syntax`, this.hasOwnProperty('ClassMixin'));
reopen.apply(this.ClassMixin, arguments);
applyMixin(this, arguments, false);
return this;
Expand Down

0 comments on commit 8b91e86

Please sign in to comment.