Commit 34702e9d authored by dslomov's avatar dslomov Committed by Commit bot

Set @@toStringTag on GeneratorFunction prototype.

R=caitpotter88@gmail.com
BUG=v8:3502
LOG=N

Review URL: https://codereview.chromium.org/764823002

Cr-Commit-Position: refs/heads/master@{#25550}
parent 93cd816c
...@@ -101,6 +101,8 @@ function SetUpGenerators() { ...@@ -101,6 +101,8 @@ function SetUpGenerators() {
%AddNamedProperty(GeneratorObjectPrototype, %AddNamedProperty(GeneratorObjectPrototype,
symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY);
%InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype);
%AddNamedProperty(GeneratorFunctionPrototype,
symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY);
%SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor);
%AddNamedProperty(GeneratorFunctionPrototype, "constructor", %AddNamedProperty(GeneratorFunctionPrototype, "constructor",
GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY);
......
...@@ -67,6 +67,8 @@ function TestGeneratorObject() { ...@@ -67,6 +67,8 @@ function TestGeneratorObject() {
assertEquals("Generator", %_ClassOf(iter)); assertEquals("Generator", %_ClassOf(iter));
assertEquals("[object Generator]", String(iter)); assertEquals("[object Generator]", String(iter));
assertEquals("[object Generator]", Object.prototype.toString.call(iter)); assertEquals("[object Generator]", Object.prototype.toString.call(iter));
var gf = iter.__proto__.constructor;
assertEquals("[object GeneratorFunction]", Object.prototype.toString.call(gf));
assertEquals([], Object.getOwnPropertyNames(iter)); assertEquals([], Object.getOwnPropertyNames(iter));
assertTrue(iter !== new g()); assertTrue(iter !== new g());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment