| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | |
| 9 <link rel="import" href="/tracing/base/unit.html"> | 8 <link rel="import" href="/tracing/base/unit.html"> |
| 9 <link rel="import" href="/tracing/base/utils.html"> |
| 10 | 10 |
| 11 <script> | 11 <script> |
| 12 'use strict'; | 12 'use strict'; |
| 13 | 13 |
| 14 tr.exportTo('tr.b', function() { | 14 tr.exportTo('tr.b', function() { |
| 15 class Scalar { | 15 class Scalar { |
| 16 constructor(unit, value) { | 16 constructor(unit, value) { |
| 17 if (!(unit instanceof tr.b.Unit)) { | 17 if (!(unit instanceof tr.b.Unit)) { |
| 18 throw new Error('Expected Unit'); | 18 throw new Error('Expected Unit'); |
| 19 } | 19 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 return new Scalar(tr.b.Unit.fromJSON(d.unit), | 41 return new Scalar(tr.b.Unit.fromJSON(d.unit), |
| 42 tr.b.numberFromJson(d.value)); | 42 tr.b.numberFromJson(d.value)); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 return { | 46 return { |
| 47 Scalar, | 47 Scalar, |
| 48 }; | 48 }; |
| 49 }); | 49 }); |
| 50 </script> | 50 </script> |
| OLD | NEW |