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 Point { |
| 13 constructor(x, y) { |
| 14 this.x = x; |
| 15 this.y = y; |
| 16 } |
| 17 } |
| 18 |
| 19 class MyPoint extends Point {} |
| 20 |
| 21 function makePoint(x, y) { |
| 22 return new MyPoint(x, y); |
| 23 } |
| 24 |
| 25 function ES6() { |
| 26 'use strict'; |
| 27 return makePoint(1, 2); |
| 28 } |
OLD | NEW |