зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1199172 - Only treat non-static constructor methods as the actual class constructor. (r=shu)
This commit is contained in:
Родитель
a5f6afe3c6
Коммит
6cf9ba3a66
|
@ -7461,7 +7461,8 @@ BytecodeEmitter::emitClass(ParseNode* pn)
|
|||
for (ParseNode* mn = classMethods->pn_head; mn; mn = mn->pn_next) {
|
||||
ClassMethod& method = mn->as<ClassMethod>();
|
||||
ParseNode& methodName = method.name();
|
||||
if (methodName.isKind(PNK_OBJECT_PROPERTY_NAME) &&
|
||||
if (!method.isStatic() &&
|
||||
methodName.isKind(PNK_OBJECT_PROPERTY_NAME) &&
|
||||
methodName.pn_atom == cx->names().constructor)
|
||||
{
|
||||
constructor = &method.method();
|
||||
|
|
|
@ -3,6 +3,21 @@ class test {
|
|||
constructor() { }
|
||||
static constructor() { }
|
||||
}
|
||||
|
||||
class testWithExtends {
|
||||
constructor() { };
|
||||
static constructor() { };
|
||||
}
|
||||
|
||||
class testOrder {
|
||||
static constructor() { };
|
||||
constructor() { };
|
||||
}
|
||||
|
||||
class testOrderWithExtends extends null {
|
||||
static constructor() { };
|
||||
constructor() { };
|
||||
}
|
||||
`;
|
||||
|
||||
if (classesEnabled())
|
||||
|
|
Загрузка…
Ссылка в новой задаче