| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
path: annexB/language/eval-code/direct/func-switch-case- |
| 5 |
name: > |
| 6 |
Function declaration in the `case` clause of a `switch` statement in eval code |
| 7 |
esid: sec-web-compat-evaldeclarationinstantiation |
| 8 |
es6id: B.3.3.3 |
| 9 |
flags: [noStrict] |
| 10 |
---*/ |
| 11 |
|
| 12 |
(function(/*{ params }*/) { |
| 13 |
eval( |
| 14 |
'/*{ before }*/switch (1) {' + |
| 15 |
' case 1:' + |
| 16 |
' function f() { /*{ body }*/ }' + |
| 17 |
'}\ |
| 18 |
/*{ after }*/' |
| 19 |
); |
| 20 |
}(/*{ args }*/)); |