[vm] Fix link to learn more about missing main function

The previous link no longer lead to a relevant destination. While I can add a client-side redirect on dart.dev, this CL updates the link to a redirect we can better guarantee as up to date in the long term.

TEST=vm/cc/DartAPI_RootLibraryMissingMain

Change-Id: I1e9dbf7a32c1468c308e9cf00d96575ba3c24695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373322
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Parker Lougheed
2024-06-26 19:58:11 +00:00
committed by Commit Queue
parent d06fb0c54e
commit 8e4c2d6cee
2 changed files with 14 additions and 2 deletions
+1 -2
View File
@@ -5440,8 +5440,7 @@ DART_EXPORT Dart_Handle Dart_LoadScriptFromKernel(const uint8_t* buffer,
if (tmp.IsNull()) {
return Api::NewError(
"Invoked Dart programs must have a 'main' function defined:\n"
"https://dart.dev/guides/language/"
"language-tour#a-basic-dart-program");
"https://dart.dev/to/main-function");
}
library ^= tmp.ptr();
IG->object_store()->set_root_library(library);
+13
View File
@@ -7488,6 +7488,19 @@ TEST_CASE(DartAPI_RootLibrary) {
EXPECT(Dart_IsNull(root_lib)); // Root library did change.
}
TEST_CASE(DartAPI_RootLibraryMissingMain) {
const char* kScriptChars =
"notMain() {"
" return 12345;"
"}";
Dart_Handle result = LoadScript(TestCase::url(), kScriptChars);
EXPECT_ERROR(result,
"Invoked Dart programs must have a 'main' function defined:\n"
"https://dart.dev/to/main-function");
}
TEST_CASE(DartAPI_LookupLibrary) {
const char* kScriptChars =
"import 'library1_dart';"