Skip to content

Commit

Permalink
enable compatiblity with 1.18 SDKs
Browse files Browse the repository at this point in the history
fixes #584, works around analyzer message #583

[email protected]

Review URL: https://codereview.chromium.org/2048463002 .
  • Loading branch information
John Messerly committed Jun 7, 2016
1 parent 0ec17d1 commit ec945ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pkg/dev_compiler/lib/src/compiler/code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/ast/token.dart' show StringToken;
//TODO(leafp): Remove deprecated dependency
//ignore: DEPRECATED_MEMBER_USE
import 'package:analyzer/src/generated/element.dart'
show DynamicTypeImpl, LocalVariableElementImpl;
import 'package:analyzer/src/dart/element/element.dart'
show LocalVariableElementImpl;
import 'package:analyzer/src/dart/element/type.dart' show DynamicTypeImpl;
import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
import 'package:analyzer/src/generated/resolver.dart'
show TypeProvider, NamespaceBuilder;
Expand Down Expand Up @@ -291,6 +290,7 @@ class CodeGenerator extends GeneralizingAstVisitor
case ModuleFormat.es6:
return module;
}
return null; // unreachable. It is here to suppress a bogus Analyzer message
}

List<String> _getJSName(Element e) {
Expand Down Expand Up @@ -2169,7 +2169,6 @@ class CodeGenerator extends GeneralizingAstVisitor
} else {
return js.call('dart.fn(#, #)', [fn, typeRep]);
}
throw 'Function has non function type: $type';
}

/// Emits an arrow FunctionExpression node.
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,4 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.9"
sdk: ">=1.16.0 <1.18.0"
sdk: ">=1.16.0 <2.0.0"
4 changes: 4 additions & 0 deletions pkg/dev_compiler/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ dev_dependencies:
unittest: ^0.11.6
webdriver: ^0.8.8

dependency_overrides:
# Remove once there is a package:test that allows 1.18 SDKs in its contraint.
test: ^0.12.0

environment:
sdk: ">=1.12.0 <2.0.0"

Expand Down

0 comments on commit ec945ee

Please sign in to comment.