Closed
Bug 807924
Opened 12 years ago
Closed 11 years ago
Trying to inspect objects in Scratchpad sometimes results in type errors
Categories
(DevTools Graveyard :: Scratchpad, defect, P3)
DevTools Graveyard
Scratchpad
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: vporof, Assigned: bbenvie)
References
Details
Attachments
(1 file, 1 obsolete file)
4.35 KB,
patch
|
Details | Diff | Splinter Review |
STR: Write this line in a Scratchpad >> Object.create(null) ..and Inspect Error: TypeError: can't convert null to primitive type Source File: chrome://browser/content/scratchpad.js Line: 483 ..or Display Error: TypeError: can't convert Object to string Source File: chrome://browser/content/scratchpad.js Line: 560 Write this instead: >> Object.create(null).constructor or >> Object.create(null).prototype and Inspect Error: Error: First argument must have an objectActor or an object property! Source File: resource://gre/modules/PropertyPanel.jsm Line: 114
Updated•11 years ago
|
Priority: -- → P3
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bbenvie
Assignee | ||
Comment 1•11 years ago
|
||
I'll fix this in the process of converting the Scratchpad to use VariablesView.
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•11 years ago
|
||
First crack at this. With bug 808369 landing, fixing this just required fixing `Scratchpad.display`. This patch: * adds a new localization to 'scratchpad.properties' for `stringConversionFailed` * wraps the conversion to string in `Scratchpad.writeAsComment` in a try-catch * displays the "Conversion to string failed." error in the catch * adds a test to confirm this functions as expected
Assignee | ||
Comment 4•11 years ago
|
||
And of course I forgot to add the new test file.
Attachment #743369 -
Attachment is obsolete: true
Assignee | ||
Comment 5•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=fc5c3b6f98f5
Assignee | ||
Updated•11 years ago
|
Attachment #743371 -
Flags: review?(rcampbell)
Comment 6•11 years ago
|
||
Comment on attachment 743371 [details] [diff] [review] WIP2 Review of attachment 743371 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/scratchpad/scratchpad.js @@ +550,5 @@ > + try { > + str = aValue + ""; > + } > + catch (ex) { > + str = this.strings.GetStringFromName("stringConversionFailed"); should we return ex.message along with this as well? Though I guess ex.message is likely null. I feel like the exception should return *something*. Maybe preface the str with "Exception: " as we do for other error messages. ::: browser/locales/en-US/chrome/browser/devtools/scratchpad.properties @@ +89,5 @@ > fileNoLongerExists.notification=This file no longer exists. > + > +# LOCALIZATION NOTE (stringConversionFailed): Happens when a value cannot be > +# converted to a string for inspection. > +stringConversionFailed=Cannot convert value to string. \ No newline at end of file I think this should be pretty obviously an error.
Attachment #743371 -
Flags: review?(rcampbell)
Comment 7•11 years ago
|
||
are you still working on this Brandon?
Assignee | ||
Comment 8•11 years ago
|
||
I've been debating how to proceed on this, since I realized the work on bug 825039 kind of subsumes this. I suppose it might be best just to get this finished up and landed and then revisit.
Assignee | ||
Updated•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Updated•6 years ago
|
Product: Firefox → DevTools
Updated•4 years ago
|
Product: DevTools → DevTools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•