Skip to content

Commit b3889d7

Browse files
committed
Merge pull request #50 from caisui/issue_33
fix: __iterator__ set on Xray's XPathResult object not being called
2 parents e9c7047 + f064f04 commit b3889d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/content/util.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ const Util = Module("util", {
406406
null
407407
);
408408

409+
if (services.get("vc").compare(Application.version, "33") >= 0
410+
&& Cu.isXrayWrapper(result)) {
411+
result = result.wrappedJSObject;
412+
}
413+
409414
result.__iterator__ = asIterator
410415
? function () { let elem; while ((elem = this.iterateNext())) yield elem; }
411416
: function () { for (let i = 0; i < this.snapshotLength; i++) yield this.snapshotItem(i); };

0 commit comments

Comments
 (0)