Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Unified Diff: runtime/bin/builtin_natives.cc

Issue 1916793003: - Allow for loading dart:html and friends into the standalone (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/builtin_nolib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin_natives.cc
diff --git a/runtime/bin/builtin_natives.cc b/runtime/bin/builtin_natives.cc
index 96280df35da2e5d4ed42bc5609da48581b70649d..dc6ee178879cd38966a7fc3896d3fe475c11a71e 100644
--- a/runtime/bin/builtin_natives.cc
+++ b/runtime/bin/builtin_natives.cc
@@ -44,6 +44,12 @@ static struct NativeEntries {
};
+void Builtin_DummyNative(Dart_NativeArguments args) {
+ UNREACHABLE();
+}
+
+
+
/**
* Looks up native functions in both libdart_builtin and libdart_io.
*/
@@ -51,8 +57,8 @@ Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
int argument_count,
bool* auto_setup_scope) {
const char* function_name = NULL;
- Dart_Handle result = Dart_StringToCString(name, &function_name);
- DART_CHECK_VALID(result);
+ Dart_Handle err = Dart_StringToCString(name, &function_name);
+ DART_CHECK_VALID(err);
ASSERT(function_name != NULL);
ASSERT(auto_setup_scope != NULL);
*auto_setup_scope = true;
@@ -64,7 +70,12 @@ Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
return reinterpret_cast<Dart_NativeFunction>(entry->function_);
}
}
- return IONativeLookup(name, argument_count, auto_setup_scope);
+ Dart_NativeFunction result =
+ IONativeLookup(name, argument_count, auto_setup_scope);
+ if (result == NULL) {
+ result = Builtin_DummyNative;
+ }
+ return result;
}
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/bin/builtin_nolib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698