OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 // Flags: --strong-mode --allow-natives-syntax | |
6 | |
7 function getStrongClass() { | |
8 "use strong"; | |
9 return (class {}); | |
10 } | |
11 | |
12 function weakClass() { | |
13 "use strict"; | |
14 class Weak extends getStrongClass() {} | |
15 } | |
16 | |
17 function strongClass() { | |
18 "use strong"; | |
19 class Strong extends getStrongClass() {} | |
20 } | |
21 | |
22 assertThrows(weakClass, TypeError); | |
23 %OptimizeFunctionOnNextCall(weakClass); | |
24 assertThrows(weakClass, TypeError); | |
25 | |
26 assertDoesNotThrow(strongClass); | |
27 %OptimizeFunctionOnNextCall(strongClass); | |
28 assertDoesNotThrow(strongClass); | |
OLD | NEW |