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

Unified Diff: lib/src/options.dart

Issue 1022923005: bind to localhost instead of all interfaces, and fix closureWrap (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/options.dart
diff --git a/lib/src/options.dart b/lib/src/options.dart
index 81258b8efd2b8f00d9d113a7bb0b10114ff468d6..8f42559b7ca71fda09d7600e9d42eef59ae8edfa 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -147,6 +147,9 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
/// Port used for the HTTP server when [serverMode] is on.
final int port;
+ /// Host name or address for HTTP server when [serverMode] is on.
+ final String host;
+
/// Whether to use covariant generics
@override
final bool covariantGenerics;
@@ -212,7 +215,8 @@ class CompilerOptions implements RulesOptions, ResolverOptions, JSCodeOptions {
this.nonnullableTypes: TypeOptions.NONNULLABLE_TYPES, this.help: false,
this.useMockSdk: false, this.dartSdkPath, this.logLevel: Level.SEVERE,
this.emitSourceMaps: true, this.entryPointFile: null,
- this.serverMode: false, this.port: 8080, this.runtimeDir});
+ this.serverMode: false, this.host: 'localhost', this.port: 8080,
+ this.runtimeDir});
}
/// Parses options from the command-line
@@ -271,6 +275,7 @@ CompilerOptions parseOptions(List<String> argv) {
emitSourceMaps: args['source-maps'],
entryPointFile: args.rest.length == 0 ? null : args.rest.first,
serverMode: serverMode,
+ host: args['host'],
port: int.parse(args['port']),
runtimeDir: runtimeDir);
}
@@ -294,7 +299,7 @@ final ArgParser argParser = new ArgParser()
help: 'Comma separated string of non-nullable types',
defaultsTo: null)
..addFlag('infer-from-overrides',
- help: 'Infer unspecified types of fields and return types from '
+ help: 'Infer unspecified types of fields and return types from\n'
'definitions in supertypes',
defaultsTo: ResolverOptions.inferFromOverridesDefault)
..addFlag('infer-transitively',
@@ -319,8 +324,9 @@ final ArgParser argParser = new ArgParser()
..addFlag('use-multi-package',
help: 'Whether to use the multi-package resolver for "package:" imports',
defaultsTo: false)
- ..addOption('package-paths', help: 'if using the multi-package resolver, '
- 'the list of directories where to look for packages.', defaultsTo: '')
+ ..addOption('package-paths',
+ help: 'if using the multi-package resolver, the list of directories to\n'
+ 'look for packages in.', defaultsTo: '')
..addFlag('source-maps',
help: 'Whether to emit source map files', defaultsTo: true)
..addOption('runtime-dir',
@@ -329,8 +335,12 @@ final ArgParser argParser = new ArgParser()
// general options
..addFlag('help', abbr: 'h', help: 'Display this message')
..addFlag('server', help: 'Run as a development server.', defaultsTo: false)
+ ..addOption('host',
+ help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n'
+ 'to listen on all interfaces (used only when --serve is on)',
+ defaultsTo: 'localhost')
..addOption('port',
- help: 'Port where to serve files from (used only when --serve is on)',
+ help: 'Port to serve files from (used only when --serve is on)',
defaultsTo: '8080')
..addFlag('force-compile',
help: 'Compile code with static errors', defaultsTo: false)
« no previous file with comments | « lib/runtime/dart_runtime.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698