| OLD | NEW |
| 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 // This is a copy of the VM's dart:io library. This API is not usable | 5 // This is a copy of the VM's dart:io library. This API is not usable |
| 6 // when running inside a web browser. Nevertheless, Leg provides a | 6 // when running inside a web browser. Nevertheless, Leg provides a |
| 7 // mock version of the dart:io library so that it can statically | 7 // mock version of the dart:io library so that it can statically |
| 8 // analyze programs that use dart:io. | 8 // analyze programs that use dart:io. |
| 9 | 9 |
| 10 // TODO(ahe): Separate API from implementation details. | 10 // TODO(ahe): Separate API from implementation details. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class _Platform implements Platform { | 61 class _Platform implements Platform { |
| 62 factory Platform() { | 62 factory Platform() { |
| 63 throw new UnsupportedOperationException('new Platform()'); | 63 throw new UnsupportedOperationException('new Platform()'); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 class _Directory implements Directory { | 67 class _Directory implements Directory { |
| 68 factory Directory(arg) { | 68 factory Directory(arg) { |
| 69 throw new UnsupportedOperationException('new Directory($arg)'); | 69 throw new UnsupportedOperationException('new Directory($arg)'); |
| 70 } | 70 } |
| 71 |
| 72 factory Directory.current() { |
| 73 throw new UnsupportedOperationException('new Directory.current()'); |
| 74 } |
| 71 } | 75 } |
| 72 | 76 |
| 73 class _Process implements Process { | 77 class _Process implements Process { |
| 74 factory Process.start(String executable, | 78 factory Process.start(String executable, |
| 75 List<String> arguments, | 79 List<String> arguments, |
| 76 [String workingDirectory]) { | 80 [String workingDirectory]) { |
| 77 var msg = 'new Process.start($executable, $arguments, $workingDirectory'; | 81 var msg = 'new Process.start($executable, $arguments, $workingDirectory'; |
| 78 throw new UnsupportedOperationException(msg); | 82 throw new UnsupportedOperationException(msg); |
| 79 } | 83 } |
| 80 } | 84 } |
| 81 | 85 |
| 82 class _ServerSocket implements ServerSocket { | 86 class _ServerSocket implements ServerSocket { |
| 83 factory _ServerSocket(String bindAddress, int port, int backlog) { | 87 factory _ServerSocket(String bindAddress, int port, int backlog) { |
| 84 throw new UnsupportedOperationException( | 88 throw new UnsupportedOperationException( |
| 85 'new ServerSocket($bindAddress, $port, $backlog)'); | 89 'new ServerSocket($bindAddress, $port, $backlog)'); |
| 86 } | 90 } |
| 87 } | 91 } |
| 88 | 92 |
| 89 class _Socket implements Socket { | 93 class _Socket implements Socket { |
| 90 factory Socket(String host, int port) { | 94 factory Socket(String host, int port) { |
| 91 throw new UnsupportedOperationException('new Socket($host, $int)'); | 95 throw new UnsupportedOperationException('new Socket($host, $port)'); |
| 92 } | 96 } |
| 93 } | 97 } |
| 94 | 98 |
| 95 class _EventHandler { | 99 class _EventHandler { |
| 96 factory _EventHandler() { | 100 factory _EventHandler() { |
| 97 throw new UnsupportedOperationException('new _EventHandler()'); | 101 throw new UnsupportedOperationException('new _EventHandler()'); |
| 98 } | 102 } |
| 99 | 103 |
| 100 static void _start() { | 104 static void _start() { |
| 101 throw new UnsupportedOperationException('_EventHandler._start()'); | 105 throw new UnsupportedOperationException('_EventHandler._start()'); |
| 102 } | 106 } |
| 103 | 107 |
| 104 static _sendData(int id, ReceivePort receivePort, int data) { | 108 static _sendData(int id, ReceivePort receivePort, int data) { |
| 105 var msg = '_EventHandler._sendData($id, $receivePort, $data)'; | 109 var msg = '_EventHandler._sendData($id, $receivePort, $data)'; |
| 106 throw new UnsupportedOperationException(msg); | 110 throw new UnsupportedOperationException(msg); |
| 107 } | 111 } |
| 108 | 112 |
| 109 static _EventHandler get _eventHandler() { | 113 static _EventHandler get _eventHandler() { |
| 110 throw new UnsupportedOperationException('_EventHandler._eventhandler'); | 114 throw new UnsupportedOperationException('_EventHandler._eventhandler'); |
| 111 } | 115 } |
| 112 | 116 |
| 113 static void set _eventHandler(_EventHandler e) { | 117 static void set _eventHandler(_EventHandler e) { |
| 114 throw new UnsupportedOperationException('_EventHandler._eventhandler = $e'); | 118 throw new UnsupportedOperationException('_EventHandler._eventhandler = $e'); |
| 115 } | 119 } |
| 116 } | 120 } |
| OLD | NEW |