dart-sdk/tests
Daco Harkes f21b7cafbc [vm/ffi] Adds param number in trampoline null error
Before: `NoSuchMethodError: The method 'FfiTrampoline' was called on
null.`
After: `Invalid argument(s): argument value for ':ffi_param2' is null`.

Makes the ArgumentNullError RTE lookup the name of the argument in the
code source map when reporting a null argument.

Makes the FFI call arguments and FFI callbacks use kArgumentError
instead of the default kNoSuchMethod so that we target this RTE instead.

This changes the Error type from `NoSuchMethodError` to `ArgumentError`.
Because `Error`s should not be caught [1], this is fine.

Since FFI trampolines are created from type arguments, the arguments do
not have names. The arguments are assigned names programmatically. See
the related bug.

Also, this CL cleans up the SourcePosition of the `CheckNullOptimized`,
it was never passed.

[1] https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-catch-error-or-types-that-implement-it

TEST=tests/ffi/function_test.dart

Closes: https://github.com/dart-lang/sdk/issues/47094
Bug: https://github.com/dart-lang/sdk/issues/36780

Change-Id: I15e7de4d026e034bde0eda3ba7fe3785f0da5057
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212462
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-09-04 07:22:03 +00:00
..
co19 [co19] LibTests/typed_data tests skipped for dart2js 2021-08-16 08:07:34 +00:00
co19_2 [co19] LibTests/typed_data tests skipped for dart2js 2021-08-16 08:07:34 +00:00
corelib Tweaks, refactoring and updates on DoubleLinkedQueue. 2021-08-31 12:44:39 +00:00
corelib_2 Tweaks, refactoring and updates on DoubleLinkedQueue. 2021-08-31 12:44:39 +00:00
dartdevc [ddc] Unify pkg:js types and allow subtyping between them 2021-07-30 00:33:54 +00:00
dartdevc_2 [ddc] Unify pkg:js types and allow subtyping between them 2021-07-30 00:33:54 +00:00
ffi [vm/ffi] Adds param number in trampoline null error 2021-09-04 07:22:03 +00:00
ffi_2 [vm/ffi] Adds param number in trampoline null error 2021-09-04 07:22:03 +00:00
language Add test for parsing explicit instantiations. 2021-09-03 09:54:49 +00:00
language_2 analyzer: Allow explicit type instantiation of function-typed expressions 2021-09-01 00:03:56 +00:00
lib [vm/gardening] Fix static_function_test to accommodate closure passing. 2021-09-03 22:44:28 +00:00
lib_2 [vm/gardening] Fix static_function_test to accommodate closure passing. 2021-09-03 22:44:28 +00:00
modular
standalone [vm] Remove support for dart-ext: imports 2021-09-02 14:14:35 +00:00
standalone_2 [vm] Remove support for dart-ext: imports 2021-09-02 14:14:35 +00:00
web [dart2js, js_runtime, js_dev_runtime] NaN-safe range checks. 2021-08-27 00:37:56 +00:00
web_2 Remove obsolete internal dart2js annotations 2021-08-04 23:27:18 +00:00
legacy_status_dart2js.csv
README.md

This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.