Modified: trunk/JSTests/test262.yaml (206737 => 206738)
--- trunk/JSTests/test262.yaml 2016-10-03 17:57:27 UTC (rev 206737)
+++ trunk/JSTests/test262.yaml 2016-10-03 18:36:12 UTC (rev 206738)
@@ -63034,9 +63034,9 @@
- path: test262/test/language/expressions/generators/params-trailing-comma.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/expressions/generators/prototype-own-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
- path: test262/test/language/expressions/generators/prototype-own-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/expressions/generators/prototype-property-descriptor.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js", "../../../../harness/propertyHelper.js"], []
- path: test262/test/language/expressions/generators/prototype-property-descriptor.js
@@ -76522,9 +76522,9 @@
- path: test262/test/language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-name.js
cmd: runTest262 :normal, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js", "../../../../../../../harness/propertyHelper.js"], [:strict]
- path: test262/test/language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js
- cmd: runTest262 :fail, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js", "../../../../../../../harness/propertyHelper.js"], []
+ cmd: runTest262 :normal, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js", "../../../../../../../harness/propertyHelper.js"], []
- path: test262/test/language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js
- cmd: runTest262 :fail, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js", "../../../../../../../harness/propertyHelper.js"], [:strict]
+ cmd: runTest262 :normal, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js", "../../../../../../../harness/propertyHelper.js"], [:strict]
- path: test262/test/language/statements/class/subclass/builtin-objects/GeneratorFunction/regular-subclassing.js
cmd: runTest262 :normal, "NoException", ["../../../../../../../harness/assert.js", "../../../../../../../harness/sta.js"], []
- path: test262/test/language/statements/class/subclass/builtin-objects/GeneratorFunction/regular-subclassing.js
@@ -84194,9 +84194,9 @@
- path: test262/test/language/statements/generators/params-trailing-comma.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/statements/generators/prototype-own-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], []
- path: test262/test/language/statements/generators/prototype-own-properties.js
- cmd: runTest262 :fail, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
+ cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js"], [:strict]
- path: test262/test/language/statements/generators/prototype-property-descriptor.js
cmd: runTest262 :normal, "NoException", ["../../../../harness/assert.js", "../../../../harness/sta.js", "../../../../harness/propertyHelper.js"], []
- path: test262/test/language/statements/generators/prototype-property-descriptor.js
Modified: trunk/Source/_javascript_Core/runtime/JSFunction.cpp (206737 => 206738)
--- trunk/Source/_javascript_Core/runtime/JSFunction.cpp 2016-10-03 17:57:27 UTC (rev 206737)
+++ trunk/Source/_javascript_Core/runtime/JSFunction.cpp 2016-10-03 18:36:12 UTC (rev 206738)
@@ -357,12 +357,16 @@
PropertyOffset offset = thisObject->getDirectOffset(vm, propertyName, attributes);
if (!isValidOffset(offset)) {
JSObject* prototype = nullptr;
- if (thisObject->jsExecutable()->parseMode() == SourceParseMode::GeneratorWrapperFunctionMode)
+ if (thisObject->jsExecutable()->parseMode() == SourceParseMode::GeneratorWrapperFunctionMode) {
+ // Unlike function instances, the object that is the value of the a GeneratorFunction's prototype
+ // property does not have a constructor property whose value is the GeneratorFunction instance.
+ // https://tc39.github.io/ecma262/#sec-generatorfunction-instances-prototype
prototype = constructEmptyObject(exec, thisObject->globalObject(vm)->generatorPrototype());
- else
+ } else {
prototype = constructEmptyObject(exec);
+ prototype->putDirect(vm, vm.propertyNames->constructor, thisObject, DontEnum);
+ }
- prototype->putDirect(vm, vm.propertyNames->constructor, thisObject, DontEnum);
thisObject->putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | DontEnum);
offset = thisObject->getDirectOffset(vm, vm.propertyNames->prototype, attributes);
ASSERT(isValidOffset(offset));