cleanup lint issues: references to undefined values and inadvertent definitions of global variables
diff --git a/src/packages/xdc/rov/CallStack.xs b/src/packages/xdc/rov/CallStack.xs
index 09af9a5..bda7fc4 100644
--- a/src/packages/xdc/rov/CallStack.xs
+++ b/src/packages/xdc/rov/CallStack.xs
@@ -14,6 +14,8 @@
* ======== CallStack ========
*/
+/* global xdc, print */
+
var init = false;
var callStackInst; /* call stack parser support proxy */
diff --git a/src/packages/xdc/rov/Program.xs b/src/packages/xdc/rov/Program.xs
index 42be7b6..d8076d9 100644
--- a/src/packages/xdc/rov/Program.xs
+++ b/src/packages/xdc/rov/Program.xs
@@ -21,6 +21,8 @@
* available the decoder will return immediately.
*/
+/* global xdc, Program */
+
var cmodTab = [];
var modTab = [];
var statusTab = new Array();
@@ -1141,11 +1143,11 @@
{
if (encoding < 1 || encoding > 8) {
throw new Error("unsupported encoding for the location 0x" +
- Number(addr).toString(16));
+ Number(buffer).toString(16));
}
if (encoding == 3) {
throw new Error("complex numbers are not supported - location 0x" +
- Number(addr).toString(16));
+ Number(buffer).toString(16));
}
var buf = {};
@@ -1621,8 +1623,8 @@
* rov.js files available to recreate it. Instead, we delete these modules'
* views from cache.
*/
- for (cmod in cmodTab) {
- for (prop in cmodTab[cmod].viewMap) {
+ for (var cmod in cmodTab) {
+ for (var prop in cmodTab[cmod].viewMap) {
delete cmodTab[cmod].viewMap[prop];
}
}
diff --git a/src/packages/xdc/rov/StateReader.xs b/src/packages/xdc/rov/StateReader.xs
index fe9cda4..27621c1 100644
--- a/src/packages/xdc/rov/StateReader.xs
+++ b/src/packages/xdc/rov/StateReader.xs
@@ -16,6 +16,8 @@
* already been read in.
*/
+/* global xdc, Program, $addr */
+
var symTable;
var strDec;
@@ -356,8 +358,9 @@
var label = mod.name + "@" + Number(obj.$addr).toString(16);
/* If this is a static instance, get the instance name from the capsule. */
+ var givenName;
if (staticIndex != -1) {
- var givenName =
+ givenName =
Program.$modules[mod.name].$instances[staticIndex].instance.name;
if (givenName != null) {
label += (":" + givenName);
@@ -370,7 +373,7 @@
/* If the __name field is null, no name was given. */
if (Number(obj.__name) != 0) {
try {
- var givenName =
+ givenName =
xdc.module('xdc.runtime.Text').fetchAddr(Number(obj.__name));
}
catch (e) {
@@ -381,7 +384,7 @@
* Need a way to report error to user. Just display
* error instead of name.
*/
- var givenName = "Error retrieving given name at 0x" +
+ givenName = "Error retrieving given name at 0x" +
Number(obj.__name).toString(16) + ": " +
e.toString();
}
diff --git a/src/packages/xdc/rov/ViewXml.xs b/src/packages/xdc/rov/ViewXml.xs
index 27558dc..71c293d 100644
--- a/src/packages/xdc/rov/ViewXml.xs
+++ b/src/packages/xdc/rov/ViewXml.xs
@@ -10,6 +10,8 @@
*
* --/COPYRIGHT--*/
+/* global xdc, Program, XML */
+
/*
* ======== processCommand ========
* Accepts a string command line and services the request.
@@ -23,14 +25,15 @@
return("<Exception>ROV Model not initialized</Exception>");
}
+ var result;
try {
- var result = pCmd(input);
+ result = pCmd(input);
}
catch (e) {
var exception = Program.exToString(e);
Program.debugPrint("rov/server/main.xs caught exception while " +
"processing command: " + exception);
- var result = "<Exception>" + xmlQuote(exception) + "</Exception>";
+ result = "<Exception>" + xmlQuote(exception) + "</Exception>";
}
return (result);