Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: test/mjsunit/es6/generators-iteration.js

Issue 717123002: Leaving a generator via an exception causes it to close (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove state checking from full-codegen and associated runtime functions Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/es6/generators-states.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 23 matching lines...) Expand all
34 function assertIteratorResult(value, done, result) { 34 function assertIteratorResult(value, done, result) {
35 assertEquals({ value: value, done: done}, result); 35 assertEquals({ value: value, done: done}, result);
36 } 36 }
37 37
38 function assertIteratorIsClosed(iter) { 38 function assertIteratorIsClosed(iter) {
39 assertIteratorResult(undefined, true, iter.next()); 39 assertIteratorResult(undefined, true, iter.next());
40 assertDoesNotThrow(function() { iter.next(); }); 40 assertDoesNotThrow(function() { iter.next(); });
41 } 41 }
42 42
43 function assertThrownIteratorIsClosed(iter) { 43 function assertThrownIteratorIsClosed(iter) {
44 // TODO(yusukesuzuki): Since status of a thrown generator is "executing", 44 assertIteratorIsClosed(iter);
45 // following tests are failed.
46 // https://code.google.com/p/v8/issues/detail?id=3096
47 // assertIteratorIsClosed(iter);
48 } 45 }
49 46
50 function TestGeneratorResultPrototype() { 47 function TestGeneratorResultPrototype() {
51 function* g() { yield 1; } 48 function* g() { yield 1; }
52 var iter = g(); 49 var iter = g();
53 var result = iter.next(); 50 var result = iter.next();
54 51
55 assertSame(Object.prototype, Object.getPrototypeOf(result)); 52 assertSame(Object.prototype, Object.getPrototypeOf(result));
56 property_names = Object.getOwnPropertyNames(result); 53 property_names = Object.getOwnPropertyNames(result);
57 property_names.sort(); 54 property_names.sort();
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 function TestThrowRecursion() { 686 function TestThrowRecursion() {
690 function* g() { yield iter.throw(1); } 687 function* g() { yield iter.throw(1); }
691 var iter = g(); 688 var iter = g();
692 return iter.next(); 689 return iter.next();
693 } 690 }
694 assertThrows(TestNextRecursion, Error); 691 assertThrows(TestNextRecursion, Error);
695 assertThrows(TestSendRecursion, Error); 692 assertThrows(TestSendRecursion, Error);
696 assertThrows(TestThrowRecursion, Error); 693 assertThrows(TestThrowRecursion, Error);
697 } 694 }
698 TestRecursion(); 695 TestRecursion();
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | test/mjsunit/es6/generators-states.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698