| 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;
|
| +
|
| +
|
| +
|
|
|