| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.constants.expressions; | 5 library dart2js.constants.expressions; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../core_types.dart'; | 9 import '../core_types.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 | 1254 |
| 1255 accept(ConstantExpressionVisitor visitor, [context]) { | 1255 accept(ConstantExpressionVisitor visitor, [context]) { |
| 1256 return visitor.visitBoolFromEnvironment(this, context); | 1256 return visitor.visitBoolFromEnvironment(this, context); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 @override | 1259 @override |
| 1260 void _createStructuredText(StringBuffer sb) { | 1260 void _createStructuredText(StringBuffer sb) { |
| 1261 sb.write('bool.fromEnvironment(name='); | 1261 sb.write('bool.fromEnvironment(name='); |
| 1262 name._createStructuredText(sb); | 1262 name._createStructuredText(sb); |
| 1263 sb.write(',defaultValue='); | 1263 sb.write(',defaultValue='); |
| 1264 defaultValue._createStructuredText(sb); | 1264 if (defaultValue != null) { |
| 1265 defaultValue._createStructuredText(sb); |
| 1266 } else { |
| 1267 sb.write('null'); |
| 1268 } |
| 1265 sb.write(')'); | 1269 sb.write(')'); |
| 1266 } | 1270 } |
| 1267 | 1271 |
| 1268 @override | 1272 @override |
| 1269 ConstantValue evaluate( | 1273 ConstantValue evaluate( |
| 1270 Environment environment, ConstantSystem constantSystem) { | 1274 Environment environment, ConstantSystem constantSystem) { |
| 1271 ConstantValue nameConstantValue = | 1275 ConstantValue nameConstantValue = |
| 1272 name.evaluate(environment, constantSystem); | 1276 name.evaluate(environment, constantSystem); |
| 1273 ConstantValue defaultConstantValue; | 1277 ConstantValue defaultConstantValue; |
| 1274 if (defaultValue != null) { | 1278 if (defaultValue != null) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 | 1317 |
| 1314 accept(ConstantExpressionVisitor visitor, [context]) { | 1318 accept(ConstantExpressionVisitor visitor, [context]) { |
| 1315 return visitor.visitIntFromEnvironment(this, context); | 1319 return visitor.visitIntFromEnvironment(this, context); |
| 1316 } | 1320 } |
| 1317 | 1321 |
| 1318 @override | 1322 @override |
| 1319 void _createStructuredText(StringBuffer sb) { | 1323 void _createStructuredText(StringBuffer sb) { |
| 1320 sb.write('int.fromEnvironment(name='); | 1324 sb.write('int.fromEnvironment(name='); |
| 1321 name._createStructuredText(sb); | 1325 name._createStructuredText(sb); |
| 1322 sb.write(',defaultValue='); | 1326 sb.write(',defaultValue='); |
| 1323 defaultValue._createStructuredText(sb); | 1327 if (defaultValue != null) { |
| 1328 defaultValue._createStructuredText(sb); |
| 1329 } else { |
| 1330 sb.write('null'); |
| 1331 } |
| 1324 sb.write(')'); | 1332 sb.write(')'); |
| 1325 } | 1333 } |
| 1326 | 1334 |
| 1327 @override | 1335 @override |
| 1328 ConstantValue evaluate( | 1336 ConstantValue evaluate( |
| 1329 Environment environment, ConstantSystem constantSystem) { | 1337 Environment environment, ConstantSystem constantSystem) { |
| 1330 ConstantValue nameConstantValue = | 1338 ConstantValue nameConstantValue = |
| 1331 name.evaluate(environment, constantSystem); | 1339 name.evaluate(environment, constantSystem); |
| 1332 ConstantValue defaultConstantValue; | 1340 ConstantValue defaultConstantValue; |
| 1333 if (defaultValue != null) { | 1341 if (defaultValue != null) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 | 1382 |
| 1375 accept(ConstantExpressionVisitor visitor, [context]) { | 1383 accept(ConstantExpressionVisitor visitor, [context]) { |
| 1376 return visitor.visitStringFromEnvironment(this, context); | 1384 return visitor.visitStringFromEnvironment(this, context); |
| 1377 } | 1385 } |
| 1378 | 1386 |
| 1379 @override | 1387 @override |
| 1380 void _createStructuredText(StringBuffer sb) { | 1388 void _createStructuredText(StringBuffer sb) { |
| 1381 sb.write('String.fromEnvironment(name='); | 1389 sb.write('String.fromEnvironment(name='); |
| 1382 name._createStructuredText(sb); | 1390 name._createStructuredText(sb); |
| 1383 sb.write(',defaultValue='); | 1391 sb.write(',defaultValue='); |
| 1384 defaultValue._createStructuredText(sb); | 1392 if (defaultValue != null) { |
| 1393 defaultValue._createStructuredText(sb); |
| 1394 } else { |
| 1395 sb.write('null'); |
| 1396 } |
| 1385 sb.write(')'); | 1397 sb.write(')'); |
| 1386 } | 1398 } |
| 1387 | 1399 |
| 1388 @override | 1400 @override |
| 1389 ConstantValue evaluate( | 1401 ConstantValue evaluate( |
| 1390 Environment environment, ConstantSystem constantSystem) { | 1402 Environment environment, ConstantSystem constantSystem) { |
| 1391 ConstantValue nameConstantValue = | 1403 ConstantValue nameConstantValue = |
| 1392 name.evaluate(environment, constantSystem); | 1404 name.evaluate(environment, constantSystem); |
| 1393 ConstantValue defaultConstantValue; | 1405 ConstantValue defaultConstantValue; |
| 1394 if (defaultValue != null) { | 1406 if (defaultValue != null) { |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 visit(exp.name); | 1772 visit(exp.name); |
| 1761 if (exp.defaultValue != null) { | 1773 if (exp.defaultValue != null) { |
| 1762 sb.write(', defaultValue: '); | 1774 sb.write(', defaultValue: '); |
| 1763 visit(exp.defaultValue); | 1775 visit(exp.defaultValue); |
| 1764 } | 1776 } |
| 1765 sb.write(')'); | 1777 sb.write(')'); |
| 1766 } | 1778 } |
| 1767 | 1779 |
| 1768 String toString() => sb.toString(); | 1780 String toString() => sb.toString(); |
| 1769 } | 1781 } |
| OLD | NEW |