mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-12 10:17:31 +09:00
[Pale-Moon] Issue MoonchildProductions/UXP#516 - Remove named function syntax from palemoon/components/sessionstore.
This commit is contained in:
parent
9e97918159
commit
8018d9393e
6 changed files with 173 additions and 173 deletions
|
|
@ -12,7 +12,7 @@ this.XPathGenerator = {
|
|||
/**
|
||||
* Generates an approximate XPath query to an (X)HTML node
|
||||
*/
|
||||
generate: function sss_xph_generate(aNode) {
|
||||
generate: function (aNode) {
|
||||
// have we reached the document node already?
|
||||
if (!aNode.parentNode)
|
||||
return "";
|
||||
|
|
@ -46,7 +46,7 @@ this.XPathGenerator = {
|
|||
/**
|
||||
* Resolves an XPath query generated by XPathGenerator.generate
|
||||
*/
|
||||
resolve: function sss_xph_resolve(aDocument, aQuery) {
|
||||
resolve: function (aDocument, aQuery) {
|
||||
let xptype = Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE;
|
||||
return aDocument.evaluate(aQuery, aDocument, this.resolveNS, xptype, null).singleNodeValue;
|
||||
},
|
||||
|
|
@ -54,14 +54,14 @@ this.XPathGenerator = {
|
|||
/**
|
||||
* Namespace resolver for the above XPath resolver
|
||||
*/
|
||||
resolveNS: function sss_xph_resolveNS(aPrefix) {
|
||||
resolveNS: function (aPrefix) {
|
||||
return XPathGenerator.namespaceURIs[aPrefix] || null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns valid XPath for the given node (usually just the local name itself)
|
||||
*/
|
||||
escapeName: function sss_xph_escapeName(aName) {
|
||||
escapeName: function (aName) {
|
||||
// we can't just use the node's local name, if it contains
|
||||
// special characters (cf. bug 485482)
|
||||
return /^\w+$/.test(aName) ? aName :
|
||||
|
|
@ -71,7 +71,7 @@ this.XPathGenerator = {
|
|||
/**
|
||||
* @returns a properly quoted string to insert into an XPath query
|
||||
*/
|
||||
quoteArgument: function sss_xph_quoteArgument(aArg) {
|
||||
quoteArgument: function (aArg) {
|
||||
return !/'/.test(aArg) ? "'" + aArg + "'" :
|
||||
!/"/.test(aArg) ? '"' + aArg + '"' :
|
||||
"concat('" + aArg.replace(/'+/g, "',\"$&\",'") + "')";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue