gc, some E3 edge cases.

git-svn-id: svn://10.0.0.236/trunk@140935 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rogerl%netscape.com
2003-04-09 21:52:00 +00:00
parent 78a131a1b5
commit c4ec6a398f
5 changed files with 54 additions and 10 deletions

View File

@@ -87,6 +87,7 @@ namespace MetaData {
else { // construct an empty function wrapper
js2val thatValue = OBJECT_TO_JS2VAL(new FunctionInstance(meta, meta->functionClass->prototype, meta->functionClass));
FunctionInstance *fnInst = checked_cast<FunctionInstance *>(JS2VAL_TO_OBJECT(thatValue));
DEFINE_ROOTKEEPER(rk, fnInst);
fnInst->fWrap = new FunctionWrapper(true, new ParameterFrame(JS2VAL_INACCESSIBLE, true), meta->env);
fnInst->fWrap->bCon->emitOp(eReturnVoid, meta->engine->errorPos());
meta->createDynamicProperty(fnInst, meta->engine->length_StringAtom, INT_TO_JS2VAL(0), ReadAccess, true, false);
@@ -123,7 +124,12 @@ namespace MetaData {
{ NULL }
};
meta->functionClass->prototype = OBJECT_TO_JS2VAL(new FunctionInstance(meta, meta->objectClass->prototype, meta->functionClass));
FunctionInstance *fnInst = new FunctionInstance(meta, meta->objectClass->prototype, meta->functionClass);
DEFINE_ROOTKEEPER(rk, fnInst);
fnInst->fWrap = new FunctionWrapper(true, new ParameterFrame(JS2VAL_INACCESSIBLE, true), meta->env);
fnInst->fWrap->bCon->emitOp(eReturnVoid, 0);
meta->functionClass->prototype = OBJECT_TO_JS2VAL(fnInst);
meta->initBuiltinClass(meta->functionClass, &prototypeFunctions[0], NULL, Function_Constructor, Function_Constructor);
}