| 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:uri'; | 7 import 'dart:uri'; |
| 8 import 'dart2jslib.dart' hide SourceString; | 8 import 'dart2jslib.dart' hide SourceString; |
| 9 import 'elements/elements.dart'; | 9 import 'elements/elements.dart'; |
| 10 import 'js_backend/js_backend.dart'; | 10 import 'js_backend/js_backend.dart'; |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 '${unusedClasses.length} native classes omitted.'); | 447 '${unusedClasses.length} native classes omitted.'); |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 | 450 |
| 451 void maybeEnableNative(Compiler compiler, | 451 void maybeEnableNative(Compiler compiler, |
| 452 LibraryElement library, | 452 LibraryElement library, |
| 453 Uri uri) { | 453 Uri uri) { |
| 454 String libraryName = uri.toString(); | 454 String libraryName = uri.toString(); |
| 455 if (library.entryCompilationUnit.script.name.contains( | 455 if (library.entryCompilationUnit.script.name.contains( |
| 456 'dart/tests/compiler/dart2js_native') | 456 'dart/tests/compiler/dart2js_native') |
| 457 || libraryName == 'dart:isolate' |
| 457 || libraryName == 'dart:html' | 458 || libraryName == 'dart:html' |
| 458 || libraryName == 'dart:html_common' | 459 || libraryName == 'dart:html_common' |
| 459 || libraryName == 'dart:indexed_db' | 460 || libraryName == 'dart:indexed_db' |
| 460 || libraryName == 'dart:svg' | 461 || libraryName == 'dart:svg' |
| 461 || libraryName == 'dart:web_audio') { | 462 || libraryName == 'dart:web_audio') { |
| 462 library.canUseNative = true; | 463 library.canUseNative = true; |
| 463 } | 464 } |
| 464 } | 465 } |
| 465 | 466 |
| 466 /** | 467 /** |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 builder.add(new HForeign( | 890 builder.add(new HForeign( |
| 890 new DartString.literal('${parameter.name.slowToString()} = #'), | 891 new DartString.literal('${parameter.name.slowToString()} = #'), |
| 891 const LiteralDartString('void'), | 892 const LiteralDartString('void'), |
| 892 <HInstruction>[jsClosure])); | 893 <HInstruction>[jsClosure])); |
| 893 } | 894 } |
| 894 }); | 895 }); |
| 895 LiteralString jsCode = nativeBody.asLiteralString(); | 896 LiteralString jsCode = nativeBody.asLiteralString(); |
| 896 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); | 897 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); |
| 897 } | 898 } |
| 898 } | 899 } |
| OLD | NEW |