Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 1 | // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | function* g1() { |
| 6 | try { |
| 7 | throw {}; |
| 8 | } catch ({a = class extends (yield) {}}) { |
| 9 | } |
| 10 | } |
| 11 | g1().next(); // crashes without fix |
| 12 | |
| 13 | function* g2() { |
| 14 | let x = function(){}; |
| 15 | try { |
| 16 | throw {}; |
| 17 | } catch ({b = class extends x {}}) { |
| 18 | } |
| 19 | } |
| 20 | g2().next(); // crashes without fix |
| 21 | |
| 22 | function* g3() { |
| 23 | let x = 42; |
| 24 | try { |
| 25 | throw {}; |
| 26 | } catch ({c = (function() { return x })()}) { |
| 27 | } |
| 28 | } |
| 29 | g3().next(); // throws a ReferenceError without fix |