@@ -20,18 +20,6 @@ import { DEBUG } from '@glimmer/env';
20
20
import { destroy , isDestroying , isDestroyed , registerDestructor } from '@glimmer/destroyable' ;
21
21
import { OWNER } from '@glimmer/owner' ;
22
22
23
- interface HasToStringExtension {
24
- toStringExtension : ( ) => void ;
25
- }
26
-
27
- function hasToStringExtension ( val : unknown ) : val is HasToStringExtension {
28
- return (
29
- typeof val === 'object' &&
30
- val !== null &&
31
- typeof ( val as HasToStringExtension ) . toStringExtension === 'function'
32
- ) ;
33
- }
34
-
35
23
const wasApplied = new WeakSet ( ) ;
36
24
37
25
const initCalled = DEBUG ? new WeakSet ( ) : undefined ; // only used in debug builds to enable the proxy trap
@@ -376,27 +364,12 @@ class CoreObject {
376
364
student.toString(); //=> "<(subclass of Person):ember1025>"
377
365
```
378
366
379
- If the method `toStringExtension` is defined, its return value will be
380
- included in the output.
381
-
382
- ```javascript
383
- const Teacher = Person.extend({
384
- toStringExtension() {
385
- return this.get('fullName');
386
- }
387
- });
388
- teacher = Teacher.create();
389
- teacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
390
- ```
391
-
392
367
@method toString
393
368
@return {String } string representation
394
369
@public
395
370
*/
396
371
toString ( ) {
397
- let extension = hasToStringExtension ( this ) ? `:${ this . toStringExtension ( ) } ` : '' ;
398
-
399
- return `<${ getFactoryFor ( this ) || '(unknown)' } :${ guidFor ( this ) } ${ extension } >` ;
372
+ return `<${ getFactoryFor ( this ) || '(unknown)' } :${ guidFor ( this ) } >` ;
400
373
}
401
374
402
375
/**
0 commit comments