[kernel] Support external procedures without @ExternalName in treeshaker/findNativeName

Dart allows 'external' functions which are not connected to their body.
Calling such functions produces runtime error, but they should be accepted
at compile time. Test language_2/external_test verifies this behavior.

This CL fixes treeshaker/findNativeName to return 'null' instead of throwing
an error for 'external' functions without @ExternalName annotation (which
is used to specify native name).

Change-Id: I04ec892af29ffe064ece8fddd6f67c7acdca1139
Reviewed-on: https://dart-review.googlesource.com/37122
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov 2018-01-31 19:52:25 +00:00 committed by commit-bot@chromium.org
parent 4cad8c202d
commit 450765c64e

View file

@ -1251,7 +1251,6 @@ String findNativeName(Member procedure) {
}
}
}
throw 'External procedure has no @ExternalName("...") annotation!';
}
return null;
}