| 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 10 matching lines...) Expand all Loading... |
| 21 /// This class is a temporary work-around until we get a more powerful DartType. | 21 /// This class is a temporary work-around until we get a more powerful DartType. |
| 22 class SpecialType { | 22 class SpecialType { |
| 23 final String name; | 23 final String name; |
| 24 const SpecialType._(this.name); | 24 const SpecialType._(this.name); |
| 25 | 25 |
| 26 /// The type Object, but no subtypes: | 26 /// The type Object, but no subtypes: |
| 27 static const JsObject = const SpecialType._('=Object'); | 27 static const JsObject = const SpecialType._('=Object'); |
| 28 | 28 |
| 29 /// The specific implementation of List that is JavaScript Array: | 29 /// The specific implementation of List that is JavaScript Array: |
| 30 static const JsArray = const SpecialType._('=List'); | 30 static const JsArray = const SpecialType._('=List'); |
| 31 |
| 32 int get hashCode => name.hashCode; |
| 31 } | 33 } |
| 32 | 34 |
| 33 | 35 |
| 34 /** | 36 /** |
| 35 * This could be an abstract class but we use it as a stub for the dart_backend. | 37 * This could be an abstract class but we use it as a stub for the dart_backend. |
| 36 */ | 38 */ |
| 37 class NativeEnqueuer { | 39 class NativeEnqueuer { |
| 38 /// Initial entry point to native enqueuer. | 40 /// Initial entry point to native enqueuer. |
| 39 void processNativeClasses(Iterable<LibraryElement> libraries) {} | 41 void processNativeClasses(Iterable<LibraryElement> libraries) {} |
| 40 | 42 |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 'native "..." syntax is restricted to functions with zero parameters', | 1020 'native "..." syntax is restricted to functions with zero parameters', |
| 1019 node: nativeBody); | 1021 node: nativeBody); |
| 1020 } | 1022 } |
| 1021 LiteralString jsCode = nativeBody.asLiteralString(); | 1023 LiteralString jsCode = nativeBody.asLiteralString(); |
| 1022 builder.push(new HForeign.statement( | 1024 builder.push(new HForeign.statement( |
| 1023 new js.LiteralStatement(jsCode.dartString.slowToString()), | 1025 new js.LiteralStatement(jsCode.dartString.slowToString()), |
| 1024 <HInstruction>[], | 1026 <HInstruction>[], |
| 1025 new SideEffects())); | 1027 new SideEffects())); |
| 1026 } | 1028 } |
| 1027 } | 1029 } |
| OLD | NEW |