Closed Bug 1474000 Opened 7 years ago Closed 7 years ago

Undefined lazy properties are exposed and then disappear

Categories

(WebExtensions :: General, defect)

54 Branch
defect
Not set
normal

Tracking

(firefox-esr52 unaffected, firefox-esr60 wontfix, firefox61 wontfix, firefox62 wontfix, firefox63 wontfix)

RESOLVED WONTFIX
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- wontfix

People

(Reporter: Oriol, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

664 bytes, application/x-xpinstall
Details
Attached file test.xpi
Install attached add-on in about:debugging. It runs this code: let obj = (window.browser || window.chrome).browserAction; let prop = "ColorArray"; let ownKeys = Reflect.ownKeys(obj); console.log(prop + " in ownKeys: " + ownKeys.includes(prop)); let descr = Reflect.getOwnPropertyDescriptor(obj, prop); console.log(prop + " descriptor: " + JSON.stringify(descr)); let value = obj[prop]; console.log(prop + " value: " + value); ownKeys = Reflect.ownKeys(obj); console.log(prop + " in ownKeys: " + ownKeys.includes(prop)); descr = Reflect.getOwnPropertyDescriptor(obj, prop); console.log(prop + " descriptor: " + JSON.stringify(descr)); The console shows ColorArray in ownKeys: true ColorArray descriptor: {"enumerable":true,"configurable":true} ColorArray value: undefined ColorArray in ownKeys: false ColorArray descriptor: undefined So there is a lazy property which is deleted after being read. It shouldn't be there in the first place, just like in Chrome: ColorArray in ownKeys: false ColorArray descriptor: undefined ColorArray value: undefined ColorArray in ownKeys: false ColorArray descriptor: undefined Regression window: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=855e6b2f6199189f37cea093cbdd1735e297e8aa&tochange=09ef6a4f41186ea6951830d1506f741005dcc46f I guess bug 1338409.
Flags: needinfo?(kmaglione+bmo)
Yes, this is expected.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(kmaglione+bmo)
Resolution: --- → WONTFIX
I know lazy properties are expected, but I don't see the need for lazy properties which will then be removed. Can't these be detected beforehand? It's annoying when I'm debugging an extension and autocomplete offers useless properties.
It could be detected beforehand, but that would be expensive. The whole point of lazy properties is to avoid that expense.
Sure, I meant some way to check which avoids expensive work if the result is not going to be undefined. For example, the problematic properties seem the "types" from the schema. Can't these be filtered out directly? Or is there any type which does have a value?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: