New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
User never visited
Closed: Dec 2013
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment
link

Issue 289348: DevToools: console: `copy()` should JSON.stringify objects instead of returning '[object Object]'

Reported by remy.a.b...@gmail.com, Sep 11 2013

Issue description

This is in response to this tweet thread: https://twitter.com/remybach/status/375573175633195008

Chrome Version       : 29.0.1547.65 (Official Build 220622) 

What steps will reproduce the problem?
1. Open the Console in the Dev Tools.
2. Type the following and hit enter: copy({foo: "bar"})
3. Paste the output anywhere.

What is the expected result?
Ideally:

    {
      foo: "bar"
    }

What happens instead?
You get: [object Object]

---

It's not a huge issue or anything, but it would just be really neat to not have to do `copy(JSON.stringify(obj, null, 2))`.

I've got a working example of how to test for this here if it could be of any use: http://jsbin.com/ukufIce/4/edit
 

Comment 1 by paulir...@chromium.org, Sep 12 2013

Labels: Cr-Platform-DevTools Cr-Platform-DevTools-JavaScript
Summary: DevToools: console: `copy()` should JSON.stringify objects instead of returning '[object Object]' (was: Enhance the `copy` function to JSON.stringify objects instead of returning '[object Object]')
I've heard this a few times. Some clever sugar.

Comment 2 by remy.a.b...@gmail.com, Sep 12 2013

Wish I could take credit for the 'clever sugar', but that's all thanks to the jQuery guys :P

Not sure if I can edit the original report, but this link is better (shows the correct panes in jsbin): http://jsbin.com/ukufIce/4/edit?js,console

Comment 3 by pfeldman@chromium.org, Sep 16 2013

Owner: zvorygin@chromium.org
Status: Assigned
To summarize:

- copy(Node) copies markup
- copy(JSON.stringify-able) copies JSON
- copy(obj) copies String(obj)

sg?

Comment 4 by remy.a.b...@gmail.com, Sep 16 2013

Sounds about right to me :)

Comment 5 by zvorygin@chromium.org, Dec 3 2013

Status: Started

Comment 6 by bugdroid1@chromium.org, Dec 6 2013

Project Member

Comment 7 by zvorygin@chromium.org, Dec 6 2013

Status: Fixed

Sign in to add a comment