Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tool/input_sdk/private/debugger.dart

Issue 2101233004: maxspanlength setter (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: setter for testing Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/debugger.dart
diff --git a/tool/input_sdk/private/debugger.dart b/tool/input_sdk/private/debugger.dart
index 85c296503ca2532d8f92e524d8ba48e45a802309..4c29b9e1bd8bd7ec86c03646c9243abfe96dd8e4 100644
--- a/tool/input_sdk/private/debugger.dart
+++ b/tool/input_sdk/private/debugger.dart
@@ -30,7 +30,7 @@ class JsonMLConfig {
static const keyToString = const JsonMLConfig("keyToString");
}
-int maxSpanLength = 100;
+int _maxSpanLength = 100;
var _devtoolsFormatter = new JsonMLFormatter(new DartFormatter());
@@ -220,6 +220,10 @@ class JsonMLFormatter {
JsonMLFormatter(this._simpleFormatter);
+ void setMaxSpanLengthForTestingOnly(int spanLength) {
+ _maxSpanLength = spanLength;
+ }
+
header(object, config) {
if (config == JsonMLConfig.skipDart || isNativeJavaScriptObject(object)) {
return null;
@@ -633,7 +637,7 @@ class IterableSpanFormatter implements Formatter {
List<NameValuePair> childrenHelper(IterableSpan span) {
var length = span.end - span.start;
var ret = new List<NameValuePair>();
- if (length <= maxSpanLength) {
+ if (length <= _maxSpanLength) {
for (var i = span.start; i < span.end; i++) {
/// TODO(bmilligan): Stop using elementAt if it becomes a performance
/// bottleneck in the future.
@@ -647,8 +651,8 @@ List<NameValuePair> childrenHelper(IterableSpan span) {
/// maxPowerOfSubsetSize of 2, so the list will be broken up into 1
/// 10000-length subset and 1 1-length subset.
var maxPowerOfSubsetSize =
- (log(length - .5) / log(maxSpanLength)).truncate();
- var subsetSize = pow(maxSpanLength, maxPowerOfSubsetSize);
+ (log(length - .5) / log(_maxSpanLength)).truncate();
+ var subsetSize = pow(_maxSpanLength, maxPowerOfSubsetSize);
for (var i = span.start; i < span.end; i += subsetSize) {
var endIndex = min(span.end, subsetSize + i);
if (endIndex - i == 1)
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698