f9eb40cc79
This change actually migrates vm/dart/* tests to NNBD by fixing compile-time errors and adjusting tests where needed. vm/dart/null_float32x4_simd_ops_test and vm/dart/null_float64x2_simd_ops_test are deleted as they are superseded by static type checks. vm/dart/regress_40462_test.dart is a huge source code auto-generated by fuzzer and migrating and maintaining this source doesn't have much value, so it is deleted. There are still failures in strong mode due to dependencies on the packages which are not migrated yet (https://github.com/dart-lang/sdk/issues/42146). Migrated vm/dart/null_checks_with_dwarf_stack_traces_test fails both in weak and strong mode due to https://github.com/dart-lang/sdk/issues/42149. Issue: https://github.com/dart-lang/sdk/issues/41314 Change-Id: I5561f1c8705ec16def0c4e0efa495d15f4ea7259 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149493 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Régis Crelier <regis@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
32 lines
867 B
Dart
32 lines
867 B
Dart
// Copyright (c) 2013, 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.
|
|
// Test that the full stacktrace in an error object matches the stacktrace
|
|
// handed to the catch clause.
|
|
library test.error_stacktrace;
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class C {
|
|
// operator*(o) is missing to trigger a noSuchMethodError when a C object
|
|
// is used in the multiplication below.
|
|
}
|
|
|
|
bar(c) => c * 4;
|
|
foo(c) => bar(c);
|
|
|
|
main() {
|
|
try {
|
|
var a = foo(new C());
|
|
} catch (e, s) {
|
|
print(e);
|
|
print("###");
|
|
print((e as dynamic).stackTrace);
|
|
print("###");
|
|
print(s);
|
|
print("###");
|
|
Expect.isTrue(e is NoSuchMethodError);
|
|
Expect.stringEquals((e as dynamic).stackTrace.toString(), s.toString());
|
|
}
|
|
}
|