For some reason the parameterNames was expected as
a prop, but it's available on the function grip
itself.
The rep is fixed, and tests are modified to reflect
this change.
Differential Revision: https://phabricator.services.mozilla.com/D55926
For some reason the parameterNames was expected as
a prop, but it's available on the function grip
itself.
The rep is fixed, and tests are modified to reflect
this change.
Differential Revision: https://phabricator.services.mozilla.com/D55926
This patch make it so ObjectInspector can handle both simple grips and fronts.
The main idea is that we can now pass a `front` property to ObjectInspector nodes,
that will then be used to retrieve properties on the object.
Differential Revision: https://phabricator.services.mozilla.com/D54508
This allows consumers to directly require a single Rep file
if needed (e.g. the inspector only needs elementNode or textNode).
In order to make this work, the requires for react-dom-factories
and prop-types needed to be changed to the in-tree modules.
We also needed to modified the reps jest config, as well as the
babel config so we can run tests and still generate the reps bundle.
Finally, the dom-node-constants is modified to not use define as
it's not used as an AMD module.
Differential Revision: https://phabricator.services.mozilla.com/D54680
This only affects console api calls where one of the
argument is an empty string. Since we don't quote
string arguments for those, it was difficult to spot
an empty string there.
Jest test are added, as well as a mochitest for the
console to make sure that we don't have unwanted
side effects (for evaluation results, object with
empty string properties, ...)
Differential Revision: https://phabricator.services.mozilla.com/D54687
The LongStringClient is removed and we replace its
usage with LongStringFront instead.
This require a few variable/function renaming, as
well as updating the mocks we use in node tests.
Switch usage to LongStringFront instead.
Differential Revision: https://phabricator.services.mozilla.com/D50579
The object-client.js file is now a proper protocol.js front,
but is still named after a client.
This is confusing, so we rename and move the file next to other
fronts, and update all consumers to the new terminology.
Differential Revision: https://phabricator.services.mozilla.com/D49878
- Converted the ObjectClient into an protocoljs Front
- Converted the SymbolIteratorClient into a protocoljs Front and moved it to devtools/shared/fronts
- Converted the PropertyIteratorClient into a protocoljs Front and moved it to devtools/shared/fronts
- Converted the EnvironmentClient into a protocoljs Front and moved it to devtools/shared/fronts
- Modified calls to `DebuggerClient.release()` so that it tries to call the ObjectFront's release method first, and falls back on `DebuggerClient.release()` if there's no object front
- Changed reps so that it instantiates only one ObjectClient per grip
- Changed tests so that they expect what the Front's request method resolves to where applicable (i.e. ObjectFront.allocationStack resolves to allocationStack, not a packet object with an allocationStack property)
- Changed callbacks provided to ObjectClient methods to be chained to the ObjectFront methods (e.g. ObjectClient.getScope(callback) changed to ObjectFront.getScope().callback())
- Changed tests to use async/await (test_framebindings-x.js, test_functiongrips-x.js, test_objectgrips-x.js)
- Changed tests to expect protocoljs to throw an error string instead of an error object (test_objectgrips-fn-apply-03.js, test_threadlifetime-02.js, test_pauselifetime-03.js)
Differential Revision: https://phabricator.services.mozilla.com/D48182
Apply the following optimizations:
- Don't use regular expressions where they can be avoided
- Reduce unnecessary memory allocations (e.g. avoid doing a map and a filter by writing the code in an imperative fashion)
- Reduce layout trashing by using `rAF` and `setTimeout`
- Perform cheaper checks first in conditional statements
See commit messages for more details.
Differential Revision: https://phabricator.services.mozilla.com/D49214
- Converted the ObjectClient into an protocoljs Front
- Converted the SymbolIteratorClient into a protocoljs Front and moved it to devtools/shared/fronts
- Converted the PropertyIteratorClient into a protocoljs Front and moved it to devtools/shared/fronts
- Converted the EnvironmentClient into a protocoljs Front and moved it to devtools/shared/fronts
- Modified calls to `DebuggerClient.release()` so that it tries to call the ObjectFront's release method first, and falls back on `DebuggerClient.release()` if there's no object front
- Changed reps so that it instantiates only one ObjectClient per grip
- Changed tests so that they expect what the Front's request method resolves to where applicable (i.e. ObjectFront.allocationStack resolves to allocationStack, not a packet object with an allocationStack property)
- Changed callbacks provided to ObjectClient methods to be chained to the ObjectFront methods (e.g. ObjectClient.getScope(callback) changed to ObjectFront.getScope().callback())
- Changed tests to use async/await (test_framebindings-x.js, test_functiongrips-x.js, test_objectgrips-x.js)
- Changed tests to expect protocoljs to throw an error string instead of an error object (test_objectgrips-fn-apply-03.js, test_threadlifetime-02.js, test_pauselifetime-03.js)
Differential Revision: https://phabricator.services.mozilla.com/D48182
Bug 1584244 fixed some of the issue for getters,
but not all of them.
Instead of trying to unescape the node name, we
put the actual property name into the node, so
we can reuse it later.
Differential Revision: https://phabricator.services.mozilla.com/D47876
Bug 1584244 fixed some of the issue for getters,
but not all of them.
Instead of trying to unescape the node name, we
put the actual property name into the node, so
we can reuse it later.
Differential Revision: https://phabricator.services.mozilla.com/D47876
This patch exposes the objectInspector reducer as a regular
file that can be required in the devtools codebase.
This should make things faster to start as we won't need
to load the entire bundle (especially for the inspector where
the reps is only used when navigating to specific subpanels).
This means we need to remove the flow typing for now since
we don't have a cross-toolbox build process like we have
in the debugger.
Differential Revision: https://phabricator.services.mozilla.com/D47728
This patch exposes the objectInspector reducer as a regular
file that can be required in the devtools codebase.
This should make things faster to start as we won't need
to load the entire bundle (especially for the inspector where
the reps is only used when navigating to specific subpanels).
This means we need to remove the flow typing for now since
we don't have a cross-toolbox build process like we have
in the debugger.
Differential Revision: https://phabricator.services.mozilla.com/D47728
When clicking the invoke button on a property that
needs to be quoted, e.g. hello-world, the result
was undefined.
That's because we were sending the property name to
the server with the surrounding quotes.
This patch fixes the issue and adds a couple of test
case to make sure we don't regress.
Differential Revision: https://phabricator.services.mozilla.com/D47399
The actors weren't ever removed from the state,
which could lead to increased memory consumption
as well as attempt to release the actors a
second time in some cases.
We fix this by dispatching a new actions once
the actors are released, so we can remove them
from the state.
Depends on D47271
Differential Revision: https://phabricator.services.mozilla.com/D47411
When using the ObjectInspector in an inspector extension sidebar,
document is not an HTMLDocument but a Sandbox, which means we
don't have access to the same properties than in a document.
Since the Tree and the ObjectInspector components do use `document`
and `window`, this means some interaction would lead to the sidebar
crashing.
To prevent this, we retrieve the document and/or the window from
a node reference instead.
Differential Revision: https://phabricator.services.mozilla.com/D47271
When the stack isn't a string (or a longstring), we
don't try to parse anything.
A test is added to ensure we don't regress.
Differential Revision: https://phabricator.services.mozilla.com/D46114