OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.resolution.members; | 5 library dart2js.resolution.members; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart' show Selectors; | 8 import '../common/names.dart' show Selectors; |
9 import '../common/resolution.dart' show Resolution; | 9 import '../common/resolution.dart' show Resolution; |
10 import '../compile_time_constants.dart'; | 10 import '../compile_time_constants.dart'; |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 resolver.constantCompiler.compileConstant(parameter); | 457 resolver.constantCompiler.compileConstant(parameter); |
458 }); | 458 }); |
459 }); | 459 }); |
460 registry.registerCheckedModeCheck(functionSignature.returnType); | 460 registry.registerCheckedModeCheck(functionSignature.returnType); |
461 functionSignature.forEachParameter((ParameterElement element) { | 461 functionSignature.forEachParameter((ParameterElement element) { |
462 registry.registerCheckedModeCheck(element.type); | 462 registry.registerCheckedModeCheck(element.type); |
463 }); | 463 }); |
464 } | 464 } |
465 | 465 |
466 ResolutionResult visitAssert(Assert node) { | 466 ResolutionResult visitAssert(Assert node) { |
467 if (!options.enableAssertMessage) { | |
468 if (node.hasMessage) { | |
469 reporter.reportErrorMessage( | |
470 node, MessageKind.EXPERIMENTAL_ASSERT_MESSAGE); | |
471 } | |
472 } | |
473 // TODO(sra): We could completely ignore the assert in production mode if we | 467 // TODO(sra): We could completely ignore the assert in production mode if we |
474 // didn't need it to be resolved for type checking. | 468 // didn't need it to be resolved for type checking. |
475 registry.registerFeature( | 469 registry.registerFeature( |
476 node.hasMessage ? Feature.ASSERT_WITH_MESSAGE : Feature.ASSERT); | 470 node.hasMessage ? Feature.ASSERT_WITH_MESSAGE : Feature.ASSERT); |
477 visit(node.condition); | 471 visit(node.condition); |
478 visit(node.message); | 472 visit(node.message); |
479 return const NoneResult(); | 473 return const NoneResult(); |
480 } | 474 } |
481 | 475 |
482 ResolutionResult visitCascade(Cascade node) { | 476 ResolutionResult visitCascade(Cascade node) { |
(...skipping 4264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 } | 4741 } |
4748 return const NoneResult(); | 4742 return const NoneResult(); |
4749 } | 4743 } |
4750 } | 4744 } |
4751 | 4745 |
4752 /// Looks up [name] in [scope] and unwraps the result. | 4746 /// Looks up [name] in [scope] and unwraps the result. |
4753 Element lookupInScope( | 4747 Element lookupInScope( |
4754 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4748 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
4755 return Elements.unwrap(scope.lookup(name), reporter, node); | 4749 return Elements.unwrap(scope.lookup(name), reporter, node); |
4756 } | 4750 } |
OLD | NEW |