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 load('../../base.js'); |
| 9 |
| 10 new BenchmarkSuite('ES6', [1000], [ |
| 11 new Benchmark('ES6', false, false, 0, ES6), |
| 12 ]); |
| 13 |
| 14 class Point { |
| 15 constructor(x, y) { |
| 16 this.x = x; |
| 17 this.y = y; |
| 18 } |
| 19 } |
| 20 |
| 21 class MyPoint extends Point {} |
| 22 |
| 23 function makePoint(x, y) { |
| 24 return new MyPoint(x, y); |
| 25 } |
| 26 |
| 27 function ES6() { |
| 28 'use strict'; |
| 29 return makePoint(1, 2); |
| 30 } |
| 31 |
| 32 load('run.js'); |
OLD | NEW |