blob: 2c30a27a5461f474dd8d8bd8393f24f8081ecd64 [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library native;
import '../compiler.dart' show Compiler;
import '../elements/elements.dart';
export 'behavior.dart';
export 'enqueue.dart';
export 'js.dart';
export 'scanner.dart';
export 'ssa.dart';
const Iterable<String> _allowedDartSchemePaths = const <String>[
bool maybeEnableNative(Compiler compiler, LibraryElement library) {
bool allowedTestLibrary() {
String scriptName =;
return scriptName.contains('sdk/tests/compiler/dart2js_native') ||
bool allowedDartLibary() {
Uri uri = library.canonicalUri;
if (uri.scheme != 'dart') return false;
return _allowedDartSchemePaths.contains(uri.path);
return allowedTestLibrary() ||
allowedDartLibary() ||