commit 113a3d8ef289fa565b8342826ec982ecee391570
parent ea767e5647cc6859b3238fbd7240a62f939893ad
Author: aurimasv <aurimas.dev@gmail.com>
Date: Thu, 26 Apr 2012 20:55:14 -0500
Eliminate unintentional globals
Diffstat:
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/chrome/content/zotero/xpcom/rdf/identity.js b/chrome/content/zotero/xpcom/rdf/identity.js
@@ -119,7 +119,7 @@ $rdf.IndexedFormula.prototype.newPropertyAction = function newPropertyAction(pre
this.propertyActions[hash].push(action);
// Now apply the function to to statements already in the store
var toBeFixed = this.statementsMatching(undefined, pred, undefined);
- done = false;
+ var done = false;
for (var i=0; i<toBeFixed.length; i++) { // NOT optimized - sort toBeFixed etc
done = done || action(this, toBeFixed[i].subject, pred, toBeFixed[i].object);
}
diff --git a/chrome/content/zotero/xpcom/rdf/n3parser.js b/chrome/content/zotero/xpcom/rdf/n3parser.js
@@ -1126,7 +1126,7 @@ __SinkParser.prototype.skipSpace = function(str, i) {
}
}
}
- val = (tmp.length - str.length) + j;
+ var val = (tmp.length - str.length) + j;
if( val === tmp.length ) {
return -1;
}
diff --git a/chrome/content/zotero/xpcom/rdf/serialize.js b/chrome/content/zotero/xpcom/rdf/serialize.js
@@ -271,7 +271,7 @@ __Serializer.prototype.statementsToN3 = function(sts) {
var namespaceCounts = []; // which have been used
- predMap = {
+ var predMap = {
'http://www.w3.org/2002/07/owl#sameAs': '=',
'http://www.w3.org/2000/10/swap/log#implies': '=>',
'http://www.w3.org/1999/02/22-rdf-syntax-ns#type': 'a'
@@ -288,7 +288,7 @@ __Serializer.prototype.statementsToN3 = function(sts) {
return s
}
- treeToLine = function(tree) {
+ var treeToLine = function(tree) {
var str = '';
for (var i=0; i<tree.length; i++) {
var branch = tree[i];
@@ -300,7 +300,7 @@ __Serializer.prototype.statementsToN3 = function(sts) {
}
// Convert a nested tree of lists and strings to a string
- treeToString = function(tree, level) {
+ var treeToString = function(tree, level) {
var str = '';
var lastLength = 100000;
if (!level) level = 0;
@@ -484,7 +484,7 @@ __Serializer.prototype.statementsToN3 = function(sts) {
}
function prefixDirectives() {
- str = '';
+ var str = '';
if (sz.defaultNamespace)
str += '@prefix : <'+sz.defaultNamespace+'>.\n';
for (var ns in namespaceCounts) {
@@ -563,7 +563,7 @@ function hexify(str) { // also used in parser
function backslashUify(str) {
- var res = '';
+ var res = '', k;
for (var i=0; i<str.length; i++) {
k = str.charCodeAt(i);
if (k>65535)
@@ -599,7 +599,7 @@ __Serializer.prototype.statementsToXML = function(sts) {
return s
}
- XMLtreeToLine = function(tree) {
+ var XMLtreeToLine = function(tree) {
var str = '';
for (var i=0; i<tree.length; i++) {
var branch = tree[i];
@@ -610,7 +610,7 @@ __Serializer.prototype.statementsToXML = function(sts) {
}
// Convert a nested tree of lists and strings to a string
- XMLtreeToString = function(tree, level) {
+ var XMLtreeToString = function(tree, level) {
var str = '';
var lastLength = 100000;
if (!level) level = 0;
@@ -650,7 +650,7 @@ __Serializer.prototype.statementsToXML = function(sts) {
sz.suggestPrefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
var stats = sz.rootSubjects(statements);
var roots = stats.roots;
- results = []
+ var results = [], root;
for (var i=0; i<roots.length; i++) {
root = roots[i];
results.push(subjectXMLTree(root, stats))
@@ -684,7 +684,7 @@ __Serializer.prototype.statementsToXML = function(sts) {
[propertyXMLTree(subject, stats)]).concat(["</rdf:Description>"]);
}
function collectionXMLTree(subject, stats) {
- res = []
+ var res = []
for (var i=0; i< subject.elements.length; i++) {
res.push(subjectXMLTree(subject.elements[i], stats));
}
diff --git a/chrome/content/zotero/xpcom/rdf/term.js b/chrome/content/zotero/xpcom/rdf/term.js
@@ -246,7 +246,7 @@ $rdf.Formula.prototype.collection = function () { // obsolete
}
$rdf.Formula.prototype.list = function (values) {
- li = new $rdf.Collection();
+ var li = new $rdf.Collection();
if (values) {
for(var i = 0; i<values.length; i++) {
li.append(values[i]);