instance-name.js 806 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2015 the V8 project authors. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. es6id: 25.2.1.1
  5. description: Assignment of function `name` attribute
  6. info: |
  7. [...]
  8. 3. Return CreateDynamicFunction(C, NewTarget, "generator", args).
  9. ES6 19.2.1.1.1
  10. RuntimeSemantics: CreateDynamicFunction(constructor, newTarget, kind, args)
  11. [...]
  12. 29. Perform SetFunctionName(F, "anonymous").
  13. includes: [propertyHelper.js]
  14. features: [generators]
  15. ---*/
  16. var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor;
  17. assert.sameValue(GeneratorFunction().name, 'anonymous');
  18. verifyNotEnumerable(GeneratorFunction(), 'name');
  19. verifyNotWritable(GeneratorFunction(), 'name');
  20. verifyConfigurable(GeneratorFunction(), 'name');