Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:math' as math; | 6 import 'dart:math' as math; |
| 7 | 7 |
| 8 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; | 8 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; |
| 9 import 'package:source_span/source_span.dart'; | 9 import 'package:source_span/source_span.dart'; |
| 10 | 10 |
| 11 import 'breakpoint.dart'; | 11 import 'breakpoint.dart'; |
| 12 import 'class.dart'; | 12 import 'class.dart'; |
| 13 import 'library.dart'; | 13 import 'library.dart'; |
| 14 import 'object.dart'; | 14 import 'object.dart'; |
| 15 import 'scope.dart'; | 15 import 'scope.dart'; |
| 16 import 'source_location.dart'; | 16 import 'source_location.dart'; |
| 17 | 17 |
| 18 String getScriptId(VMScriptRef scriptRef) => scriptRef._id; | |
|
nweiz
2016/04/28 19:44:00
If an RPC requires a script ID, it should be a met
kevmoo
2016/04/28 20:26:05
Done.
| |
| 19 | |
| 18 VMScriptRef newVMScriptRef(Scope scope, Map json) { | 20 VMScriptRef newVMScriptRef(Scope scope, Map json) { |
| 19 if (json == null) return null; | 21 if (json == null) return null; |
| 20 assert(json["type"] == "@Script" || json["type"] == "Script"); | 22 assert(json["type"] == "@Script" || json["type"] == "Script"); |
| 21 return new VMScriptRef._(scope, json); | 23 return new VMScriptRef._(scope, json); |
| 22 } | 24 } |
| 23 | 25 |
| 24 VMScriptToken newVMScriptToken(String isolateId, String scriptId, | 26 VMScriptToken newVMScriptToken(String isolateId, String scriptId, |
| 25 int position) { | 27 int position) { |
| 26 if (position == null) return null; | 28 if (position == null) return null; |
| 27 return new VMScriptToken._(isolateId, scriptId, position); | 29 return new VMScriptToken._(isolateId, scriptId, position); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 var start = math.min(this._start, other._start); | 309 var start = math.min(this._start, other._start); |
| 308 var end = math.max(this._end, other._end); | 310 var end = math.max(this._end, other._end); |
| 309 return new _ScriptSpan(_script, start, end); | 311 return new _ScriptSpan(_script, start, end); |
| 310 } else { | 312 } else { |
| 311 var start = math.min(this._start, other.start.offset); | 313 var start = math.min(this._start, other.start.offset); |
| 312 var end = math.max(this._end, other.end.offset); | 314 var end = math.max(this._end, other.end.offset); |
| 313 return file.span(start, end); | 315 return file.span(start, end); |
| 314 } | 316 } |
| 315 } | 317 } |
| 316 } | 318 } |
| OLD | NEW |