From ba5f181551173d4189fb109e340a17c37b21fbc3 Mon Sep 17 00:00:00 2001 From: patricklx Date: Thu, 7 May 2020 21:54:52 +0200 Subject: [PATCH] fix attrs/args - toString is undefined (#1189) * fix attrs/args - toString is undefined getClassName already handles this case * object name is now from toString * Update object-inspector-test.js --- ember_debug/object-inspector.js | 4 ++-- tests/ember_debug/object-inspector-test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ember_debug/object-inspector.js b/ember_debug/object-inspector.js index cc9d7bf860..acf547e3a7 100644 --- a/ember_debug/object-inspector.js +++ b/ember_debug/object-inspector.js @@ -457,7 +457,7 @@ export default EmberObject.extend(PortMixin, { parentObject: objectId, property, objectId: details.objectId, - name: object.toString(), + name: getClassName(object), details: details.mixins, errors: details.errors }); @@ -471,7 +471,7 @@ export default EmberObject.extend(PortMixin, { let details = this.mixinsForObject(object); this.sendMessage('updateObject', { objectId: details.objectId, - name: object.toString(), + name: getClassName(object), details: details.mixins, errors: details.errors }); diff --git a/tests/ember_debug/object-inspector-test.js b/tests/ember_debug/object-inspector-test.js index 6880104f5a..79c6b08b9f 100644 --- a/tests/ember_debug/object-inspector-test.js +++ b/tests/ember_debug/object-inspector-test.js @@ -712,7 +712,7 @@ module('Ember Debug - Object Inspector', function(hooks) { let message = await inspectObject(proxy); - assert.ok(message.name.includes('(unknown)')); + assert.ok(message.name.includes('ObjectProxy'), 'object name should start with