| 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 native; | 5 library native; |
| 6 | 6 |
| 7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
| 8 import 'dart2jslib.dart' hide SourceString; | 8 import 'dart2jslib.dart' hide SourceString; |
| 9 import 'dart_types.dart'; | 9 import 'dart_types.dart'; |
| 10 import 'elements/elements.dart'; | 10 import 'elements/elements.dart'; |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 } | 808 } |
| 809 } else { | 809 } else { |
| 810 typesInstantiated.add(type); | 810 typesInstantiated.add(type); |
| 811 } | 811 } |
| 812 } | 812 } |
| 813 | 813 |
| 814 static _parseType(String typeString, Compiler compiler, | 814 static _parseType(String typeString, Compiler compiler, |
| 815 lookup(name), locationNodeOrElement) { | 815 lookup(name), locationNodeOrElement) { |
| 816 if (typeString == '=Object') return SpecialType.JsObject; | 816 if (typeString == '=Object') return SpecialType.JsObject; |
| 817 if (typeString == 'dynamic') { | 817 if (typeString == 'dynamic') { |
| 818 return compiler.dynamicClass.computeType(compiler); | 818 return compiler.types.dynamicType; |
| 819 } | 819 } |
| 820 DartType type = lookup(typeString); | 820 DartType type = lookup(typeString); |
| 821 if (type != null) return type; | 821 if (type != null) return type; |
| 822 | 822 |
| 823 int index = typeString.indexOf('<'); | 823 int index = typeString.indexOf('<'); |
| 824 if (index < 1) { | 824 if (index < 1) { |
| 825 compiler.cancel("Type '$typeString' not found", | 825 compiler.cancel("Type '$typeString' not found", |
| 826 node: _errorNode(locationNodeOrElement, compiler)); | 826 node: _errorNode(locationNodeOrElement, compiler)); |
| 827 } | 827 } |
| 828 type = lookup(typeString.substring(0, index)); | 828 type = lookup(typeString.substring(0, index)); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 'native "..." syntax is restricted to functions with zero parameters', | 1015 'native "..." syntax is restricted to functions with zero parameters', |
| 1016 node: nativeBody); | 1016 node: nativeBody); |
| 1017 } | 1017 } |
| 1018 LiteralString jsCode = nativeBody.asLiteralString(); | 1018 LiteralString jsCode = nativeBody.asLiteralString(); |
| 1019 builder.push(new HForeign.statement( | 1019 builder.push(new HForeign.statement( |
| 1020 new js.LiteralStatement(jsCode.dartString.slowToString()), | 1020 new js.LiteralStatement(jsCode.dartString.slowToString()), |
| 1021 <HInstruction>[], | 1021 <HInstruction>[], |
| 1022 new SideEffects())); | 1022 new SideEffects())); |
| 1023 } | 1023 } |
| 1024 } | 1024 } |
| OLD | NEW |