OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
(...skipping 4217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4228 // With the help of do-expressions and function.sent, we desugar yield* into a | 4228 // With the help of do-expressions and function.sent, we desugar yield* into a |
4229 // loop containing a "raw" yield (a yield that doesn't wrap an iterator result | 4229 // loop containing a "raw" yield (a yield that doesn't wrap an iterator result |
4230 // object around its argument). Concretely, "yield* iterable" turns into | 4230 // object around its argument). Concretely, "yield* iterable" turns into |
4231 // roughly the following code: | 4231 // roughly the following code: |
4232 // | 4232 // |
4233 // do { | 4233 // do { |
4234 // const kNext = 0; | 4234 // const kNext = 0; |
4235 // const kReturn = 1; | 4235 // const kReturn = 1; |
4236 // const kThrow = 2; | 4236 // const kThrow = 2; |
4237 // | 4237 // |
4238 // let input = function.sent; | 4238 // let input = undefined; |
4239 // let mode = kNext; | 4239 // let mode = kNext; |
4240 // let output = undefined; | 4240 // let output = undefined; |
4241 // | 4241 // |
4242 // let iterator = GetIterator(iterable); | 4242 // let iterator = GetIterator(iterable); |
4243 // | 4243 // |
4244 // while (true) { | 4244 // while (true) { |
4245 // // From the generator to the iterator: | 4245 // // From the generator to the iterator: |
4246 // // Forward input according to resume mode and obtain output. | 4246 // // Forward input according to resume mode and obtain output. |
4247 // switch (mode) { | 4247 // switch (mode) { |
4248 // case kNext: | 4248 // case kNext: |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5120 | 5120 |
5121 return final_loop; | 5121 return final_loop; |
5122 } | 5122 } |
5123 | 5123 |
5124 #undef CHECK_OK | 5124 #undef CHECK_OK |
5125 #undef CHECK_OK_VOID | 5125 #undef CHECK_OK_VOID |
5126 #undef CHECK_FAILED | 5126 #undef CHECK_FAILED |
5127 | 5127 |
5128 } // namespace internal | 5128 } // namespace internal |
5129 } // namespace v8 | 5129 } // namespace v8 |
OLD | NEW |