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

Side by Side Diff: runtime/bin/builtin.dart

Issue 10879033: Move exit from the builtin library to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | runtime/bin/process.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library("builtin"); 5 #library("builtin");
6 #import("dart:uri"); 6 #import("dart:uri");
7 7
8 void print(arg) { 8 void print(arg) {
9 _Logger._printString(arg.toString()); 9 _Logger._printString(arg.toString());
10 } 10 }
11 11
12 void exit(int status) {
13 if (status is !int) {
14 throw new IllegalArgumentException("int status expected");
15 }
16 _exit(status);
17 }
18
19 _exit(int status) native "Exit";
20
21 class _Logger { 12 class _Logger {
22 static void _printString(String s) native "Logger_PrintString"; 13 static void _printString(String s) native "Logger_PrintString";
23 } 14 }
24 15
25 16
26 // The URI that the entrypoint script was loaded from. Remembered so that 17 // The URI that the entrypoint script was loaded from. Remembered so that
27 // package imports can be resolved relative to it. 18 // package imports can be resolved relative to it.
28 var _entrypoint; 19 var _entrypoint;
29 20
30 // The directory to look in to resolve "package:" scheme URIs. 21 // The directory to look in to resolve "package:" scheme URIs.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 var path; 147 var path;
157 if (_packageRoot !== null) { 148 if (_packageRoot !== null) {
158 path = "${_packageRoot}${uri.path}"; 149 path = "${_packageRoot}${uri.path}";
159 } else { 150 } else {
160 path = _entrypoint.resolve('packages/${uri.path}').path; 151 path = _entrypoint.resolve('packages/${uri.path}').path;
161 } 152 }
162 153
163 _logResolution("# Package: $path"); 154 _logResolution("# Package: $path");
164 return path; 155 return path;
165 } 156 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/mock.dart ('k') | runtime/bin/process.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698