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

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

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. Created 8 years, 11 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 | « runtime/bin/builtin.cc ('k') | runtime/bin/builtin_impl_sources.gypi » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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:nativewrappers"); 6 #import("dart:nativewrappers");
7 #import("dart:coreimpl"); 7 #import("dart:coreimpl");
8 8
9 void print(arg) { 9 void print(arg) {
10 _Logger._printString(arg.toString()); 10 _Logger._printString(arg.toString());
11 } 11 }
12 12
13 void exit(int status) { 13 void exit(int status) {
14 if (status is !int) { 14 if (status is !int) {
15 throw new IllegalArgumentException("int status expected"); 15 throw new IllegalArgumentException("int status expected");
16 } 16 }
17 _exit(status); 17 _exit(status);
18 } 18 }
19 19
20 Socket _stdin;
21 InputStream get stdin() {
22 if (_stdin == null) {
23 _stdin = new _Socket._internalReadOnly();
24 _getStdioHandle(_stdin, 0);
25 }
26 return _stdin.inputStream;
27 }
28
29 Socket _stdout;
30 OutputStream get stdout() {
31 if (_stdout == null) {
32 _stdout = new _Socket._internalWriteOnly();
33 _getStdioHandle(_stdout, 1);
34 }
35 return _stdout.outputStream;
36 }
37
38 Socket _stderr;
39 OutputStream get stderr() {
40 if (_stderr == null) {
41 _stderr = new _Socket._internalWriteOnly();
42 _getStdioHandle(_stderr, 2);
43 }
44 return _stderr.outputStream;
45 }
46
47 _exit(int status) native "Exit"; 20 _exit(int status) native "Exit";
48 21
49 _getStdioHandle(Socket socket, int num) native "Socket_GetStdioHandle";
50
51 class _Logger { 22 class _Logger {
52 static void _printString(String s) native "Logger_PrintString"; 23 static void _printString(String s) native "Logger_PrintString";
53 } 24 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin.cc ('k') | runtime/bin/builtin_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698