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

Unified Diff: runtime/bin/builtin.dart

Issue 36883005: Add fields to platform library, implement them on runtime dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase on CL 32683002 Created 7 years, 2 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 | « no previous file | runtime/bin/dartutils.h » ('j') | sdk/lib/platform/platform.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 91702ab412621dfa77515676f8fc0b17cfd065dd..893f90a7fb8a2d5878d7f53546864591dcc7b16a 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -310,3 +310,59 @@ String _filePathFromHttpUri(Uri uri) {
_logResolution('# Path: $uri -> $uri');
return uri.toString();
}
+
+
+// platform library '_platform' implementation.
+_platform(int propertyIndex) {
+ const int kNumberOfProcessors = 1;
+ const int kPathSeparator = 2;
+ const int kOperatingSystem = 3;
+ const int kLocalHostname = 4;
+ const int kVersion = 5;
+ const int kEnvironment = 6;
+ const int kScript = 7;
+ const int kExecutable = 8;
+ const int kExecutableArguments = 9;
+ const int kPackageRoot = 10;
+ switch (propertyIndex) {
+ case kNumberOfProcessors:
+ return Platform.numberOfProcessors;
+ break;
+ case kPathSeparator:
+ return Platform.pathSeparator;
+ break;
+ case kOperatingSystem:
+ return Platform.operatingSystem;
+ break;
+ case kLocalHostname:
+ return Platform.localHostname;
+ break;
+ case kVersion:
+ return Platform.version;
+ break;
+ case kEnvironment:
+ return Platform.environment;
+ break;
+ case kScript:
+ return Platform.script;
+ break;
+ case kExecutable:
+ return Platform.executable;
+ break;
+ case kExecutableArguments:
+ return Platform.executableArguments;
+ break;
+ case kPackageRoot:
+ return Platform.packageRoot;
+ break;
+ default:
+ throw new UnimplementedError(
+ "Unknown property $propertyIndex of platform");
+ break;
+ }
+}
+
+_getPlatform() => _platform;
+
+
+
« no previous file with comments | « no previous file | runtime/bin/dartutils.h » ('j') | sdk/lib/platform/platform.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698