Subversion Repositories pub

Compare Revisions

Ignore whitespace Rev 102 → Rev 65

/pluggablejs/trunk/src/net/outlyer/plugins/PluginEnvironment.java
280,7 → 280,7
 
try {
// Define a Plugin object with a field named type
rhino.eval("var plugin={ type: null, apiVersion: null, name: null };");
rhino.eval("var plugin={ type: null, apiVersion: null };");
}
catch (ScriptException e) {
assert false;
301,15 → 301,18
script.getLineNumber() <= linesToCheckForSupport) {
try {
rhino.eval(line);
// XXX: Note that undefined doesn't convert to null, is this safe?
// Note that undefined doesn't convert to null!
if (null == type) {
type = rhino.eval("plugin.type;");
rhino.eval("$_1_$ = (undefined===plugin.type)?null:plugin.type;");
type = rhino.get("$_1_$");
}
if (null == apiVersion) {
apiVersion = rhino.eval("plugin.apiVersion;");
rhino.eval("$_1_$ = (undefined===plugin.apiVersion)?null:plugin.apiVersion;");
apiVersion = rhino.get("$_1_$");
}
if (null == name) {
name = rhino.eval("plugin.name;");
rhino.eval("$_1_$ = (undefined===plugin.name)?null:plugin.name;");
name = rhino.get("$_1_$");
}
}
catch (final ScriptException e) {
335,6 → 338,7
apiVersion = 0;
}
// name can be null
final PluginProperties pp = new PluginProperties();
try {
pp.apiVersion = Double.valueOf(apiVersion.toString()).intValue();