OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 library compiler.src.kernel.dart2js_target; |
| 6 |
| 7 import 'package:kernel/kernel.dart'; |
| 8 import 'package:kernel/core_types.dart'; |
| 9 import 'package:kernel/class_hierarchy.dart'; |
| 10 import 'package:kernel/target/targets.dart'; |
| 11 |
| 12 import 'package:compiler/src/native/native.dart' show maybeEnableNative; |
| 13 |
| 14 /// A kernel [Target] to configure the Dart Front End for dart2js. |
| 15 class Dart2jsTarget extends Target { |
| 16 final TargetFlags flags; |
| 17 |
| 18 Dart2jsTarget(this.flags); |
| 19 |
| 20 bool get strongMode => flags.strongMode; |
| 21 |
| 22 String get name => 'dart2js'; |
| 23 |
| 24 List<String> get extraRequiredLibraries => const <String>[ |
| 25 'dart:_chrome', |
| 26 'dart:_foreign_helper', |
| 27 'dart:_interceptors', |
| 28 'dart:_internal', |
| 29 'dart:_isolate_helper', |
| 30 'dart:_js_embedded_names', |
| 31 'dart:_js_helper', |
| 32 'dart:_js_mirrors', |
| 33 'dart:_js_names', |
| 34 'dart:_native_typed_data', |
| 35 'dart:async', |
| 36 'dart:collection', |
| 37 'dart:html', |
| 38 'dart:html_common', |
| 39 'dart:indexed_db', |
| 40 'dart:js', |
| 41 'dart:js_util', |
| 42 'dart:mirrors', |
| 43 'dart:svg', |
| 44 'dart:web_audio', |
| 45 'dart:web_gl', |
| 46 'dart:web_sql', |
| 47 ]; |
| 48 |
| 49 @override |
| 50 bool mayDefineRestrictedType(Uri uri) => |
| 51 uri.scheme == 'dart' && |
| 52 (uri.path == 'core' || uri.path == '_interceptors'); |
| 53 |
| 54 @override |
| 55 bool enableNative(Uri uri) => maybeEnableNative(uri); |
| 56 |
| 57 @override |
| 58 bool get nativeExtensionExpectsString => false; |
| 59 |
| 60 @override |
| 61 void performModularTransformationsOnLibraries( |
| 62 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries, |
| 63 {void logger(String msg)}) {} |
| 64 |
| 65 @override |
| 66 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
| 67 {void logger(String msg)}) {} |
| 68 |
| 69 @override |
| 70 Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver, |
| 71 String name, Arguments arguments, int offset, bool isSuper) { |
| 72 // TODO(sigmund): implement; |
| 73 return new InvalidExpression(); |
| 74 } |
| 75 |
| 76 @override |
| 77 Expression instantiateNoSuchMethodError(CoreTypes coreTypes, |
| 78 Expression receiver, String name, Arguments arguments, int offset, |
| 79 {bool isMethod: false, |
| 80 bool isGetter: false, |
| 81 bool isSetter: false, |
| 82 bool isField: false, |
| 83 bool isLocalVariable: false, |
| 84 bool isDynamic: false, |
| 85 bool isSuper: false, |
| 86 bool isStatic: false, |
| 87 bool isConstructor: false, |
| 88 bool isTopLevel: false}) { |
| 89 // TODO(sigmund): implement; |
| 90 return new InvalidExpression(); |
| 91 } |
| 92 } |
OLD | NEW |