| OLD | NEW |
| 1 #!mojo mojo:js_content_handler | 1 #!mojo mojo:js_content_handler |
| 2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 // Simple JavaScript REPL example, using TerminalClient. | 6 // Simple JavaScript REPL example, using TerminalClient. |
| 7 // | 7 // |
| 8 // To run this, do something like: | 8 // To run this, do something like: |
| 9 // | 9 // |
| 10 // $ sky/tools/skydb start out/Debug mojo:moterm_example_app | 10 // $ sky/tools/mojodb start out/Debug mojo:moterm_example_app |
| 11 // | 11 // |
| 12 // At the moterm_example_app prompt: | 12 // At the moterm_example_app prompt: |
| 13 // | 13 // |
| 14 // :) file:///absolute/path/to/repl.js | 14 // :) file:///absolute/path/to/repl.js |
| 15 // | 15 // |
| 16 // Then, at the repl.js prompt, enter JavaScript, e.g.: | 16 // Then, at the repl.js prompt, enter JavaScript, e.g.: |
| 17 // | 17 // |
| 18 // > 1 + 2 | 18 // > 1 + 2 |
| 19 // 3 | 19 // 3 |
| 20 // > function f(x, y) { return x + y; } | 20 // > function f(x, y) { return x + y; } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 class ReplApp extends Application { | 102 class ReplApp extends Application { |
| 103 acceptConnection(initiatorURL, initiatorServiceExchange) { | 103 acceptConnection(initiatorURL, initiatorServiceExchange) { |
| 104 initiatorServiceExchange.provideService(TerminalClient, | 104 initiatorServiceExchange.provideService(TerminalClient, |
| 105 TerminalClientImpl); | 105 TerminalClientImpl); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 return ReplApp; | 109 return ReplApp; |
| 110 }); | 110 }); |
| OLD | NEW |