| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 function native__Logger__printString(message) { | |
| 6 print(message + '\n'); | |
| 7 } | |
| 8 | |
| 9 function native_Fling__getArgs() { | |
| 10 return argv; | |
| 11 } | |
| 12 | |
| 13 | |
| 14 // Fling | |
| 15 function native_Fling_goForth() { | |
| 16 goForth(); | |
| 17 } | |
| 18 | |
| 19 function native_Fling_refresh() { | |
| 20 refresh(); | |
| 21 } | |
| 22 | |
| 23 function native_Fling_getInstallPath() { | |
| 24 return getInstallPath(); | |
| 25 } | |
| 26 | |
| 27 | |
| 28 // HttpServer | |
| 29 function native_HttpServer__init() { | |
| 30 this.$impl = new HttpServer(); | |
| 31 } | |
| 32 | |
| 33 function native_HttpServer_listen(port) { | |
| 34 this.$impl.listen(port); | |
| 35 } | |
| 36 | |
| 37 function native_HttpServer_handle(path, handler) { | |
| 38 this.$impl.handle(path, | |
| 39 function(req, rsp) { $dartcall(handler, [req, rsp]); }); | |
| 40 } | |
| 41 | |
| 42 // HttpResponse | |
| 43 function native_HttpResponse_finish() { | |
| 44 this.$impl.finish(); | |
| 45 } | |
| 46 | |
| 47 function native_HttpResponse_flush() { | |
| 48 this.$impl.flush(); | |
| 49 } | |
| 50 | |
| 51 function native_HttpResponse_setHeader(name, value) { | |
| 52 this.$impl.setHeader(name, value); | |
| 53 } | |
| 54 | |
| 55 function native_HttpResponse_setStatusCode(code) { | |
| 56 this.$impl.setStatusCode(code); | |
| 57 } | |
| 58 | |
| 59 function native_HttpResponse_write(data) { | |
| 60 this.$impl.write(data); | |
| 61 } | |
| 62 | |
| 63 // HttpRequest | |
| 64 function native_HttpRequest_get$body() { | |
| 65 return this.$impl.body; | |
| 66 } | |
| 67 | |
| 68 function native_HttpRequest_get$isKeepAlive() { | |
| 69 return this.$impl.isKeepAlive; | |
| 70 } | |
| 71 | |
| 72 function native_HttpRequest_get$method() { | |
| 73 return this.$impl.method; | |
| 74 } | |
| 75 | |
| 76 function native_HttpRequest_get$requestedPath() { | |
| 77 return this.$impl.requestedPath; | |
| 78 } | |
| 79 | |
| 80 function native_HttpRequest_get$version() { | |
| 81 return this.$impl.version; | |
| 82 } | |
| 83 | |
| 84 function native_HttpRequest_get$prefix() { | |
| 85 return this.$impl.prefix; | |
| 86 } | |
| 87 | |
| 88 // ClientApp | |
| 89 function native_ClientApp__init(path, apps) { | |
| 90 this.$impl = new ClientApp(path, apps); | |
| 91 } | |
| 92 | |
| 93 function native_ClientApp__handle(req, res) { | |
| 94 this.$impl.handler(req, res); | |
| 95 } | |
| OLD | NEW |