Closed Bug 1286700 Opened 3 years ago Closed 3 years ago

Reps: text-node.js cropMultipleLines is undefined

Categories

(DevTools :: Shared Components, defect, P1, major)

49 Branch
defect

Tracking

(firefox50 fixed)

RESOLVED FIXED
Firefox 50
Tracking Status
firefox50 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

In devtools/client/shared/components/reps/text-node.js , the `cropMultipleLines` function is imported from string.js : 
`const { cropMultipleLines } = require("./string");`

But the function is exported from devtools/client/shared/components/reps/rep-utils.js .
The function should be imported from the correct file to fix the error.
Import `cropMultipleLines` function from the correct file.
Add a test for the TextNode Rep.

Review commit: https://reviewboard.mozilla.org/r/64204/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/64204/
Attachment #8770887 - Flags: review?(odvarko)
Attachment #8770887 - Flags: review?(odvarko) → review+
Comment on attachment 8770887 [details]
Bug 1286700 - Reps: Fix function import in text-node.js .

https://reviewboard.mozilla.org/r/64204/#review61270

Looks nice!

R+, but please resolve the one comment I've made.

Thanks,
Honza

::: devtools/client/shared/components/test/mochitest/test_reps_text-node.html:22
(Diff revision 1)
> +"use strict";
> +
> +window.onload = Task.async(function* () {
> +  try {
> +    let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
> +    let React = browserRequire("devtools/client/shared/vendor/react");

You can remove React and ReactDOM dependencies.

Honza
Comment on attachment 8770887 [details]
Bug 1286700 - Reps: Fix function import in text-node.js .

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64204/diff/1-2/
TRY seems fine except an unrelated failure https://treeherder.mozilla.org/#/jobs?repo=try&revision=358c7b707bdd&selectedJob=23906397 , seen on other TRY without this patch
Keywords: checkin-needed
Yeah, it's unrelated (that was actually caused by my patch :)

Honza
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/fx-team/rev/c49f826bb58e
Reps: Fix function import in text-node.js. r=Honza
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c49f826bb58e
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.