-
-
Save suvene/42168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function $XX(xpath, context, resolver) { | |
context || (context = document); | |
var doc = context.ownerDocument || context; | |
var result = doc.evaluate(xpath, context, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
result.__iterator__ = function() { for (let i = 0, len = this.snapshotLength; i < len; i++) yield this.snapshotItem(i); }; | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment