defineGlobalProperty

git-svn-id: svn://10.0.0.236/trunk@65593 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
2000-04-11 03:11:47 +00:00
parent 975ce0edfa
commit 937ff28877
2 changed files with 4 additions and 4 deletions

View File

@@ -389,7 +389,7 @@ static float64 testFunctionCall(World &world, float64 n)
// preset the global property "sum" to contain the above function
JSValue v(funCode);
addGlobalProperty(widenCString("sum"), v);
defineGlobalProperty(widenCString("sum"), JSValue(v));
JSValue result = interpret(script.complete(), JSValues());
std::cout << "sum(" << n << ") = " << result.f64 << std::endl;
@@ -440,7 +440,7 @@ static float64 testFactorial(World &world, float64 n)
// preset the global property "fact" to contain the above function
StringAtom& fact = world.identifiers[widenCString("fact")];
JSValue v(icm);
addGlobalProperty(fact, v);
defineGlobalProperty(fact, v);
// now a script :
// return fact(n);