In the GripRep, we were using the root property `ownPropertyLength` to
retrieve additionnal uninterresting props on the Grip. For Proxy
objects, we don't have this property, but a `preview.ownPropertiesLength`.
This adds a test case similar to the one for Proxy in browser_webconsole_output_05.js.
MozReview-Commit-ID: 652cfTlW7Sg
Handle object created from a constructor function, like `new Boolean(true)`,
`new Number(42)` or `new String("foo")`.
It displays the wrapped value using Rep so the primitives are displayed like
expected.
MozReview-Commit-ID: JrJVeV0C0wO
For CSS files which were used via both chrome:// and resource://, I converted
all usages to resource:// and removed the chrome:// copy to reduce file
duplication.
I believe most DevTools CSS could be using resource:// throughout, but that's
left as follow up work for now.
MozReview-Commit-ID: G7oxZqjodwv
Add the possibility to pass a style object to StringRep.
Parse the styles strings passed as argument using a dummy node element
to strip off forbidden properties and forbidden values.
Add a mocha test to ensure custom styles are rendered as expected.
MozReview-Commit-ID: I3LgeNRujaL
Add reps and test for it.
Edit Number rep's `supportsObject` function because there was
an error for `-0` object, due to some change in the function which
detect which rep to use.
MozReview-Commit-ID: 8Dz40E7LBb0
The problem is that we are checking the computed props against `object.ownPropertyLength` to see if there's more to show.
But, if an object has a non-enumerable property (like `prototype`), `ownPropertyLength` counts it,
but it does not appear `object.preview`.
To fix that, we do a simple check : if there is more item in the preview object than `max`, then we show the "more..." label.
Adds a test to ensure the problem is fixed.
In the same time, I did a little refactor on how we deal with the last object delimiter when we get the props, so we don't have
to go back to the last object and remove the comma.
MozReview-Commit-ID: 1drpuUOsLNI
Add a GripMap rep which handles both map and weakmap objects.
Make it possible to pass an object as the `name` property to PropRep,
in order to handle WeakMap keys.
Add a mochitest to make sure everything is displayed correctly.
MozReview-Commit-ID: ABBy2FT4rmE
If we happen to pass the current scope (`this`), the browser-loader codebase fails
when passing it as sandboxPrototype. It only works when passing an xray wrapper.
The document scope happen to not be an xray when using the addon, whereas `window`
always is no matter if we are using the addon or not.
MozReview-Commit-ID: GjYHkaCGBDd