Closed Bug 1278310 Opened 8 years ago Closed 4 years ago

Use @@toStringTag rather than Debugger.Object.prototype.class for object previews

Categories

(DevTools :: Debugger, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1526688

People

(Reporter: fitzgen, Unassigned)

References

(Blocks 1 open bug)

Details

Of course, we should only run safe, native/DOM @@toStringTag methods, not debuggee provided methods. In the latter case, we should fallback to something else (it isn't clear to me whether Debugger.Object.prototype.class should still exist at all...)
Just so I'm clear: @@toStringTag is an ES6 thing, intended to replace the [[Class]] internal property. Is that correct?

This is an improvement, but there's not immediate urgency to implement it. Marking this as P2.
Priority: -- → P2
Product: Firefox → DevTools
Priority: P2 → P3

Brian what do you think about this?

Flags: needinfo?(bhackett1024)

I guess my first reaction is that it would be neat if we could run debuggee provided toString methods. The problem reminds me of something we discussed at the workweek where we could attempt to run debuggee code and bail out if there are side effects, e.g. to support auto-complete / related features when evaluating things in the console. If we had a way to do this then we could also call debuggee toString() methods in object previews, bailing out if they start doing something crazy.

Flags: needinfo?(bhackett1024)
Blocks: dbg-server
Type: defect → enhancement
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.