Can anyone shed any light on this warning message; I've never seen this one before?
(It's not caused by any script of mine, I don't even know what these things are.)
This is a warning from Library. It does not indicate a problem per se, it is a warning for future OXPers who may be using the reported global objects in their expansions, potentially causing conflicts with the main game. If you open missiontext.plist in your Library OXP, you will see this:
These are the names of JS objects that Library has as whitelisted.
Now, what happens is that some new objects were added to the glboal JS class in the years since the last Library revision. postFX for example is a new global object that is part of the core game and allows one to set the active post processing effect being rendered. keyBindingDescription is another new one, a result of the keyconfig settings code that phkb implemented. Because the Library OXP did not know about those when it was written, it now reports them as polluters of the global namespace. The OXP is doing its job fine, it just needs to be updated to include those new global JS objects.
The only object I do not recognize and might be an actual problem is "prop" - not sure where this is coming from.
The only object I do not recognize and might be an actual problem is "prop" - not sure where this is coming from.
"prop" is short for property, and is what one uses to loop through an object that is not defined as an array, so doesn't have key values that are nicely consecutive numbers.
The only object I do not recognize and might be an actual problem is "prop" - not sure where this is coming from.
"prop" is short for property, and is what one uses to loop through an object that is not defined as an array, so doesn't have key values that are nicely consecutive numbers.
The way you showed means prop is a variable with loop scope. Not something that deserves a warning or that would worry a_c.
The only object I do not recognize and might be an actual problem is "prop" - not sure where this is coming from.
"prop" is short for property, and is what one uses to loop through an object that is not defined as an array, so doesn't have key values that are nicely consecutive numbers.
The way you showed means prop is a variable with loop scope. Not something that deserves a warning or that would worry a_c.
1. Well, I don't know where else it could have come from.
2. I don't think it's a normal variable. I believe (but don't know for sure) that it's a keyword in javascript. I've never seen anyone do a loop like this using any "variable" other than "prop".
3. No need for anyone to be worried. Now that A_C has confirmed this warning came from Library OXP, not Oolite, everyone can go back to worrying about the cost of rents.
"prop" is short for property, and is what one uses to loop through an object that is not defined as an array, so doesn't have key values that are nicely consecutive numbers.
Library is highlighting the fact that the variable "prop", because of the way it's defined in one of the Javascript files that have been loaded, has ended up in the global namespace, rather than being local to the function.
The code example you mentioned is actually an example of the issue. Make this small change and the warning should disappear:
this.name = "Untrumbled";
this.version = "1.1"; // "Wildeblood", "phkb" June 17th, 2015
this.startUp = function () {
"use strict";
if (worldScripts["oolite-trumbles"]) {
for (var prop in worldScripts["oolite-trumbles"]) { // << add "var" in front of "prop"
if (prop !== "name" && prop !== "version" &&
prop !== "oolite_manifest_identifier") delete worldScripts["oolite-trumbles"][prop];
}
log(this.name, "Removed oolite-trumbles world script.");
}
delete missionVariables.trumbles;
delete this.startUp;
}
The same issue exists in Explorers Club, Bloomberg Markets, and Taranis, so if you're using those OXP's you'd need to fix each one before the warning would disappear.