зеркало из https://github.com/mozilla/pjs.git
Experiment with looking up methods in the prototype chain.
This commit is contained in:
Родитель
d16865cfcb
Коммит
7b61502b1e
|
@ -85,7 +85,6 @@ namespace JSClasses {
|
|||
: JSType(name, superClass), mSuperClass(superClass), mSlotCount(0)
|
||||
{
|
||||
mScope = new JSScope(scope);
|
||||
setProperty(widenCString("methods"), JSValue(mScope));
|
||||
}
|
||||
|
||||
JSClass* getSuperClass()
|
||||
|
@ -152,8 +151,12 @@ namespace JSClasses {
|
|||
|
||||
JSInstance(JSClass* thisClass)
|
||||
{
|
||||
// slot 0 is always the class.
|
||||
mSlots[0] = thisClass;
|
||||
// initialize rest of slots with undefined.
|
||||
std::uninitialized_fill(&mSlots[1], &mSlots[1] + thisClass->getSlotCount(), JSValue());
|
||||
// for grins, use the prototype link to access methods.
|
||||
setPrototype(thisClass->getScope());
|
||||
}
|
||||
|
||||
JSClass* getClass()
|
||||
|
|
|
@ -85,7 +85,6 @@ namespace JSClasses {
|
|||
: JSType(name, superClass), mSuperClass(superClass), mSlotCount(0)
|
||||
{
|
||||
mScope = new JSScope(scope);
|
||||
setProperty(widenCString("methods"), JSValue(mScope));
|
||||
}
|
||||
|
||||
JSClass* getSuperClass()
|
||||
|
@ -152,8 +151,12 @@ namespace JSClasses {
|
|||
|
||||
JSInstance(JSClass* thisClass)
|
||||
{
|
||||
// slot 0 is always the class.
|
||||
mSlots[0] = thisClass;
|
||||
// initialize rest of slots with undefined.
|
||||
std::uninitialized_fill(&mSlots[1], &mSlots[1] + thisClass->getSlotCount(), JSValue());
|
||||
// for grins, use the prototype link to access methods.
|
||||
setPrototype(thisClass->getScope());
|
||||
}
|
||||
|
||||
JSClass* getClass()
|
||||
|
|
Загрузка…
Ссылка в новой задаче