Added 'length' to Array objects as a getter property - and fixed up stuff
that this depended on. Fixed parameter names for xml classes and added 'loadxml' global function. git-svn-id: svn://10.0.0.236/trunk@83700 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -171,6 +171,25 @@ static JSValue load(Context *cx, const JSValues &argv)
|
||||
return result;
|
||||
}
|
||||
|
||||
static JSValue loadxml(Context *cx, const JSValues &argv)
|
||||
{
|
||||
|
||||
JSValue result;
|
||||
size_t n = argv.size();
|
||||
if (n > 1) {
|
||||
for (size_t i = 1; i < n; ++i) {
|
||||
JSValue val = argv[i].toString();
|
||||
if (val.isString()) {
|
||||
String fileName(*val.string);
|
||||
std::string str(fileName.length(), char());
|
||||
std::transform(fileName.begin(), fileName.end(), str.begin(), narrow);
|
||||
cx->loadClass(str.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool goGeorge = false;
|
||||
|
||||
static JSValue george(Context *, const JSValues &)
|
||||
@@ -234,6 +253,7 @@ static void readEvalPrint(FILE *in, World &world)
|
||||
global.defineNativeFunction(world.identifiers["print"], print);
|
||||
global.defineNativeFunction(world.identifiers["dump"], dump);
|
||||
global.defineNativeFunction(world.identifiers["load"], load);
|
||||
global.defineNativeFunction(world.identifiers["loadxml"], loadxml);
|
||||
global.defineNativeFunction(world.identifiers["george"], george);
|
||||
// global.defineNativeFunction(world.identifiers["time"], time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user