OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 // This benchmark is based on the six-speed benchmark build output. |
| 6 // Copyright 2014 Kevin Decker <https://github.com/kpdecker/six-speed/> |
| 7 |
| 8 new BenchmarkSuite('ES6', [1000], [ |
| 9 new Benchmark('ES6', false, false, 0, ES6), |
| 10 ]); |
| 11 |
| 12 class C { |
| 13 constructor() { |
| 14 this.foo = 'bar'; |
| 15 } |
| 16 bar() { |
| 17 return 41; |
| 18 } |
| 19 } |
| 20 |
| 21 class D extends C { |
| 22 constructor() { |
| 23 super(); |
| 24 this.baz = 'bat'; |
| 25 } |
| 26 bar() { |
| 27 return super.bar() + 1; |
| 28 } |
| 29 } |
| 30 |
| 31 function ES6() { |
| 32 var d = new D(); |
| 33 return d.bar(); |
| 34 } |
OLD | NEW |