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

Unified Diff: runtime/bin/platform.cc

Issue 1507943002: Add ./tools/test.py -c precompiler -r dart_precompiled. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/main.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform.cc
diff --git a/runtime/bin/platform.cc b/runtime/bin/platform.cc
index ec75ee97cb3d9e0e11216b62d0acb6f92dd539eb..f2f16befee58e56ea0bb3cd8ad3397c553958efb 100644
--- a/runtime/bin/platform.cc
+++ b/runtime/bin/platform.cc
@@ -45,12 +45,28 @@ void FUNCTION_NAME(Platform_LocalHostname)(Dart_NativeArguments args) {
void FUNCTION_NAME(Platform_ExecutableName)(Dart_NativeArguments args) {
ASSERT(Platform::GetExecutableName() != NULL);
+ if (Dart_IsRunningPrecompiledCode()) {
+ // This is a work-around to be able to use most of the existing test suite
+ // for precompilation. Many tests do something like Process.run(
+ // Platform.executable, some_other_script.dart). But with precompilation
+ // the script is already fixed, so the spawned process runs the same script
+ // again and we have a fork-bomb.
+ Dart_ThrowException(Dart_NewStringFromCString(
+ "Platform.executable not supported under precompilation"));
+ UNREACHABLE();
+ }
Dart_SetReturnValue(
args, Dart_NewStringFromCString(Platform::GetExecutableName()));
}
void FUNCTION_NAME(Platform_ResolvedExecutableName)(Dart_NativeArguments args) {
+ if (Dart_IsRunningPrecompiledCode()) {
+ Dart_ThrowException(Dart_NewStringFromCString(
+ "Platform.resolvedExecutable not supported under precompilation"));
+ UNREACHABLE();
+ }
+
if (Platform::GetResolvedExecutableName() != NULL) {
Dart_SetReturnValue(
args, Dart_NewStringFromCString(Platform::GetResolvedExecutableName()));
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698