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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 382953002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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:
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/generated/testing/ast_factory.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 503dbcd5421628fb8b5089c6aae98cd5119f997e..fa12291b94e390ae79b4e213cbb00fbe55e5eef4 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -1400,6 +1400,9 @@ class ConstantVerifier extends RecursiveAstVisitor<Object> {
@override
Object visitInstanceCreationExpression(InstanceCreationExpression node) {
+ if (node.isConst) {
+ _validate(node, null);
+ }
_validateInstanceCreationArguments(node);
return super.visitInstanceCreationExpression(node);
}
@@ -1609,7 +1612,7 @@ class ConstantVerifier extends RecursiveAstVisitor<Object> {
ErrorCode dataErrorCode = data.errorCode;
if (identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_INT) || identical(dataErrorCode, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM)) {
_errorReporter.reportErrorForNode(dataErrorCode, data.node, []);
- } else {
+ } else if (errorCode != null) {
_errorReporter.reportErrorForNode(errorCode, data.node, []);
}
}
@@ -15898,7 +15901,7 @@ class LibraryResolver {
void _performConstantEvaluation() {
TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
try {
- ConstantValueComputer computer = new ConstantValueComputer(_typeProvider);
+ ConstantValueComputer computer = new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
for (Library library in _librariesInCycles) {
for (Source source in library.compilationUnitSources) {
try {
@@ -16350,7 +16353,7 @@ class LibraryResolver2 {
void _performConstantEvaluation() {
TimeCounter_TimeCounterHandle timeCounter = PerformanceStatistics.resolve.start();
try {
- ConstantValueComputer computer = new ConstantValueComputer(_typeProvider);
+ ConstantValueComputer computer = new ConstantValueComputer(_typeProvider, analysisContext.declaredVariables);
for (ResolvableLibrary library in _librariesInCycle) {
for (ResolvableCompilationUnit unit in library.resolvableCompilationUnits) {
CompilationUnit ast = unit.compilationUnit;
@@ -19668,7 +19671,7 @@ abstract class ScopedVisitor extends UnifyingAstVisitor<Object> {
} finally {
_nameScope = outerScope;
}
- if (functionElement.enclosingElement is! CompilationUnitElement) {
+ if (functionElement != null && functionElement.enclosingElement is! CompilationUnitElement) {
_nameScope.define(functionElement);
}
return null;
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/generated/testing/ast_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698