Skip to content

Commit

Permalink
[Bugfix] object to string
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Apr 15, 2018
1 parent 3c26399 commit 36b49d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ember-metal/lib/namespace_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function calculateToString(target) {
let superclass = target;
do {
superclass = Object.getPrototypeOf(superclass);
if (superclass === Function.prototype) {
if (superclass === Function.prototype || superclass === Object.prototype) {
break;
}
str = getName(target);
Expand Down
16 changes: 16 additions & 0 deletions packages/ember-metal/tests/namespace_search_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Mixin } from '..';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
'NamespaceSearch',
class extends AbstractTestCase {
['@test classToString: null as this inside class must not throw error'](assert) {
let mixin = Mixin.create();
assert.equal(
mixin.toString(),
'(unknown)',
'this = null should be handled on Mixin.toString() call'
);
}
}
);

0 comments on commit 36b49d8

Please sign in to comment.