Post by media
I always get a build message "- Warning: .. first argument is not a string
how it is programmed correctly or
is it possible to disable the warning?
var checks = qx.core.Environment.getChecks();
var keys = Object.keys(checks);
for (var i = 0; i < keys.length; i++)
var key = keys[i];
var value = qx.core.Environment.get(key); /* <--- problem line */
First off, to program correctly you shouldn't do this at all :-). There is
no clean and idiomatic way to do what you are trying. The whole concept of
the Environment class is to avoid loading all the environment checks as it
would bloat application code, but rather to pick only the checks that are
necessary for an application. Here is some background ...
Each Environment key depends on a specific qooxdoo module that calculates
its value (or, that implements its "check"). For an application the
Generator infers this module from the argument to the Environment.get()
call, but can only do so if the argument is a string literal like "
browser.name" or "css.borderradius". As you are using a variable the
Generator cannot make this inference, and your program will end up throwing
a run time exception because of a missing module.
BTW: Environment.getChecks() is an internal method and you shouldn't call
it, and you won't usually be able to call it in the build version of your
That's being said, there is a demo application that does just that, which
you might want to look at: http://qooxdoo.github.io/FeatureConfigEditor/?ria
To disable the warning you should do two things:
a) Load all Environment modules upfront. This will avoid the run time
exception. Add this compiler hint to your class comment:
Again, this shouldn't be used in normal application code, see
b) Silence the warning. Add this compiler hint in the function/method
comment above your code:
(Actually, your code already looks like you have seen the