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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 years, 4 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:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 809 }
810 } else { 810 } else {
811 typesInstantiated.add(type); 811 typesInstantiated.add(type);
812 } 812 }
813 } 813 }
814 814
815 static _parseType(String typeString, Compiler compiler, 815 static _parseType(String typeString, Compiler compiler,
816 lookup(name), locationNodeOrElement) { 816 lookup(name), locationNodeOrElement) {
817 if (typeString == '=Object') return SpecialType.JsObject; 817 if (typeString == '=Object') return SpecialType.JsObject;
818 if (typeString == 'dynamic') { 818 if (typeString == 'dynamic') {
819 return compiler.dynamicClass.computeType(compiler); 819 return compiler.types.dynamicType;
820 } 820 }
821 DartType type = lookup(typeString); 821 DartType type = lookup(typeString);
822 if (type != null) return type; 822 if (type != null) return type;
823 823
824 int index = typeString.indexOf('<'); 824 int index = typeString.indexOf('<');
825 if (index < 1) { 825 if (index < 1) {
826 compiler.cancel("Type '$typeString' not found", 826 compiler.cancel("Type '$typeString' not found",
827 node: _errorNode(locationNodeOrElement, compiler)); 827 node: _errorNode(locationNodeOrElement, compiler));
828 } 828 }
829 type = lookup(typeString.substring(0, index)); 829 type = lookup(typeString.substring(0, index));
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 'native "..." syntax is restricted to functions with zero parameters', 1016 'native "..." syntax is restricted to functions with zero parameters',
1017 node: nativeBody); 1017 node: nativeBody);
1018 } 1018 }
1019 LiteralString jsCode = nativeBody.asLiteralString(); 1019 LiteralString jsCode = nativeBody.asLiteralString();
1020 builder.push(new HForeign.statement( 1020 builder.push(new HForeign.statement(
1021 new js.LiteralStatement(jsCode.dartString.slowToString()), 1021 new js.LiteralStatement(jsCode.dartString.slowToString()),
1022 <HInstruction>[], 1022 <HInstruction>[],
1023 new SideEffects())); 1023 new SideEffects()));
1024 } 1024 }
1025 } 1025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698