Closed Bug 1460530 Opened Last year Closed 8 months ago

JSTerm autocompletion should reveal getters

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1499289

People

(Reporter: Honza, Unassigned)

References

(Blocks 1 open bug)

Details

JSTerm autocompletion should also offer getters for objects.

Let's see the following example:

Code on the page:

var customer = {
  get age() { return 40; },
  get name() { return "John"; },
  address: "Hawaii",
}

var store = {
  getCustomer() { return person; }
}

Expression in JSTerm:

`window.store.getPerson().`

The autocompletion should show:

* address
* age 
* name
* (etc. like standard object methods & props)


The actual result value of the expression/getter can be previewed using eager evaluation feature (see bug 1460518)

So e.g. when the user selects `name` getter offered by the autocompletion popup
(but doesn't press the enter yet), the instant result preview should show `John`.

Honza
Blocks: 1458831
Priority: -- → P3
Priority: P3 → P2
Whiteboard: [boogaloo-mvp]
Product: Firefox → DevTools
Fixed version of the example from comment #0

var customer = {
  get age() { return 40; },
  get name() { return "John"; },
  address: "Hawaii",
}

var store = {
  get customer() { return customer; },
  getCustomer() { return customer; },
}

Expression in JSTerm:
`window.store.getCustomer().`
or 
`window.store.customer.`

Should show:

* address
* age 
* name
* (etc. like standard object methods & props

Honza
Priority: P2 → P3
Whiteboard: [boogaloo-mvp] → [boogaloo-reserve]
Whiteboard: [boogaloo-reserve] → [boogaloo-mvp]
Priority: P3 → P2
Honza, how is this different from https://bugzilla.mozilla.org/show_bug.cgi?id=1460530 ? Do we want to be able to automatically execute side-effects free getters?
Flags: needinfo?(odvarko)
(In reply to Nicolas Chevobbe from comment #2)
> Honza, how is this different from
> https://bugzilla.mozilla.org/show_bug.cgi?id=1460530 ? Do we want to be able
> to automatically execute side-effects free getters?
Sorry for the delay!

Your link points back to this bug, is that a copy-paste typo?

Honza
Flags: needinfo?(odvarko) → needinfo?(nchevobbe)
Duh

I was talking about Bug 1499289 :)
Flags: needinfo?(nchevobbe)
Flags: needinfo?(odvarko)

Yep, you are right, marking as duplicate.

Honza

Status: NEW → RESOLVED
Closed: 8 months ago
Flags: needinfo?(odvarko)
Resolution: --- → DUPLICATE
Duplicate of bug: 1499289
Whiteboard: [boogaloo-mvp]
You need to log in before you can comment on or make changes to this bug.