| Issue 5743: | Chrome does not invoke an NPObject's enumerate callback when the JavaScript 'for-in' loop is used | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Chrome Version : 1.0.154.36
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 3: Unknown
Firefox 3: OK
IE 7: OK (using COM instead of npruntime)
What steps will reproduce the problem?
1. In an npruntime plugin, create an NPObject implementing the enumerate
callback. The callback should return an array of ids of properties
contained in the object.
2. From JavaScript, use the for-in loop to enumerate the properties:
var obj = plugin.createObject();
for (var p in obj) {
alert(p);
}
What is the expected result?
The NPObject's enumerate callback should be called. All ids returned by the
callback should reported as values of 'p' in the for-in loop.
What happens instead?
The enumerate callback is not called.
Please provide any additional information below. Attach a screenshot if
possible.
I tracked this problem down to CreateV8ObjectForNPObject in
webkit/port/bindings/v8/v8_npobject.cpp. The function creates a V8 proxy to
wrap the NPObject. However, it does not register either indexed or named
property enumerators. CreateV8ObjectForNPObject should register property
enumerators that forward to the wrapped NPObject's enumerate callback function.
|
||||||||||||||||
,
Oct 17, 2009
(No comment was entered for this change.)
Owner: anan...@chromium.org
Labels: -Area-Misc Area-Compat-Web |
|||||||||||||||||
,
Oct 28, 2009
(No comment was entered for this change.)
Labels: Mstone-X
|
|||||||||||||||||
,
Nov 13, 2009
There's been a lot of work in the V8 bindings. Is this still a problem?
Status: Assigned
Owner: apatr...@chromium.org |
|||||||||||||||||
,
Nov 13, 2009
Eyeballing V8NPObject.cpp, it looks like createV8ObjectForNPObject does not set property enumerator callbacks, so I suspect the problem remains. |
|||||||||||||||||
| ► Sign in to add a comment | |||||||||||||||||