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

Side by Side Diff: frog/lib/node/repl.dart

Issue 9034014: Add support for the node net module. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: new version of minfrog 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
OLDNEW
(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 #library('repl');
6 #import('node.dart');
7
8 typedef void ReplEvalCallback(var ignore, var result);
9 typedef void ReplEvalFunction(String cmd, ReplEvalCallback callback);
10
11 class repl native "require('repl')" {
12 static REPLServer start([String prompt, ReadWriteStream stream,
13 ReplEvalFunction evalFn, bool useGlobal, bool ignoreUndefined]) native;
14 static REPLServer startStdio([String prompt, ReplEvalFunction evalFn,
15 bool useGlobal, bool ignoreUndefined])
16 native "return this.start(prompt, evalFn, useGlobal, ignoreUndefined);";
17 static bool disableColors;
18 }
19
20 class REPLServer native 'repl.REPLServer'{
21 REPLServerMap get context() => new REPLServerMap(this);
22 }
23
24 class REPLServerMap {
25 REPLServer _server;
26 const REPLServerMap(this._server);
27 void operator[]=(String key, var value) native
28 "this._server.context[key] = value;";
29 var operator[](String key) native "return this._server.context[key];";
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698