Bug 1185106 - Part 14: Add AsyncFunction.prototype[@@toStringTag]. r=till

This commit is contained in:
Tooru Fujisawa 2016-10-31 05:33:16 +09:00
parent 8f486dc57c
commit 98f3030623
2 changed files with 6 additions and 0 deletions

View File

@ -149,4 +149,7 @@ testDefault(function* () {}().__proto__.__proto__, "Generator");
// ES6 25.4.5.4 Promise.prototype [ @@toStringTag ]
testDefault(Promise.prototype, "Promise");
// AsyncFunction.prototype [ @@toStringTag ]
testDefault(async function() {}.constructor.prototype, "AsyncFunction");
reportCompare(true, true);

View File

@ -25,6 +25,9 @@ GlobalObject::initAsyncFunction(JSContext* cx, Handle<GlobalObject*> global)
if (!asyncFunctionProto)
return false;
if (!DefineToStringTag(cx, asyncFunctionProto, cx->names().AsyncFunction))
return false;
RootedValue function(cx, global->getConstructor(JSProto_Function));
if (!function.toObjectOrNull())
return false;