3abf78212c
Add dart2bytecode tool which takes Dart sources and produces Dart bytecode. The tool uses common front-end (CFE) to parse Dart source code and contains bytecode generator which translates kernel AST to bytecode. Change-Id: I90bd6e72c619cf0edc556da0640760b30e81091d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378560 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Slava Egorov <vegorov@google.com>
33 lines
703 B
Dart
33 lines
703 B
Dart
// Copyright (c) 2024, 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.
|
|
|
|
class A {
|
|
int? foo1;
|
|
int? foo2 = null;
|
|
int foo3 = 42;
|
|
int? foo4;
|
|
int foo5 = 43;
|
|
|
|
A(this.foo4) : foo5 = 44;
|
|
A.constr2(int x, int y)
|
|
: foo1 = x,
|
|
foo5 = y + 1;
|
|
|
|
A.redirecting1() : this(45);
|
|
A.redirecting2(int a, int b, int c) : this.constr2(a, b * c);
|
|
}
|
|
|
|
class B extends A {
|
|
int foo6 = 46;
|
|
static int foo7 = 47;
|
|
static const int foo8 = 48;
|
|
|
|
B() : super(49);
|
|
B.c2(int i, int j)
|
|
: foo6 = 50,
|
|
super.redirecting2(i, j, 51);
|
|
}
|
|
|
|
main() {}
|