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

Unified Diff: pkg/compiler/lib/src/native/native.dart

Issue 745533002: Support native extensions for analysis and docgen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/native/native.dart
diff --git a/pkg/compiler/lib/src/native/native.dart b/pkg/compiler/lib/src/native/native.dart
index 9033735f50874d7f09b9196ea674af37fff8aee3..3bba978dc85a7bead5c65d278ebede355546134d 100644
--- a/pkg/compiler/lib/src/native/native.dart
+++ b/pkg/compiler/lib/src/native/native.dart
@@ -10,7 +10,8 @@ import '../constants/values.dart';
import '../dart2jslib.dart';
import '../dart_types.dart';
import '../elements/elements.dart';
-import '../elements/modelx.dart' show ClassElementX, FunctionElementX;
+import '../elements/modelx.dart'
+ show ClassElementX, FunctionElementX, LibraryElementX;
import '../js/js.dart' as js;
import '../js_backend/js_backend.dart';
import '../js_emitter/js_emitter.dart' show CodeEmitterTask;
@@ -28,7 +29,7 @@ part 'scanner.dart';
part 'ssa.dart';
void maybeEnableNative(Compiler compiler,
- LibraryElement library) {
+ LibraryElementX library) {
String libraryName = library.canonicalUri.toString();
if (library.entryCompilationUnit.script.name.contains(
'dart/tests/compiler/dart2js_native')
@@ -41,7 +42,8 @@ void maybeEnableNative(Compiler compiler,
|| libraryName == 'dart:_native_typed_data'
|| libraryName == 'dart:web_audio'
|| libraryName == 'dart:web_gl'
- || libraryName == 'dart:web_sql') {
+ || libraryName == 'dart:web_sql'
+ || compiler.allowNativeExtensions) {
library.canUseNative = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698