First set of unified 'dot' handling changes for statics.

git-svn-id: svn://10.0.0.236/trunk@73418 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
2000-06-28 18:41:30 +00:00
parent 9b99e9786f
commit b1eb71fadb
12 changed files with 628 additions and 492 deletions

View File

@@ -123,6 +123,24 @@ static JSValue print(const JSValues &argv)
return kUndefinedValue;
}
static JSValue dump(const JSValues &argv)
{
size_t n = argv.size();
if (n > 1) { // the 'this' parameter is un-interesting
if (argv[1].isFunction()) {
JSFunction *f = static_cast<JSFunction *>(argv[1].function);
if (f->isNative())
stdOut << "Native function";
else
stdOut << *f->getICode();
}
else
stdOut << "Not a function";
}
stdOut << "\n";
return kUndefinedValue;
}
static ICodeModule* genCode(Context &cx, StmtNode *p, const String &fileName)
{
ICodeGenerator icg(&cx.getWorld(), cx.getGlobalObject());
@@ -221,6 +239,7 @@ static void readEvalPrint(FILE *in, World &world)
jsd.attachToContext (&cx);
#endif
global.defineNativeFunction(world.identifiers[widenCString("print")], print);
global.defineNativeFunction(world.identifiers[widenCString("dump")], dump);
global.defineNativeFunction(world.identifiers[widenCString("load")], load);
String buffer;