зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1185959 - Properly handle static constructor method in classes. (r=Waldo)
This commit is contained in:
Родитель
9602783f5f
Коммит
240506f142
|
@ -7007,8 +7007,11 @@ BytecodeEmitter::emitPropertyList(ParseNode* pn, MutableHandlePlainObject objp,
|
|||
isIndex = true;
|
||||
} else if (key->isKind(PNK_OBJECT_PROPERTY_NAME) || key->isKind(PNK_STRING)) {
|
||||
// EmitClass took care of constructor already.
|
||||
if (type == ClassBody && key->pn_atom == cx->names().constructor)
|
||||
if (type == ClassBody && key->pn_atom == cx->names().constructor &&
|
||||
!propdef->as<ClassMethod>().isStatic())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// The parser already checked for atoms representing indexes and
|
||||
// used PNK_NUMBER instead, but also watch for ids which TI treats
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
var test = `
|
||||
class test {
|
||||
constructor() { }
|
||||
static constructor() { }
|
||||
}
|
||||
`;
|
||||
|
||||
if (classesEnabled())
|
||||
eval(test);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(0,0,"OK");
|
Загрузка…
Ссылка в новой задаче