followup to Bug 1169736 to fix spidermonkey failures CLOSED TREE

(If this doesn't fix things, this and the original patch for this bug need to be backed out to fix things)
This commit is contained in:
Wes Kocher 2015-06-17 17:15:45 -07:00
Родитель 47e2d52863
Коммит 7945ec8df1
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -8631,10 +8631,13 @@ Parser<ParseHandler>::methodDefinition(YieldHandling yieldHandling, PropListType
kind == Getter || kind == Setter);
/* NB: Getter function in { get x(){} } is unnamed. */
RootedPropertyName funName(context);
if ((kind == Method || kind == ClassConstructor) && tokenStream.isCurrentTokenType(TOK_NAME))
if ((kind == Method || kind == ClassConstructor || kind == DerivedClassConstructor) &&
tokenStream.isCurrentTokenType(TOK_NAME))
{
funName = tokenStream.currentName();
else
} else {
funName = nullptr;
}
Node fn = functionDef(InAllowed, yieldHandling, funName, kind, generatorKind);
if (!fn)

Просмотреть файл

@ -119,7 +119,7 @@ function testClasses() {
assertClassError("class NAME { }", TypeError);
// For now, disallow arrow functions in derived class constructors
assertClassError("class NAME extends null { constructor() { (() => 0); }", TypeError);
assertClassError("class NAME extends null { constructor() { (() => 0); }", InternalError);
// It is an error to have two methods named constructor, but not other
// names, regardless if one is an accessor or a generator or static.