[cfe] Add file offsets for FunctionNode in ast-to-text

This is in preparation for adding missing file offsets.

Change-Id: If122a650a06c9ddf3ae5b73bf75d2f65aea51852
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488482
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This commit is contained in:
Johnni Winther
2026-03-17 06:22:14 -07:00
committed by Commit Queue
parent 176c192106
commit ee75d1dfab
63 changed files with 595 additions and 267 deletions
@@ -6,7 +6,7 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
}
@@ -14,11 +14,11 @@ import "dart:core" as core;
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -6,7 +6,7 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
}
@@ -14,11 +14,11 @@ import "dart:core" as core;
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -6,15 +6,15 @@ import "dart:core" as core;
[493] field core::String? s;
[503] field core::int? i;
[516] field core::double? d;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
[-1] ;
}
[528]class X2 extends core::Object {
[543] field core::String? s2;
[554] field core::int? i;
[567] field core::double? d;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
[-1] ;
}
[222]static method method([229] dynamic o) → void
[222]static method [228] [469] method([229] dynamic o) → void
[-1] ;
@@ -6,7 +6,7 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
}
@@ -14,11 +14,11 @@ import "dart:core" as core;
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -6,23 +6,23 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
[478] static synthetic method _#new#tearOff() → self::X1
[478] static synthetic method [478] [478] _#new#tearOff() → self::X1
[478] return [478] [478] new self::X1::• [478]();
}
[528]class X2 extends core::Object {
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
[528] static synthetic method _#new#tearOff() → self::X2
[528] static synthetic method [528] [528] _#new#tearOff() → self::X2
[528] return [528] [528] new self::X2::• [528]();
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -6,23 +6,23 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
[478] static synthetic method _#new#tearOff() → self::X1
[478] static synthetic method [478] [478] _#new#tearOff() → self::X1
[478] return [478] [478] new self::X1::• [478]();
}
[528]class X2 extends core::Object {
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
[528] static synthetic method _#new#tearOff() → self::X2
[528] static synthetic method [528] [528] _#new#tearOff() → self::X2
[528] return [528] [528] new self::X2::• [528]();
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -6,19 +6,19 @@ import "dart:core" as core;
[493] field core::String? s;
[503] field core::int? i;
[516] field core::double? d;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
[-1] ;
[478] static synthetic method _#new#tearOff() → self::X1
[478] static synthetic method [478] [478] _#new#tearOff() → self::X1
[478] return [478] [478] new self::X1::• [478]();
}
[528]class X2 extends core::Object {
[543] field core::String? s2;
[554] field core::int? i;
[567] field core::double? d;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
[-1] ;
[528] static synthetic method _#new#tearOff() → self::X2
[528] static synthetic method [528] [528] _#new#tearOff() → self::X2
[528] return [528] [528] new self::X2::• [528]();
}
[222]static method method([229] dynamic o) → void
[222]static method [228] [469] method([229] dynamic o) → void
[-1] ;
@@ -6,23 +6,23 @@ import "dart:core" as core;
[493] field core::String? s = [-1] [-1] null;
[503] field core::int? i = [-1] [-1] null;
[516] field core::double? d = [-1] [-1] null;
[478] synthetic constructor •() → self::X1
[478] synthetic constructor [-1] [-1] •() → self::X1
: [-1] super core::Object::• [-1]()
[-1] ;
[478] static synthetic method _#new#tearOff() → self::X1
[478] static synthetic method [478] [478] _#new#tearOff() → self::X1
[478] return [478] [478] new self::X1::• [478]();
}
[528]class X2 extends core::Object {
[543] field core::String? s2 = [-1] [-1] null;
[554] field core::int? i = [-1] [-1] null;
[567] field core::double? d = [-1] [-1] null;
[528] synthetic constructor •() → self::X2
[528] synthetic constructor [-1] [-1] •() → self::X2
: [-1] super core::Object::• [-1]()
[-1] ;
[528] static synthetic method _#new#tearOff() → self::X2
[528] static synthetic method [528] [528] _#new#tearOff() → self::X2
[528] return [528] [528] new self::X2::• [528]();
}
[222]static method method([229] dynamic o) → void {
[222]static method [228] [469] method([229] dynamic o) → void {
[236] #L1:
[236] {
[244] [244] final synthesized dynamic #0#0 = [244] [244] o;
@@ -0,0 +1,10 @@
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:js_interop';
extension type Foo._(JSObject _) implements JSObject {
@JS('foo')
external bool? bar;
}
@@ -0,0 +1,35 @@
library;
import self as self;
import "dart:js_interop" as js_;
import "dart:core" as core;
[217]import "dart:js_interop";
[259]extension type Foo(js_::JSObject /* erasure=dart._interceptors::JSObject */ _) implements js_::JSObject /* erasure=dart._interceptors::JSObject */ {
[274] abstract extension-type-member representation-field get [-1] [-1] _() → js_::JSObject /* erasure=dart._interceptors::JSObject */;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[263]static extension-type-member method [264] [264] Foo|constructor#_([274] wildcard js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */ {
[274] [274] lowered final self::Foo /* erasure=dart._interceptors::JSObject */ #this = [274] [274] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[263]static extension-type-member synthetic method [263] [263] Foo|constructor#_#_#tearOff([274] js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */
[263] return [263] [263] self::Foo|constructor#_ [263]([263] _#wc0#formal);
[329]@[302] [302] #C2
external static extension-type-member method [-1] [-1] Foo|get#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this) → core::bool?;
[329]@[302] [302] #C2
external static extension-type-member method [329] [332] Foo|set#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this, [329] synthesized core::bool? #externalFieldValue) → void;
constants {
#C1 = "foo"
#C2 = js_::JS {name:#C1}
}
Constructor coverage from constants:
org-dartlang-testcase:///external_field.dart:
- JS. (from org-dartlang-sdk:///lib/js_interop/js_interop.dart)
- Object. (from org-dartlang-sdk:///lib/core/object.dart)
@@ -0,0 +1,35 @@
library;
import self as self;
import "dart:js_interop" as js_;
import "dart:core" as core;
[217]import "dart:js_interop";
[259]extension type Foo(js_::JSObject /* erasure=dart._interceptors::JSObject */ _) implements js_::JSObject /* erasure=dart._interceptors::JSObject */ {
[274] abstract extension-type-member representation-field get [-1] [-1] _() → js_::JSObject /* erasure=dart._interceptors::JSObject */;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[263]static extension-type-member method [264] [264] Foo|constructor#_([274] wildcard js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */ {
[274] [274] lowered final self::Foo /* erasure=dart._interceptors::JSObject */ #this = [274] [274] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[263]static extension-type-member synthetic method [263] [263] Foo|constructor#_#_#tearOff([274] js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */
[263] return [263] [263] self::Foo|constructor#_ [263]([263] _#wc0#formal);
[329]@[302] [302] #C2
external static extension-type-member method [-1] [-1] Foo|get#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this) → core::bool?;
[329]@[302] [302] #C2
external static extension-type-member method [329] [332] Foo|set#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this, [329] synthesized core::bool? #externalFieldValue) → void;
constants {
#C1 = "foo"
#C2 = js_::JS {name:#C1}
}
Constructor coverage from constants:
org-dartlang-testcase:///external_field.dart:
- JS. (from org-dartlang-sdk:///lib/js_interop/js_interop.dart)
- Object. (from org-dartlang-sdk:///lib/core/object.dart)
@@ -0,0 +1,28 @@
library;
import self as self;
import "dart:js_interop" as js_;
import "dart:core" as core;
[217]import "dart:js_interop";
[259]extension type Foo(js_::JSObject /* erasure=dart._interceptors::JSObject */ _) implements js_::JSObject /* erasure=dart._interceptors::JSObject */ {
[274] abstract extension-type-member representation-field get [-1] [-1] _() → js_::JSObject /* erasure=dart._interceptors::JSObject */;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[263]static extension-type-member method [264] [264] Foo|constructor#_([274] wildcard js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */
[-1] ;
[263]static extension-type-member synthetic method [263] [263] Foo|constructor#_#_#tearOff([274] js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */
[263] return [263] [263] self::Foo|constructor#_ [263]([263] _#wc0#formal);
[329]@js_::JS::•([305] "foo")
external static extension-type-member method [-1] [-1] Foo|get#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this) → core::bool?;
[329]@js_::JS::•([305] "foo")
external static extension-type-member method [329] [332] Foo|set#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this, [329] synthesized core::bool? #externalFieldValue) → void;
Extra constant evaluation status:
Evaluated: ConstructorInvocation @ org-dartlang-testcase:///external_field.dart:8:4 -> InstanceConstant(const JS{JS.name: "foo"})
Evaluated: ConstructorInvocation @ org-dartlang-testcase:///external_field.dart:8:4 -> InstanceConstant(const JS{JS.name: "foo"})
Extra constant evaluation: evaluated: 4, effectively constant: 2
@@ -0,0 +1,35 @@
library;
import self as self;
import "dart:js_interop" as js_;
import "dart:core" as core;
[217]import "dart:js_interop";
[259]extension type Foo(js_::JSObject /* erasure=dart._interceptors::JSObject */ _) implements js_::JSObject /* erasure=dart._interceptors::JSObject */ {
[274] abstract extension-type-member representation-field get [-1] [-1] _() → js_::JSObject /* erasure=dart._interceptors::JSObject */;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[263]static extension-type-member method [264] [264] Foo|constructor#_([274] wildcard js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */ {
[274] [274] lowered final self::Foo /* erasure=dart._interceptors::JSObject */ #this = [274] [274] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[263]static extension-type-member synthetic method [263] [263] Foo|constructor#_#_#tearOff([274] js_::JSObject /* erasure=dart._interceptors::JSObject */ _#wc0#formal) → self::Foo /* erasure=dart._interceptors::JSObject */
[263] return [263] [263] self::Foo|constructor#_ [263]([263] _#wc0#formal);
[329]@[302] [302] #C2
external static extension-type-member method [-1] [-1] Foo|get#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this) → core::bool?;
[329]@[302] [302] #C2
external static extension-type-member method [329] [332] Foo|set#bar([329] lowered js_::JSObject /* erasure=dart._interceptors::JSObject */ #this, [329] synthesized core::bool? #externalFieldValue) → void;
constants {
#C1 = "foo"
#C2 = js_::JS {name:#C1}
}
Constructor coverage from constants:
org-dartlang-testcase:///external_field.dart:
- JS. (from org-dartlang-sdk:///lib/js_interop/js_interop.dart)
- Object. (from org-dartlang-sdk:///lib/core/object.dart)
@@ -0,0 +1,6 @@
import 'dart:js_interop';
extension type Foo._(JSObject _) implements JSObject {
@JS('foo')
external bool? bar;
}
@@ -0,0 +1,6 @@
import 'dart:js_interop';
extension type Foo._(JSObject _) implements JSObject {
@JS('foo')
external bool? bar;
}
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -1,5 +1,5 @@
library;
import self as self;
[217]static method method([224] dynamic o) → dynamic
[217]static method [223] [325] method([224] dynamic o) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -1,5 +1,5 @@
library;
import self as self;
[217]static method method([224] dynamic o) → dynamic
[217]static method [223] [404] method([224] dynamic o) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
import "dart:collection" as col;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [973] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
import "dart:collection" as col;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [973] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -2,5 +2,5 @@ library;
import self as self;
import "dart:core" as core;
[222]static method main([240] core::List<core::String> args) → void
[222]static method [226] [973] main([240] core::List<core::String> args) → void
[-1] ;
@@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
import "dart:collection" as col;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [973] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -0,0 +1,7 @@
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
extension type Foo._(Duration _) implements Duration {
external int bar;
}
@@ -0,0 +1,19 @@
library;
import self as self;
import "dart:core" as core;
[232]extension type Foo(core::Duration _) implements core::Duration {
[247] abstract extension-type-member representation-field get [-1] [-1] _() → core::Duration;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[236]static extension-type-member method [237] [237] Foo|constructor#_([247] wildcard core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */ {
[247] [247] lowered final self::Foo /* erasure=core::Duration */ #this = [247] [247] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[236]static extension-type-member synthetic method [236] [236] Foo|constructor#_#_#tearOff([247] core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */
[236] return [236] [236] self::Foo|constructor#_ [236]([236] _#wc0#formal);
[287]external static extension-type-member method [-1] [-1] Foo|get#bar([287] lowered core::Duration #this) → core::int;
[287]external static extension-type-member method [287] [290] Foo|set#bar([287] lowered core::Duration #this, [287] synthesized core::int #externalFieldValue) → void;
@@ -0,0 +1,19 @@
library;
import self as self;
import "dart:core" as core;
[232]extension type Foo(core::Duration _) implements core::Duration {
[247] abstract extension-type-member representation-field get [-1] [-1] _() → core::Duration;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[236]static extension-type-member method [237] [237] Foo|constructor#_([247] wildcard core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */ {
[247] [247] lowered final self::Foo /* erasure=core::Duration */ #this = [247] [247] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[236]static extension-type-member synthetic method [236] [236] Foo|constructor#_#_#tearOff([247] core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */
[236] return [236] [236] self::Foo|constructor#_ [236]([236] _#wc0#formal);
[287]external static extension-type-member method [-1] [-1] Foo|get#bar([287] lowered core::Duration #this) → core::int;
[287]external static extension-type-member method [287] [290] Foo|set#bar([287] lowered core::Duration #this, [287] synthesized core::int #externalFieldValue) → void;
@@ -0,0 +1,17 @@
library;
import self as self;
import "dart:core" as core;
[232]extension type Foo(core::Duration _) implements core::Duration {
[247] abstract extension-type-member representation-field get [-1] [-1] _() → core::Duration;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[236]static extension-type-member method [237] [237] Foo|constructor#_([247] wildcard core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */
[-1] ;
[236]static extension-type-member synthetic method [236] [236] Foo|constructor#_#_#tearOff([247] core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */
[236] return [236] [236] self::Foo|constructor#_ [236]([236] _#wc0#formal);
[287]external static extension-type-member method [-1] [-1] Foo|get#bar([287] lowered core::Duration #this) → core::int;
[287]external static extension-type-member method [287] [290] Foo|set#bar([287] lowered core::Duration #this, [287] synthesized core::int #externalFieldValue) → void;
@@ -0,0 +1,19 @@
library;
import self as self;
import "dart:core" as core;
[232]extension type Foo(core::Duration _) implements core::Duration {
[247] abstract extension-type-member representation-field get [-1] [-1] _() → core::Duration;
get bar = self::Foo|get#bar;
set bar = self::Foo|set#bar;
constructor _ = self::Foo|constructor#_;
constructor tearoff _ = self::Foo|constructor#_#_#tearOff;
}
[236]static extension-type-member method [237] [237] Foo|constructor#_([247] wildcard core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */ {
[247] [247] lowered final self::Foo /* erasure=core::Duration */ #this = [247] [247] _#wc0#formal;
[-1] return [-1] [-1] #this;
}
[236]static extension-type-member synthetic method [236] [236] Foo|constructor#_#_#tearOff([247] core::Duration _#wc0#formal) → self::Foo /* erasure=core::Duration */
[236] return [236] [236] self::Foo|constructor#_ [236]([236] _#wc0#formal);
[287]external static extension-type-member method [-1] [-1] Foo|get#bar([287] lowered core::Duration #this) → core::int;
[287]external static extension-type-member method [287] [290] Foo|set#bar([287] lowered core::Duration #this, [287] synthesized core::int #externalFieldValue) → void;
@@ -0,0 +1,3 @@
extension type Foo._(Duration _) implements Duration {
external int bar;
}
@@ -0,0 +1,3 @@
extension type Foo._(Duration _) implements Duration {
external int bar;
}
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -1,5 +1,5 @@
library;
import self as self;
[217]static method method([224] dynamic o) → dynamic
[217]static method [223] [325] method([224] dynamic o) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([229] core::List<dynamic> list) → dynamic {
[217]static method [223] [357] method([229] core::List<dynamic> list) → dynamic {
[239] {
[249] [249] hoisted dynamic a;
[252] [252] hoisted dynamic b;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([229] core::List<dynamic> list) → dynamic {
[217]static method [223] [357] method([229] core::List<dynamic> list) → dynamic {
[239] {
[249] [249] hoisted dynamic a;
[252] [252] hoisted dynamic b;
@@ -2,5 +2,5 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([229] core::List<dynamic> list) → dynamic
[217]static method [223] [357] method([229] core::List<dynamic> list) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([229] core::List<dynamic> list) → dynamic {
[217]static method [223] [357] method([229] core::List<dynamic> list) → dynamic {
[239] {
[249] [249] hoisted dynamic a;
[252] [252] hoisted dynamic b;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -1,5 +1,5 @@
library;
import self as self;
[217]static method method([224] dynamic o) → dynamic
[217]static method [223] [325] method([224] dynamic o) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [325] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -1,5 +1,5 @@
library;
import self as self;
[217]static method method([224] dynamic o) → dynamic
[217]static method [223] [404] method([224] dynamic o) → dynamic
[-1] ;
@@ -2,7 +2,7 @@ library;
import self as self;
import "dart:core" as core;
[217]static method method([224] dynamic o) → dynamic {
[217]static method [223] [404] method([224] dynamic o) → dynamic {
[231] #L1:
[231] {
[239] [239] final synthesized dynamic #0#0 = [239] [239] o;
@@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
import "dart:collection" as col;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [1206] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -3,7 +3,7 @@ import self as self;
import "dart:core" as core;
import "dart:collection" as col;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [1206] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -2,5 +2,5 @@ library;
import self as self;
import "dart:core" as core;
[222]static method main([240] core::List<core::String> args) → void
[222]static method [226] [1206] main([240] core::List<core::String> args) → void
[-1] ;
@@ -4,7 +4,7 @@ import "dart:core" as core;
import "dart:collection" as col;
import "dart:_compact_hash" as _co;
[222]static method main([240] core::List<core::String> args) → void {
[222]static method [226] [1206] main([240] core::List<core::String> args) → void {
[262] [262] core::Set<core::String> fooSet = [271] [271] block {
[271] [271] final core::Set<core::String> #t1 = [271] [271] col::LinkedHashSet::of [271]<core::String>([280] args);
[290] [290] [290] [-1] [-1] #t1.{core::Set::add}{Invariant}[-1]([290] "hello"){(core::String) → core::bool};
@@ -5,23 +5,23 @@ import "dart:core" as core;
[217]import "dart:math" show pi;
[261]abstract class Shape extends core::Object {
[261] synthetic constructor •() → self::Shape
[261] synthetic constructor [-1] [-1] •() → self::Shape
: [-1] super core::Object::• [-1]()
[-1] ;
}
[277]class Square extends core::Object implements self::Shape {
[318] final field core::double length;
[328] constructor •([340] core::double length) → self::Square
[328] constructor [334] [347] •([340] core::double length) → self::Square
: [340] self::Square::length = [340] [340] length, [328] super core::Object::• [328]()
[-1] ;
}
[358]class Circle extends core::Object implements self::Shape {
[399] final field core::double radius;
[409] constructor •([421] core::double radius) → self::Circle
[409] constructor [415] [428] •([421] core::double radius) → self::Circle
: [421] self::Circle::radius = [421] [421] radius, [409] super core::Object::• [409]()
[-1] ;
}
[440]static method calculateArea([460] self::Shape shape) → core::double
[440]static method [453] [708] calculateArea([460] self::Shape shape) → core::double
[470] return [470] [470] block {
[-1] [-1] core::double #t1;
[478] [478] final synthesized self::Shape #0#0 = [478] [478] shape;
@@ -67,7 +67,7 @@ import "dart:core" as core;
}
}
} =>[-1] [-1] #t1;
[711]static method testMain() → dynamic {
[711]static method [719] [755] testMain() → dynamic {
[726] [726] [726] self::calculateArea [739]([740] new self::Circle::• [746]([747] -123.0));
}
@@ -5,23 +5,23 @@ import "dart:core" as core;
[217]import "dart:math" show pi;
[261]abstract class Shape extends core::Object {
[261] synthetic constructor •() → self::Shape
[261] synthetic constructor [-1] [-1] •() → self::Shape
: [-1] super core::Object::• [-1]()
[-1] ;
}
[277]class Square extends core::Object implements self::Shape {
[318] final field core::double length;
[328] constructor •([340] core::double length) → self::Square
[328] constructor [334] [347] •([340] core::double length) → self::Square
: [340] self::Square::length = [340] [340] length, [328] super core::Object::• [328]()
[-1] ;
}
[358]class Circle extends core::Object implements self::Shape {
[399] final field core::double radius;
[409] constructor •([421] core::double radius) → self::Circle
[409] constructor [415] [428] •([421] core::double radius) → self::Circle
: [421] self::Circle::radius = [421] [421] radius, [409] super core::Object::• [409]()
[-1] ;
}
[440]static method calculateArea([460] self::Shape shape) → core::double
[440]static method [453] [708] calculateArea([460] self::Shape shape) → core::double
[470] return [470] [470] block {
[-1] [-1] core::double #t1;
[478] [478] final synthesized self::Shape #0#0 = [478] [478] shape;
@@ -67,7 +67,7 @@ import "dart:core" as core;
}
}
} =>[-1] [-1] #t1;
[711]static method testMain() → dynamic {
[711]static method [719] [755] testMain() → dynamic {
[726] [726] [726] self::calculateArea [739]([740] new self::Circle::• [746]([747] -123.0));
}
@@ -5,20 +5,20 @@ import "dart:core" as core;
[217]import "dart:math" show pi;
[261]abstract class Shape extends core::Object {
[261] synthetic constructor •() → self::Shape
[261] synthetic constructor [-1] [-1] •() → self::Shape
[-1] ;
}
[277]class Square extends core::Object implements self::Shape {
[318] final field core::double length;
[328] constructor •([340] core::double length) → self::Square
[328] constructor [334] [347] •([340] core::double length) → self::Square
[-1] ;
}
[358]class Circle extends core::Object implements self::Shape {
[399] final field core::double radius;
[409] constructor •([421] core::double radius) → self::Circle
[409] constructor [415] [428] •([421] core::double radius) → self::Circle
[-1] ;
}
[440]static method calculateArea([460] self::Shape shape) → core::double
[440]static method [453] [708] calculateArea([460] self::Shape shape) → core::double
[-1] ;
[711]static method testMain() → dynamic
[711]static method [719] [755] testMain() → dynamic
[-1] ;
@@ -5,23 +5,23 @@ import "dart:core" as core;
[217]import "dart:math" show pi;
[261]abstract class Shape extends core::Object {
[261] synthetic constructor •() → self::Shape
[261] synthetic constructor [-1] [-1] •() → self::Shape
: [-1] super core::Object::• [-1]()
[-1] ;
}
[277]class Square extends core::Object implements self::Shape {
[318] final field core::double length;
[328] constructor •([340] core::double length) → self::Square
[328] constructor [334] [347] •([340] core::double length) → self::Square
: [340] self::Square::length = [340] [340] length, [328] super core::Object::• [328]()
[-1] ;
}
[358]class Circle extends core::Object implements self::Shape {
[399] final field core::double radius;
[409] constructor •([421] core::double radius) → self::Circle
[409] constructor [415] [428] •([421] core::double radius) → self::Circle
: [421] self::Circle::radius = [421] [421] radius, [409] super core::Object::• [409]()
[-1] ;
}
[440]static method calculateArea([460] self::Shape shape) → core::double
[440]static method [453] [708] calculateArea([460] self::Shape shape) → core::double
[470] return [470] [470] block {
[-1] [-1] core::double #t1;
[478] [478] final synthesized self::Shape #0#0 = [478] [478] shape;
@@ -67,7 +67,7 @@ import "dart:core" as core;
}
}
} =>[-1] [-1] #t1;
[711]static method testMain() → dynamic {
[711]static method [719] [755] testMain() → dynamic {
[726] [726] [726] self::calculateArea [739]([740] new self::Circle::• [746]([747] -123.0));
}
@@ -7,32 +7,32 @@ import "dart:core" as core;
[229] enum-element static const field self::E b = [229] [229] #C6;
[232] enum-element static const field self::E c = [232] [232] #C9;
[222] static const field core::List<self::E> values = [-1] [-1] #C10;
[222] const synthetic constructor •([222] core::int #index, [222] core::String #name) → self::E
[222] const synthetic constructor [222] [222] •([222] core::int #index, [222] core::String #name) → self::E
: [222] super core::_Enum::• [222]([-1] #index, [-1] #name)
[-1] ;
[222] method core::_enumToString() → core::String
[222] method [222] [222] core::_enumToString() → core::String
[-1] return [-1] [-1] "E.${[-1] [-1] [-1] [-1] this.{core::_Enum::_name}{core::String}}";
}
[243]class PrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[273] final field core::int field;
[289] const constructor •([310] core::int field) → self::PrimitiveEquals
[289] const constructor [304] [316] •([310] core::int field) → self::PrimitiveEquals
: [310] self::PrimitiveEquals::field = [310] [310] field, [289] super core::Object::• [289]()
[-1] ;
}
[327]class NonPrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[360] final field core::int field;
[376] const constructor •([400] core::int field) → self::NonPrimitiveEquals
[376] const constructor [394] [406] •([400] core::int field) → self::NonPrimitiveEquals
: [400] self::NonPrimitiveEquals::field = [400] [400] field, [376] super core::Object::• [376]()
[-1] ;
[419] get hashCode() → core::int
[419] get [428] [445] hashCode() → core::int
[431] return [437] [437] [431] [431] [431] [431] this.{self::NonPrimitiveEquals::field}{core::int}.{core::num::hashCode}{core::int};
[464] operator ==([474] core::Object other) → core::bool {
[464] operator [466] [594] ==([474] core::Object other) → core::bool {
[487] if([491] [491] core::identical [500]([501] this, [507] other))
[515] return [522] [522] true;
[532] return [567] [567] [545] [545] [539] [539] other is self::NonPrimitiveEquals && [576] [576] [570] [570] [570] [570] this.{self::NonPrimitiveEquals::field}{core::int} =={core::num::==}{(core::Object) → core::bool} [585] [585] [579] [579] other{self::NonPrimitiveEquals}.{self::NonPrimitiveEquals::field}{core::int};
}
}
[599]static method switchStatement([615] dynamic o) → dynamic {
[599]static method [614] [753] switchStatement([615] dynamic o) → dynamic {
[622] #L1:
[622] {
[630] [630] final synthesized dynamic #0#0 = [630] [630] o;
@@ -64,7 +64,7 @@ import "dart:core" as core;
}
}
}
[756]static method switchStatementWithLabel([781] dynamic o) → dynamic {
[756]static method [780] [958] switchStatementWithLabel([781] dynamic o) → dynamic {
[788] #L2:
[788] {
[796] [796] final synthesized dynamic #0#0 = [796] [796] o;
@@ -104,7 +104,7 @@ import "dart:core" as core;
}
}
}
[961]static method switchStatementWithContinue([989] dynamic o) → dynamic {
[961]static method [988] [1281] switchStatementWithContinue([989] dynamic o) → dynamic {
[996] #L3:
[996] {
[996] [996] core::int #t21 = [996] [996] [996] [996] 1.{core::int::unary-}[996](){() → core::int};
@@ -180,7 +180,7 @@ import "dart:core" as core;
}
}
}
[1284]static method switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1284]static method [1317] [2388] switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1330] #L7:
[1330] {
[1330] [1330] core::int #t32 = [1330] [1330] [1330] [1330] 1.{core::int::unary-}[1330](){() → core::int};
@@ -402,7 +402,7 @@ import "dart:core" as core;
}
}
}
[2391]static method switchStatementEnum([2413] self::E o) → dynamic {
[2391]static method [2410] [2533] switchStatementEnum([2413] self::E o) → dynamic {
[2420] #L19:
[2420] switch([2428] [2428] o) /* isExplicitlyExhaustive, self::E */ {
[2437] #L20:
@@ -424,7 +424,7 @@ import "dart:core" as core;
}
}
}
[2536]static method switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2536]static method [2564] [2677] switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2574] #L23:
[2574] {
[2582] [2582] final synthesized self::E #0#0 = [2582] [2582] o;
@@ -452,7 +452,7 @@ import "dart:core" as core;
}
}
}
[2680]static method switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2680]static method [2708] [2842] switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2718] #L24:
[2718] switch([2726] [2726] o) /* isExplicitlyExhaustive, self::E */ {
[2735] #L25:
@@ -474,7 +474,7 @@ import "dart:core" as core;
}
}
}
[2845]static method switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2845]static method [2876] [3069] switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2886] #L28:
[2886] switch([2894] [2894] o) /* isExplicitlyExhaustive, self::E */ {
[2903] #L29:
@@ -496,7 +496,7 @@ import "dart:core" as core;
}
}
}
[3072]static method switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3072]static method [3102] [3233] switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3110] #L32:
[3110] switch([3118] [3118] o) /* dynamic */ {
[3127] #L33:
@@ -512,7 +512,7 @@ import "dart:core" as core;
}
}
}
[3236]static method switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3236]static method [3269] [3406] switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3277] #L35:
[3277] {
[3285] [3285] final synthesized dynamic #0#0 = [3285] [3285] o;
@@ -535,7 +535,7 @@ import "dart:core" as core;
}
}
}
[3409]static method switchExpression([3426] dynamic o) → dynamic {
[3409]static method [3425] [3512] switchExpression([3426] dynamic o) → dynamic {
[3433] return [3440] [3440] block {
[-1] [-1] dynamic #t59;
[3448] [3448] final synthesized dynamic #0#0 = [3448] [3448] o;
@@ -569,7 +569,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t59;
}
[3515]static method switchExpressionEnum([3538] self::E o) → dynamic {
[3515]static method [3535] [3612] switchExpressionEnum([3538] self::E o) → dynamic {
[3545] return [3552] [3552] block {
[-1] [-1] core::int #t62;
[3552] #L37:
@@ -595,7 +595,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t62;
}
[3615]static method switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3615]static method [3644] [3729] switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3654] return [3661] [3661] block {
[-1] [-1] core::int #t63;
[3669] [3669] final synthesized self::E #0#0 = [3669] [3669] o;
@@ -624,7 +624,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t63;
}
[3732]static method switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3732]static method [3763] [3878] switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3771] return [3778] [3778] block {
[-1] [-1] core::int #t64;
[3786] [3786] final synthesized dynamic #0#0 = [3786] [3786] o;
@@ -653,7 +653,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t64;
}
[3881]static method switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3881]static method [3915] [4036] switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3923] return [3930] [3930] block {
[-1] [-1] core::int #t65;
[3938] [3938] final synthesized dynamic #0#0 = [3938] [3938] o;
@@ -682,7 +682,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t65;
}
[4039]static method switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4039]static method [4060] [4194] switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4075] #L44:
[4075] {
[4083] [4083] final synthesized core::Symbol #0#0 = [4083] [4083] s;
@@ -711,7 +711,7 @@ import "dart:core" as core;
}
}
}
[4197]static method switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4197]static method [4219] [4312] switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4234] return [4241] [4241] block {
[-1] [-1] core::int #t66;
[4249] [4249] final synthesized core::Symbol #0#0 = [4249] [4249] s;
@@ -7,32 +7,32 @@ import "dart:core" as core;
[229] enum-element static const field self::E b = [229] [229] #C6;
[232] enum-element static const field self::E c = [232] [232] #C9;
[222] static const field core::List<self::E> values = [-1] [-1] #C10;
[222] const synthetic constructor •([222] core::int #index, [222] core::String #name) → self::E
[222] const synthetic constructor [222] [222] •([222] core::int #index, [222] core::String #name) → self::E
: [222] super core::_Enum::• [222]([-1] #index, [-1] #name)
[-1] ;
[222] method core::_enumToString() → core::String
[222] method [222] [222] core::_enumToString() → core::String
[-1] return [-1] [-1] "E.${[-1] [-1] [-1] [-1] this.{core::_Enum::_name}{core::String}}";
}
[243]class PrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[273] final field core::int field;
[289] const constructor •([310] core::int field) → self::PrimitiveEquals
[289] const constructor [304] [316] •([310] core::int field) → self::PrimitiveEquals
: [310] self::PrimitiveEquals::field = [310] [310] field, [289] super core::Object::• [289]()
[-1] ;
}
[327]class NonPrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[360] final field core::int field;
[376] const constructor •([400] core::int field) → self::NonPrimitiveEquals
[376] const constructor [394] [406] •([400] core::int field) → self::NonPrimitiveEquals
: [400] self::NonPrimitiveEquals::field = [400] [400] field, [376] super core::Object::• [376]()
[-1] ;
[419] get hashCode() → core::int
[419] get [428] [445] hashCode() → core::int
[431] return [437] [437] [431] [431] [431] [431] this.{self::NonPrimitiveEquals::field}{core::int}.{core::num::hashCode}{core::int};
[464] operator ==([474] core::Object other) → core::bool {
[464] operator [466] [594] ==([474] core::Object other) → core::bool {
[487] if([491] [491] core::identical [500]([501] this, [507] other))
[515] return [522] [522] true;
[532] return [567] [567] [545] [545] [539] [539] other is self::NonPrimitiveEquals && [576] [576] [570] [570] [570] [570] this.{self::NonPrimitiveEquals::field}{core::int} =={core::num::==}{(core::Object) → core::bool} [585] [585] [579] [579] other{self::NonPrimitiveEquals}.{self::NonPrimitiveEquals::field}{core::int};
}
}
[599]static method switchStatement([615] dynamic o) → dynamic {
[599]static method [614] [753] switchStatement([615] dynamic o) → dynamic {
[622] #L1:
[622] {
[630] [630] final synthesized dynamic #0#0 = [630] [630] o;
@@ -64,7 +64,7 @@ import "dart:core" as core;
}
}
}
[756]static method switchStatementWithLabel([781] dynamic o) → dynamic {
[756]static method [780] [958] switchStatementWithLabel([781] dynamic o) → dynamic {
[788] #L2:
[788] {
[796] [796] final synthesized dynamic #0#0 = [796] [796] o;
@@ -104,7 +104,7 @@ import "dart:core" as core;
}
}
}
[961]static method switchStatementWithContinue([989] dynamic o) → dynamic {
[961]static method [988] [1281] switchStatementWithContinue([989] dynamic o) → dynamic {
[996] #L3:
[996] {
[996] [996] core::int #t21 = [996] [996] [996] [996] 1.{core::int::unary-}[996](){() → core::int};
@@ -180,7 +180,7 @@ import "dart:core" as core;
}
}
}
[1284]static method switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1284]static method [1317] [2388] switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1330] #L7:
[1330] {
[1330] [1330] core::int #t32 = [1330] [1330] [1330] [1330] 1.{core::int::unary-}[1330](){() → core::int};
@@ -402,7 +402,7 @@ import "dart:core" as core;
}
}
}
[2391]static method switchStatementEnum([2413] self::E o) → dynamic {
[2391]static method [2410] [2533] switchStatementEnum([2413] self::E o) → dynamic {
[2420] #L19:
[2420] switch([2428] [2428] o) /* isExplicitlyExhaustive, self::E */ {
[2437] #L20:
@@ -424,7 +424,7 @@ import "dart:core" as core;
}
}
}
[2536]static method switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2536]static method [2564] [2677] switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2574] #L23:
[2574] {
[2582] [2582] final synthesized self::E #0#0 = [2582] [2582] o;
@@ -452,7 +452,7 @@ import "dart:core" as core;
}
}
}
[2680]static method switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2680]static method [2708] [2842] switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2718] #L24:
[2718] switch([2726] [2726] o) /* isExplicitlyExhaustive, self::E */ {
[2735] #L25:
@@ -474,7 +474,7 @@ import "dart:core" as core;
}
}
}
[2845]static method switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2845]static method [2876] [3069] switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2886] #L28:
[2886] switch([2894] [2894] o) /* isExplicitlyExhaustive, self::E */ {
[2903] #L29:
@@ -496,7 +496,7 @@ import "dart:core" as core;
}
}
}
[3072]static method switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3072]static method [3102] [3233] switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3110] #L32:
[3110] switch([3118] [3118] o) /* dynamic */ {
[3127] #L33:
@@ -512,7 +512,7 @@ import "dart:core" as core;
}
}
}
[3236]static method switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3236]static method [3269] [3406] switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3277] #L35:
[3277] {
[3285] [3285] final synthesized dynamic #0#0 = [3285] [3285] o;
@@ -535,7 +535,7 @@ import "dart:core" as core;
}
}
}
[3409]static method switchExpression([3426] dynamic o) → dynamic {
[3409]static method [3425] [3512] switchExpression([3426] dynamic o) → dynamic {
[3433] return [3440] [3440] block {
[-1] [-1] dynamic #t59;
[3448] [3448] final synthesized dynamic #0#0 = [3448] [3448] o;
@@ -569,7 +569,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t59;
}
[3515]static method switchExpressionEnum([3538] self::E o) → dynamic {
[3515]static method [3535] [3612] switchExpressionEnum([3538] self::E o) → dynamic {
[3545] return [3552] [3552] block {
[-1] [-1] core::int #t62;
[3552] #L37:
@@ -595,7 +595,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t62;
}
[3615]static method switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3615]static method [3644] [3729] switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3654] return [3661] [3661] block {
[-1] [-1] core::int #t63;
[3669] [3669] final synthesized self::E #0#0 = [3669] [3669] o;
@@ -624,7 +624,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t63;
}
[3732]static method switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3732]static method [3763] [3878] switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3771] return [3778] [3778] block {
[-1] [-1] core::int #t64;
[3786] [3786] final synthesized dynamic #0#0 = [3786] [3786] o;
@@ -653,7 +653,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t64;
}
[3881]static method switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3881]static method [3915] [4036] switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3923] return [3930] [3930] block {
[-1] [-1] core::int #t65;
[3938] [3938] final synthesized dynamic #0#0 = [3938] [3938] o;
@@ -682,7 +682,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t65;
}
[4039]static method switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4039]static method [4060] [4194] switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4075] #L44:
[4075] {
[4083] [4083] final synthesized core::Symbol #0#0 = [4083] [4083] s;
@@ -711,7 +711,7 @@ import "dart:core" as core;
}
}
}
[4197]static method switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4197]static method [4219] [4312] switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4234] return [4241] [4241] block {
[-1] [-1] core::int #t66;
[4249] [4249] final synthesized core::Symbol #0#0 = [4249] [4249] s;
@@ -7,61 +7,61 @@ import "dart:core" as core;
[229] enum-element static const field self::E b = [229] [229] const self::E::• [-1]([-1] 1, [-1] "b");
[232] enum-element static const field self::E c = [232] [232] const self::E::• [-1]([-1] 2, [-1] "c");
[222] static const field core::List<self::E> values = [-1] [-1] const <self::E>[[-1] self::E::a, [-1] self::E::b, [-1] self::E::c];
[222] const synthetic constructor •([222] core::int #index, [222] core::String #name) → self::E
[222] const synthetic constructor [222] [222] •([222] core::int #index, [222] core::String #name) → self::E
: [222] super core::_Enum::• [222]([-1] #index, [-1] #name)
[-1] ;
[222] method core::_enumToString() → core::String
[222] method [222] [222] core::_enumToString() → core::String
[-1] return [-1] [-1] "E.${[-1] [-1] [-1] [-1] this.{core::_Enum::_name}{core::String}}";
}
[243]class PrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[273] final field core::int field;
[289] const constructor •([310] core::int field) → self::PrimitiveEquals
[289] const constructor [304] [316] •([310] core::int field) → self::PrimitiveEquals
: [310] self::PrimitiveEquals::field = [310] [310] field, [289] super core::Object::• [289]()
[-1] ;
}
[327]class NonPrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[360] final field core::int field;
[376] const constructor •([400] core::int field) → self::NonPrimitiveEquals
[376] const constructor [394] [406] •([400] core::int field) → self::NonPrimitiveEquals
: [400] self::NonPrimitiveEquals::field = [400] [400] field, [376] super core::Object::• [376]()
[-1] ;
[419] get hashCode() → core::int
[419] get [428] [445] hashCode() → core::int
[-1] ;
[464] operator ==([474] core::Object other) → core::bool
[464] operator [466] [594] ==([474] core::Object other) → core::bool
[-1] ;
}
[599]static method switchStatement([615] dynamic o) → dynamic
[599]static method [614] [753] switchStatement([615] dynamic o) → dynamic
[-1] ;
[756]static method switchStatementWithLabel([781] dynamic o) → dynamic
[756]static method [780] [958] switchStatementWithLabel([781] dynamic o) → dynamic
[-1] ;
[961]static method switchStatementWithContinue([989] dynamic o) → dynamic
[961]static method [988] [1281] switchStatementWithContinue([989] dynamic o) → dynamic
[-1] ;
[1284]static method switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic
[1284]static method [1317] [2388] switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic
[-1] ;
[2391]static method switchStatementEnum([2413] self::E o) → dynamic
[2391]static method [2410] [2533] switchStatementEnum([2413] self::E o) → dynamic
[-1] ;
[2536]static method switchStatementEnumWithGuard([2567] self::E o) → dynamic
[2536]static method [2564] [2677] switchStatementEnumWithGuard([2567] self::E o) → dynamic
[-1] ;
[2680]static method switchStatementEnumWithLabel([2711] self::E o) → dynamic
[2680]static method [2708] [2842] switchStatementEnumWithLabel([2711] self::E o) → dynamic
[-1] ;
[2845]static method switchStatementEnumWithContinue([2879] self::E o) → dynamic
[2845]static method [2876] [3069] switchStatementEnumWithContinue([2879] self::E o) → dynamic
[-1] ;
[3072]static method switchStatementPrimitiveEquals([3103] dynamic o) → dynamic
[3072]static method [3102] [3233] switchStatementPrimitiveEquals([3103] dynamic o) → dynamic
[-1] ;
[3236]static method switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic
[3236]static method [3269] [3406] switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic
[-1] ;
[3409]static method switchExpression([3426] dynamic o) → dynamic
[3409]static method [3425] [3512] switchExpression([3426] dynamic o) → dynamic
[-1] ;
[3515]static method switchExpressionEnum([3538] self::E o) → dynamic
[3515]static method [3535] [3612] switchExpressionEnum([3538] self::E o) → dynamic
[-1] ;
[3615]static method switchExpressionEnumWithGuard([3647] self::E o) → dynamic
[3615]static method [3644] [3729] switchExpressionEnumWithGuard([3647] self::E o) → dynamic
[-1] ;
[3732]static method switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic
[3732]static method [3763] [3878] switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic
[-1] ;
[3881]static method switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic
[3881]static method [3915] [4036] switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic
[-1] ;
[4039]static method switchStatementSymbol([4068] core::Symbol s) → dynamic
[4039]static method [4060] [4194] switchStatementSymbol([4068] core::Symbol s) → dynamic
[-1] ;
[4197]static method switchExpressionSymbol([4227] core::Symbol s) → dynamic
[4197]static method [4219] [4312] switchExpressionSymbol([4227] core::Symbol s) → dynamic
[-1] ;
@@ -7,32 +7,32 @@ import "dart:core" as core;
[229] enum-element static const field self::E b = [229] [229] #C6;
[232] enum-element static const field self::E c = [232] [232] #C9;
[222] static const field core::List<self::E> values = [-1] [-1] #C10;
[222] const synthetic constructor •([222] core::int #index, [222] core::String #name) → self::E
[222] const synthetic constructor [222] [222] •([222] core::int #index, [222] core::String #name) → self::E
: [222] super core::_Enum::• [222]([-1] #index, [-1] #name)
[-1] ;
[222] method core::_enumToString() → core::String
[222] method [222] [222] core::_enumToString() → core::String
[-1] return [-1] [-1] "E.${[-1] [-1] [-1] [-1] this.{core::_Enum::_name}{core::String}}";
}
[243]class PrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[273] final field core::int field;
[289] const constructor •([310] core::int field) → self::PrimitiveEquals
[289] const constructor [304] [316] •([310] core::int field) → self::PrimitiveEquals
: [310] self::PrimitiveEquals::field = [310] [310] field, [289] super core::Object::• [289]()
[-1] ;
}
[327]class NonPrimitiveEquals extends core::Object /*hasConstConstructor*/ {
[360] final field core::int field;
[376] const constructor •([400] core::int field) → self::NonPrimitiveEquals
[376] const constructor [394] [406] •([400] core::int field) → self::NonPrimitiveEquals
: [400] self::NonPrimitiveEquals::field = [400] [400] field, [376] super core::Object::• [376]()
[-1] ;
[419] get hashCode() → core::int
[419] get [428] [445] hashCode() → core::int
[431] return [437] [437] [431] [431] [431] [431] this.{self::NonPrimitiveEquals::field}{core::int}.{core::num::hashCode}{core::int};
[464] operator ==([474] core::Object other) → core::bool {
[464] operator [466] [594] ==([474] core::Object other) → core::bool {
[487] if([491] [491] core::identical [500]([501] this, [507] other))
[515] return [522] [522] true;
[532] return [567] [567] [545] [545] [539] [539] other is self::NonPrimitiveEquals && [576] [576] [570] [570] [570] [570] this.{self::NonPrimitiveEquals::field}{core::int} =={core::num::==}{(core::Object) → core::bool} [585] [585] [579] [579] other{self::NonPrimitiveEquals}.{self::NonPrimitiveEquals::field}{core::int};
}
}
[599]static method switchStatement([615] dynamic o) → dynamic {
[599]static method [614] [753] switchStatement([615] dynamic o) → dynamic {
[622] #L1:
[622] {
[630] [630] final synthesized dynamic #0#0 = [630] [630] o;
@@ -64,7 +64,7 @@ import "dart:core" as core;
}
}
}
[756]static method switchStatementWithLabel([781] dynamic o) → dynamic {
[756]static method [780] [958] switchStatementWithLabel([781] dynamic o) → dynamic {
[788] #L2:
[788] {
[796] [796] final synthesized dynamic #0#0 = [796] [796] o;
@@ -104,7 +104,7 @@ import "dart:core" as core;
}
}
}
[961]static method switchStatementWithContinue([989] dynamic o) → dynamic {
[961]static method [988] [1281] switchStatementWithContinue([989] dynamic o) → dynamic {
[996] #L3:
[996] {
[996] [996] core::int #t21 = [996] [996] [996] [996] 1.{core::int::unary-}[996](){() → core::int};
@@ -180,7 +180,7 @@ import "dart:core" as core;
}
}
}
[1284]static method switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1284]static method [1317] [2388] switchStatementWithContinueNested([1318] dynamic o1, [1322] dynamic o2) → dynamic {
[1330] #L7:
[1330] {
[1330] [1330] core::int #t32 = [1330] [1330] [1330] [1330] 1.{core::int::unary-}[1330](){() → core::int};
@@ -402,7 +402,7 @@ import "dart:core" as core;
}
}
}
[2391]static method switchStatementEnum([2413] self::E o) → dynamic {
[2391]static method [2410] [2533] switchStatementEnum([2413] self::E o) → dynamic {
[2420] #L19:
[2420] switch([2428] [2428] o) /* isExplicitlyExhaustive, self::E */ {
[2437] #L20:
@@ -424,7 +424,7 @@ import "dart:core" as core;
}
}
}
[2536]static method switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2536]static method [2564] [2677] switchStatementEnumWithGuard([2567] self::E o) → dynamic {
[2574] #L23:
[2574] {
[2582] [2582] final synthesized self::E #0#0 = [2582] [2582] o;
@@ -452,7 +452,7 @@ import "dart:core" as core;
}
}
}
[2680]static method switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2680]static method [2708] [2842] switchStatementEnumWithLabel([2711] self::E o) → dynamic {
[2718] #L24:
[2718] switch([2726] [2726] o) /* isExplicitlyExhaustive, self::E */ {
[2735] #L25:
@@ -474,7 +474,7 @@ import "dart:core" as core;
}
}
}
[2845]static method switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2845]static method [2876] [3069] switchStatementEnumWithContinue([2879] self::E o) → dynamic {
[2886] #L28:
[2886] switch([2894] [2894] o) /* isExplicitlyExhaustive, self::E */ {
[2903] #L29:
@@ -496,7 +496,7 @@ import "dart:core" as core;
}
}
}
[3072]static method switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3072]static method [3102] [3233] switchStatementPrimitiveEquals([3103] dynamic o) → dynamic {
[3110] #L32:
[3110] switch([3118] [3118] o) /* dynamic */ {
[3127] #L33:
@@ -512,7 +512,7 @@ import "dart:core" as core;
}
}
}
[3236]static method switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3236]static method [3269] [3406] switchStatementNonPrimitiveEquals([3270] dynamic o) → dynamic {
[3277] #L35:
[3277] {
[3285] [3285] final synthesized dynamic #0#0 = [3285] [3285] o;
@@ -535,7 +535,7 @@ import "dart:core" as core;
}
}
}
[3409]static method switchExpression([3426] dynamic o) → dynamic {
[3409]static method [3425] [3512] switchExpression([3426] dynamic o) → dynamic {
[3433] return [3440] [3440] block {
[-1] [-1] dynamic #t59;
[3448] [3448] final synthesized dynamic #0#0 = [3448] [3448] o;
@@ -569,7 +569,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t59;
}
[3515]static method switchExpressionEnum([3538] self::E o) → dynamic {
[3515]static method [3535] [3612] switchExpressionEnum([3538] self::E o) → dynamic {
[3545] return [3552] [3552] block {
[-1] [-1] core::int #t62;
[3552] #L37:
@@ -595,7 +595,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t62;
}
[3615]static method switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3615]static method [3644] [3729] switchExpressionEnumWithGuard([3647] self::E o) → dynamic {
[3654] return [3661] [3661] block {
[-1] [-1] core::int #t63;
[3669] [3669] final synthesized self::E #0#0 = [3669] [3669] o;
@@ -624,7 +624,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t63;
}
[3732]static method switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3732]static method [3763] [3878] switchExpressionPrimitiveEquals([3764] dynamic o) → dynamic {
[3771] return [3778] [3778] block {
[-1] [-1] core::int #t64;
[3786] [3786] final synthesized dynamic #0#0 = [3786] [3786] o;
@@ -653,7 +653,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t64;
}
[3881]static method switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3881]static method [3915] [4036] switchExpressionNonPrimitiveEquals([3916] dynamic o) → dynamic {
[3923] return [3930] [3930] block {
[-1] [-1] core::int #t65;
[3938] [3938] final synthesized dynamic #0#0 = [3938] [3938] o;
@@ -682,7 +682,7 @@ import "dart:core" as core;
}
} =>[-1] [-1] #t65;
}
[4039]static method switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4039]static method [4060] [4194] switchStatementSymbol([4068] core::Symbol s) → dynamic {
[4075] #L44:
[4075] {
[4083] [4083] final synthesized core::Symbol #0#0 = [4083] [4083] s;
@@ -711,7 +711,7 @@ import "dart:core" as core;
}
}
}
[4197]static method switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4197]static method [4219] [4312] switchExpressionSymbol([4227] core::Symbol s) → dynamic {
[4234] return [4241] [4241] block {
[-1] [-1] core::int #t66;
[4249] [4249] final synthesized core::Symbol #0#0 = [4249] [4249] s;
+177 -91
View File
@@ -110,44 +110,54 @@ NameSystem globalDebuggingNames = new NameSystem();
String debugNodeToString(Node node) {
StringBuffer buffer = new StringBuffer();
new Printer(buffer, showOffsets: true, syntheticNames: globalDebuggingNames)
.writeNode(node);
new Printer(
buffer,
showOffsets: true,
syntheticNames: globalDebuggingNames,
).writeNode(node);
return '$buffer';
}
String debugLibraryToString(Library library) {
StringBuffer buffer = new StringBuffer();
new Printer(buffer, syntheticNames: globalDebuggingNames)
.writeLibraryFile(library);
new Printer(
buffer,
syntheticNames: globalDebuggingNames,
).writeLibraryFile(library);
return '$buffer';
}
String debugComponentToString(Component component) {
StringBuffer buffer = new StringBuffer();
new Printer(buffer, syntheticNames: new NameSystem())
.writeComponentFile(component);
new Printer(
buffer,
syntheticNames: new NameSystem(),
).writeComponentFile(component);
return '$buffer';
}
String componentToString(Component node) {
StringBuffer buffer = new StringBuffer();
new Printer(buffer, syntheticNames: new NameSystem())
.writeComponentFile(node);
new Printer(
buffer,
syntheticNames: new NameSystem(),
).writeComponentFile(node);
return '$buffer';
}
class NameSystem {
final Namer<Variable> variables =
new NormalNamer<Variable>('#t');
final Namer<Variable> variables = new NormalNamer<Variable>('#t');
final Namer<Reference> libraries = new NormalNamer<Reference>('#lib');
final Namer<TypeParameter> typeParameters =
new NormalNamer<TypeParameter>('#T');
final Namer<TypeParameter> typeParameters = new NormalNamer<TypeParameter>(
'#T',
);
final Namer<StructuralParameter> structuralParameters =
new NormalNamer<StructuralParameter>('#T');
final Namer<TreeNode> labels = new NormalNamer<TreeNode>('#L');
final Namer<Constant> constants = new ConstantNamer('#C');
final Namer<VariableContext> contexts =
new NormalNamer<VariableContext>('#ctx');
final Namer<VariableContext> contexts = new NormalNamer<VariableContext>(
'#ctx',
);
final Disambiguator<Reference, CanonicalName> prefixes =
new Disambiguator<Reference, CanonicalName>();
@@ -183,7 +193,9 @@ class NameSystem {
return abbreviateName(path);
} else {
return _nameFromLibraryCanonicalName(
reference, reference.canonicalName);
reference,
reference.canonicalName,
);
}
});
}
@@ -204,8 +216,11 @@ class NameSystem {
return 'L';
}
String nameCanonicalNameAsLibraryPrefix(Reference? node, CanonicalName? name,
{String? proposedName}) {
String nameCanonicalNameAsLibraryPrefix(
Reference? node,
CanonicalName? name, {
String? proposedName,
}) {
return prefixes.disambiguate(node, name, () {
if (proposedName != null) return proposedName;
return _nameFromLibraryCanonicalName(node, name);
@@ -251,25 +266,30 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
static final int SYMBOL = 2;
int state = SPACE;
Printer(this.sink,
{NameSystem? syntheticNames,
this.showOffsets = false,
this.showMetadata = false,
this.showLibraryForNames = false,
this.importTable,
this.annotator,
this.metadata})
: this.syntheticNames = syntheticNames ?? new NameSystem();
Printer(
this.sink, {
NameSystem? syntheticNames,
this.showOffsets = false,
this.showMetadata = false,
this.showLibraryForNames = false,
this.importTable,
this.annotator,
this.metadata,
}) : this.syntheticNames = syntheticNames ?? new NameSystem();
Printer createInner(ImportTable importTable,
Map<String, MetadataRepository<dynamic>>? metadata) {
return new Printer(sink,
importTable: importTable,
metadata: metadata,
syntheticNames: syntheticNames,
annotator: annotator,
showOffsets: showOffsets,
showMetadata: showMetadata);
Printer createInner(
ImportTable importTable,
Map<String, MetadataRepository<dynamic>>? metadata,
) {
return new Printer(
sink,
importTable: importTable,
metadata: metadata,
syntheticNames: syntheticNames,
annotator: annotator,
showOffsets: showOffsets,
showMetadata: showMetadata,
);
}
bool shouldHighlight(Node node) {
@@ -338,8 +358,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
String declarationName = getClassReference(enclosingDeclaration);
return '$declarationName::$name';
} else if (enclosingDeclaration is ExtensionTypeDeclaration) {
String declarationName =
getExtensionTypeDeclarationReference(enclosingDeclaration);
String declarationName = getExtensionTypeDeclarationReference(
enclosingDeclaration,
);
return '$declarationName::$name';
} else {
String library = getLibraryReference(node.enclosingLibrary.reference);
@@ -433,8 +454,11 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
LibraryImportTable imports = new LibraryImportTable(library);
Printer inner = createInner(imports, library.enclosingComponent?.metadata);
inner.writeStandardLibraryContent(library,
outerPrinter: this, importsToPrint: imports);
inner.writeStandardLibraryContent(
library,
outerPrinter: this,
importsToPrint: imports,
);
}
void writeProcedureInLibrary(Procedure procedure, Library library) {
@@ -447,8 +471,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
for (Library library in imports.importedLibraries) {
String importPath = imports.getImportPath(library);
if (importPath == "") {
String prefix = syntheticNames.nameLibraryPrefix(library.reference,
proposedName: 'self');
String prefix = syntheticNames.nameLibraryPrefix(
library.reference,
proposedName: 'self',
);
endLine('import self as $prefix;');
} else {
String prefix = syntheticNames.nameLibraryPrefix(library.reference);
@@ -457,12 +483,17 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
}
void writeStandardLibraryContent(Library library,
{Printer? outerPrinter, LibraryImportTable? importsToPrint}) {
void writeStandardLibraryContent(
Library library, {
Printer? outerPrinter,
LibraryImportTable? importsToPrint,
}) {
_currentLibrary = library;
outerPrinter ??= this;
outerPrinter.writeProblemsAsJson(
"Problems in library", library.problemsAsJson);
"Problems in library",
library.problemsAsJson,
);
if (importsToPrint != null) {
outerPrinter.printLibraryImportTable(importsToPrint);
@@ -642,8 +673,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeWord("[${node.fileOffset}]");
}
if (showMetadata && node is TreeNode && node is! VariableDeclaration) {
writeMetadata(node,
separateLines: node is Member || node is FunctionDeclaration);
writeMetadata(
node,
separateLines: node is Member || node is FunctionDeclaration,
);
}
node.accept(this);
@@ -748,8 +781,16 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
}
void writeFunction(FunctionNode function,
{name, List<Initializer>? initializers, bool terminateLine = true}) {
void writeFunction(
FunctionNode function, {
name,
List<Initializer>? initializers,
bool terminateLine = true,
}) {
if (showOffsets) {
writeWord("[${function.fileOffset}]");
writeWord("[${function.fileEndOffset}]");
}
if (name is String) {
writeWord(name);
} else if (name is Name) {
@@ -758,11 +799,16 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
assert(name == null);
}
writeTypeParameterList(function.typeParameters);
writeParameterList(function.positionalParameters, function.namedParameters,
function.requiredParameterCount);
writeParameterList(
function.positionalParameters,
function.namedParameters,
function.requiredParameterCount,
);
_writeContexts(function);
writeReturnType(
function.returnType, annotator?.annotateReturn(this, function));
function.returnType,
annotator?.annotateReturn(this, function),
);
if (initializers != null && initializers.isNotEmpty) {
endLine();
++indentation;
@@ -791,7 +837,8 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
redirectingFactoryTarget.target != null) {
writeWord('/* redirection-target:');
writeMemberReferenceFromReference(
redirectingFactoryTarget.targetReference);
redirectingFactoryTarget.targetReference,
);
if (redirectingFactoryTarget.typeArguments!.isNotEmpty) {
writeSymbol('<');
writeList(redirectingFactoryTarget.typeArguments!, writeType);
@@ -931,18 +978,25 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
state = WORD; // Ensure space if not followed by another symbol.
}
void writeParameterList(List<VariableDeclaration> positional,
List<VariableDeclaration> named, int requiredParameterCount) {
void writeParameterList(
List<VariableDeclaration> positional,
List<VariableDeclaration> named,
int requiredParameterCount,
) {
writeSymbol('(');
writeList(
positional.take(requiredParameterCount), writeVariableDeclaration);
positional.take(requiredParameterCount),
writeVariableDeclaration,
);
if (requiredParameterCount < positional.length) {
if (requiredParameterCount > 0) {
writeComma();
}
writeSymbol('[');
writeList(
positional.skip(requiredParameterCount), writeVariableDeclaration);
positional.skip(requiredParameterCount),
writeVariableDeclaration,
);
writeSymbol(']');
}
if (named.isNotEmpty) {
@@ -956,8 +1010,11 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeSymbol(')');
}
void writeList<T>(Iterable<T> nodes, void callback(T x),
{String separator = ','}) {
void writeList<T>(
Iterable<T> nodes,
void callback(T x), {
String separator = ',',
}) {
bool first = true;
for (T node in nodes) {
if (first) {
@@ -982,15 +1039,18 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
void writeExtensionTypeDeclarationReferenceFromReference(
Reference reference) {
Reference reference,
) {
writeWord(getExtensionTypeDeclarationReferenceFromReference(reference));
}
String getExtensionTypeDeclarationReferenceFromReference(
Reference reference) {
Reference reference,
) {
if (reference.node != null) {
return getExtensionTypeDeclarationReference(
reference.asExtensionTypeDeclaration);
reference.asExtensionTypeDeclaration,
);
}
if (reference.canonicalName != null) {
return getCanonicalNameString(reference.canonicalName!);
@@ -1020,7 +1080,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
return getLibraryReference(lib.reference);
}
return syntheticNames.nameCanonicalNameAsLibraryPrefix(
lib.reference, lib);
lib.reference,
lib,
);
}
String classString(CanonicalName cls) =>
@@ -1098,8 +1160,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
}
void writeAnnotationList(List<Expression> nodes,
{bool separateLines = true}) {
void writeAnnotationList(
List<Expression> nodes, {
bool separateLines = true,
}) {
for (Expression node in nodes) {
if (separateLines) {
writeIndentation();
@@ -1220,7 +1284,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
if (node.hasIsCovariantByDeclaration) {
writeModifier(
node.isCovariantByDeclaration, 'covariant-by-declaration');
node.isCovariantByDeclaration,
'covariant-by-declaration',
);
}
if (node.hasIsCovariantByClass) {
writeModifier(node.isCovariantByClass, 'covariant-by-class');
@@ -1233,7 +1299,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
if (node.hasIsSynthesized) {
writeModifier(
node.isSynthesized && node.cosmeticName != null, 'synthesized');
node.isSynthesized && node.cosmeticName != null,
'synthesized',
);
}
if (node.hasIsHoisted) {
writeModifier(node.isHoisted, 'hoisted');
@@ -1354,8 +1422,11 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
break;
case ProcedureStubKind.MemberSignature:
case ProcedureStubKind.AbstractMixinStub:
writeFunction(node.function,
name: getMemberName(node), terminateLine: false);
writeFunction(
node.function,
name: getMemberName(node),
terminateLine: false,
);
if (node.function.body is ReturnStatement) {
writeSymbol(';');
}
@@ -1382,8 +1453,11 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
if (features.isNotEmpty) {
writeWord("/*${features.join(',')}*/");
}
writeFunction(node.function,
name: node.name, initializers: node.initializers);
writeFunction(
node.function,
name: node.name,
initializers: node.initializers,
);
}
@override
@@ -1657,9 +1731,7 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
_writeDynamicAccessKind(node.kind);
if (!node.isImplicitCall) {
writeSymbol('.');
writeName(
node.name,
);
writeName(node.name);
}
writeNode(node.arguments);
}
@@ -1823,8 +1895,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
@override
void visitLogicalExpression(LogicalExpression node) {
int precedence = Precedence.binaryPrecedence[
logicalExpressionOperatorToString(node.operatorEnum)]!;
int precedence =
Precedence.binaryPrecedence[logicalExpressionOperatorToString(
node.operatorEnum,
)]!;
writeExpression(node.left, precedence);
writeSpaced(logicalExpressionOperatorToString(node.operatorEnum));
writeExpression(node.right, precedence + 1);
@@ -2381,9 +2455,11 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeSymbol('.${node.name}');
writeSymbol('{');
// TODO(johnniwinther): Should we store the result type in the node?
writeType(node.receiverType.named
.singleWhere((element) => element.name == node.name)
.type);
writeType(
node.receiverType.named
.singleWhere((element) => element.name == node.name)
.type,
);
writeSymbol('}');
}
@@ -2690,8 +2766,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeFunction(node.function, name: getVariableName(node.variable));
}
void writeVariableDeclaration(VariableDeclaration node,
{bool useVarKeyword = false}) {
void writeVariableDeclaration(
VariableDeclaration node, {
bool useVarKeyword = false,
}) {
if (node is FunctionParameter) {
writeExpressionVariable(node);
} else {
@@ -2709,7 +2787,8 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeModifier(node.isHoisted, 'hoisted');
writeModifier(node.isWildcard, 'wildcard');
writeModifier(node.isErroneouslyInitialized, 'erroneously-initialized');
bool hasImplicitInitializer = node.initializer is NullLiteral ||
bool hasImplicitInitializer =
node.initializer is NullLiteral ||
(node.initializer is ConstantExpression &&
(node.initializer as ConstantExpression).constant
is NullConstant);
@@ -2720,7 +2799,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
!hasImplicitInitializer &&
!node.hasDeclaredInitializer) {
writeModifier(
node.hasDeclaredInitializer, 'has-no-declared-initializer');
node.hasDeclaredInitializer,
'has-no-declared-initializer',
);
}
writeAnnotatedType(node.type, annotator?.annotateVariable(this, node));
writeWord(getVariableName(node));
@@ -2732,9 +2813,7 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
}
}
void writeVariableInitialization(
VariableInitialization node,
) {
void writeVariableInitialization(VariableInitialization node) {
if (node is VariableDeclaration) {
writeVariableDeclaration(node);
} else {
@@ -2742,7 +2821,8 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
if (showMetadata) writeMetadata(node);
writeAnnotationList(node.annotations, separateLines: false);
writeModifier(node.isErroneouslyInitialized, 'erroneously-initialized');
bool hasImplicitInitializer = node.initializer is NullLiteral ||
bool hasImplicitInitializer =
node.initializer is NullLiteral ||
(node.initializer is ConstantExpression &&
(node.initializer as ConstantExpression).constant
is NullConstant);
@@ -2753,7 +2833,9 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
!hasImplicitInitializer &&
!node.hasDeclaredInitializer) {
writeModifier(
node.hasDeclaredInitializer, 'has-no-declared-initializer');
node.hasDeclaredInitializer,
'has-no-declared-initializer',
);
}
writeWord(getVariableName(node.variable));
Expression? initializer = node.initializer;
@@ -2772,8 +2854,10 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
writeSymbol('>');
}
writeSymbol('(');
Iterable<TreeNode> allArgs =
<List<TreeNode>>[node.positional, node.named].expand((x) => x);
Iterable<TreeNode> allArgs = <List<TreeNode>>[
node.positional,
node.named,
].expand((x) => x);
writeList(allArgs, writeNode);
writeSymbol(')');
}
@@ -2905,7 +2989,8 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
@override
void visitExtensionType(ExtensionType node) {
writeExtensionTypeDeclarationReferenceFromReference(
node.extensionTypeDeclarationReference);
node.extensionTypeDeclarationReference,
);
if (node.typeArguments.isNotEmpty) {
writeSymbol('<');
writeList(node.typeArguments, writeType);
@@ -3278,7 +3363,8 @@ class Printer extends VisitorDefault<void> with VisitorVoidMixin {
@override
void visitRedirectingFactoryTearOffConstant(
RedirectingFactoryTearOffConstant node) {
RedirectingFactoryTearOffConstant node,
) {
writeIndentation();
writeConstantReference(node);
writeSpaced('=');