| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart'; | 5 import 'package:kernel/ast.dart'; |
| 6 | 6 |
| 7 /// Interface providing the ability to record property/value pairs associated | 7 /// Interface providing the ability to record property/value pairs associated |
| 8 /// with source file locations. Intended to facilitate testing. | 8 /// with source file locations. Intended to facilitate testing. |
| 9 abstract class Instrumentation { | 9 abstract class Instrumentation { |
| 10 /// Records a property/value pair associated with the given URI and offset. | 10 /// Records a property/value pair associated with the given URI and offset. |
| 11 void record(String property, Uri uri, int offset, InstrumentationValue value); | 11 void record(Uri uri, int offset, String property, InstrumentationValue value); |
| 12 } | 12 } |
| 13 | 13 |
| 14 /// Interface for values recorded by [Instrumentation]. | 14 /// Interface for values recorded by [Instrumentation]. |
| 15 abstract class InstrumentationValue { | 15 abstract class InstrumentationValue { |
| 16 const InstrumentationValue(); | 16 const InstrumentationValue(); |
| 17 | 17 |
| 18 /// Checks if the given String is an accurate description of this value. | 18 /// Checks if the given String is an accurate description of this value. |
| 19 /// | 19 /// |
| 20 /// The default implementation just checks for equality with the return value | 20 /// The default implementation just checks for equality with the return value |
| 21 /// of [toString], however derived classes may want a more sophisticated | 21 /// of [toString], however derived classes may want a more sophisticated |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 /// Instance of [InstrumentationValue] which only matches the given literal | 42 /// Instance of [InstrumentationValue] which only matches the given literal |
| 43 /// string. | 43 /// string. |
| 44 class InstrumentationValueLiteral extends InstrumentationValue { | 44 class InstrumentationValueLiteral extends InstrumentationValue { |
| 45 final String value; | 45 final String value; |
| 46 | 46 |
| 47 const InstrumentationValueLiteral(this.value); | 47 const InstrumentationValueLiteral(this.value); |
| 48 | 48 |
| 49 @override | 49 @override |
| 50 String toString() => value; | 50 String toString() => value; |
| 51 } | 51 } |
| OLD | NEW |