Home | History | Annotate | Download | only in es6

Lines Matching refs:function

32 var GeneratorFunction = (function*(){yield 1;}).__proto__.constructor;
34 function assertIteratorResult(value, done, result) {
38 function assertIteratorIsClosed(iter) {
40 assertDoesNotThrow(function() { iter.next(); });
43 function assertThrownIteratorIsClosed(iter) {
50 function TestGeneratorResultPrototype() {
51 function* g() { yield 1; }
63 function TestGenerator(g, expected_values_for_next,
65 function testNext(thunk) {
75 function testSend(thunk) {
84 function testThrow(thunk) {
92 function Sentinel() {}
93 assertThrows(function () { iter.throw(new Sentinel); }, Sentinel);
102 testNext(function*() { return yield* g(); });
103 testSend(function*() { return yield* g(); });
104 testThrow(function*() { return yield* g(); });
107 testNext(function() { return new g(); });
108 testSend(function() { return new g(); });
109 testThrow(function() { return new g(); });
113 TestGenerator(function* g1() { },
118 TestGenerator(function* g2() { yield 1; },
123 TestGenerator(function* g3() { yield 1; yield 2; },
128 TestGenerator(function* g4() { yield 1; yield 2; return 3; },
133 TestGenerator(function* g5() { return 1; },
138 TestGenerator(function* g6() { var x = yield 1; return x; },
143 TestGenerator(function* g7() { var x = yield 1; yield 2; return x; },
148 TestGenerator(function* g8() { for (var x = 0; x < 4; x++) { yield x; } },
155 function g9() {
156 return (function*(a, b, c, d) {
166 function g10() {
167 return (function*(a, b, c, d) {
177 function g11() {
178 return (function*(a, b, c, d) {
188 function g12() {
189 return (function*(a, b, c, d) {
203 function g13() {
204 return (function(a, b, c, d) {
205 return (function*() {
216 function g14() {
217 return (function*(a, b, c, d) {
233 function g15() {
234 return (function*(a, b, c, d) {
248 TestGenerator(function* g16() { yield "baz"; gc(); yield "qux"; },
255 function g17() {
256 function* g() { yield this.x; yield this.y; }
265 function g18() {
266 function* g() { yield this.x; yield this.y; }
277 function* g19() {
288 function* g20() { yield (1 + (yield 2) + 3); },
294 function* g21() { return (1 + (yield 2) + 3); },
300 function* g22() { yield (1 + (yield 2) + 3); yield (4 + (yield 5) + 6); },
306 function* g23() {
315 function* g24() {
328 function* g25() {
342 function* g26() { return yield yield },
349 function* g27() {
362 (function() {
363 function* g28() {
373 (function() {
374 function* g29() {
384 // Generator function instances.
401 function() { return GeneratorFunction('x', 'y', 'yield x + y;')(1, 2) },
408 function () {
409 return ({ x: 42, g: function* (a) { yield this.x } }).g(0);
416 function TestDelegatingYield() {
417 function results(results) {
419 function next() {
424 ret[Symbol.iterator] = function() { return iter; };
427 function* yield_results(expected) {
430 function collect_results(iterable) {
449 function TestTryCatch(instantiate) {
450 function* g() { yield 1; try { yield 2; } catch (e) { yield e; } yield 3; }
451 function Sentinel() {}
453 function Test1(iter) {
461 function Test2(iter) {
462 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
467 function Test3(iter) {
469 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
474 function Test4(iter) {
484 function Test5(iter) {
490 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
495 function Test6(iter) {
500 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
505 function Test7(iter) {
513 TestTryCatch(function (g) { return g(); });
514 TestTryCatch(function* (g) { return yield* g(); });
516 function TestTryFinally(instantiate) {
517 function* g() { yield 1; try { yield 2; } finally { yield 3; } yield 4; }
518 function Sentinel() {}
519 function Sentinel2() {}
521 function Test1(iter) {
530 function Test2(iter) {
531 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
536 function Test3(iter) {
538 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
543 function Test4(iter) {
547 assertThrows(function() { iter.next(); }, Sentinel);
552 function Test5(iter) {
556 assertThrows(function() { iter.throw(new Sentinel2); }, Sentinel2);
561 function Test6(iter) {
565 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
570 function Test7(iter) {
575 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
580 function Test8(iter) {
589 TestTryFinally(function (g) { return g(); });
590 TestTryFinally(function* (g) { return yield* g(); });
592 function TestNestedTry(instantiate) {
593 function* g() {
603 function Sentinel() {}
604 function Sentinel2() {}
606 function Test1(iter) {
616 function Test2(iter) {
617 assertThrows(function() { iter.throw(new Sentinel); }, Sentinel);
622 function Test3(iter) {
625 assertThrows(function() { iter.next(); }, Sentinel);
630 function Test4(iter) {
633 assertThrows(function() { iter.throw(new Sentinel2); }, Sentinel2);
638 function Test5(iter) {
650 function Test6(iter) {
656 assertThrows(function() { iter.next(); }, Sentinel2);
661 function Test7(iter) {
668 assertThrows(function() { iter.next(); }, Sentinel2);
675 TestNestedTry(function (g) { return g(); });
676 TestNestedTry(function* (g) { return yield* g(); });
678 function TestRecursion() {
679 function TestNextRecursion() {
680 function* g() { yield iter.next(); }
684 function TestSendRecursion() {
685 function* g() { yield iter.next(42); }
689 function TestThrowRecursion() {
690 function* g() { yield iter.throw(1); }