diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Function/prototype/toString/GeneratorFunction.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Function/prototype/toString/GeneratorFunction.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Function/prototype/toString/GeneratorFunction.js b/js/src/tests/test262/built-ins/Function/prototype/toString/GeneratorFunction.js new file mode 100644 index 0000000000..eb6645d2a6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Function/prototype/toString/GeneratorFunction.js @@ -0,0 +1,16 @@ +// Copyright (C) 2016 Michael Ficarra. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-createdynamicfunction +description: Function.prototype.toString on a generator function created with the GeneratorFunction constructor +features: [generators] +includes: [nativeFunctionMatcher.js] +---*/ + +let GeneratorFunction = Object.getPrototypeOf(function*(){}).constructor; +let g = /* before */GeneratorFunction("a", " /* a */ b, c /* b */ //", "/* c */ yield yield; /* d */ //")/* after */; + +assertToStringOrNativeFunction(g, "function* anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ yield yield; /* d */ //\n}"); + +reportCompare(0, 0); |