Files
sdk/pkg/vm_service/java/example/sample_exception.dart
T
Ben Konyi dbeceb1d06 [ VM / Service ] Pulled in vm_service_drivers from its own repo.
- Updated various paths to point to the sdk repo instead of the
  vm_service_drivers repo.
- Updated generate.dart to use the service.md from the SDK, not a copy.
- Removed hidden files that are no longer needed.

Change-Id: I11b1f2e32d55f1fdaaa6eb9ce34fc318716c36f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109120
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-07-22 20:06:29 +00:00

54 lines
999 B
Dart

// Copyright (c) 2015, 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.
void main(List<String> args) {
// Hijinks to remove an analysis warning.
dynamic local1;
if (true) local1 = 'abcd';
int local2 = 2;
var longList = [1, "hello", 3, 5, 7, 11, 13, 14, 15, 16, 17, 18, 19, 20];
var deepList = [
new Bar(),
[
[
[
[
[7]
]
],
"end"
]
]
];
print('hello from main');
// throw a caught exception
try {
foo(local1.baz());
} catch (e) {
print('-----------------');
print('caught $e');
print('-----------------');
}
foo(local2);
print(longList);
print(deepList);
print('exiting...');
}
void foo(int val) {
print('val: ${val}');
}
class Bar extends FooBar {
String field1 = "my string";
}
class FooBar {
int field2 = 47;
}