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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11316113: Creating a common library for all DOM types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging with latest from tree. Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 '${unusedClasses.length} native classes omitted.'); 348 '${unusedClasses.length} native classes omitted.');
349 } 349 }
350 } 350 }
351 351
352 void maybeEnableNative(Compiler compiler, 352 void maybeEnableNative(Compiler compiler,
353 LibraryElement library, 353 LibraryElement library,
354 Uri uri) { 354 Uri uri) {
355 String libraryName = uri.toString(); 355 String libraryName = uri.toString();
356 if (library.entryCompilationUnit.script.name.contains( 356 if (library.entryCompilationUnit.script.name.contains(
357 'dart/tests/compiler/dart2js_native') 357 'dart/tests/compiler/dart2js_native')
358 || libraryName == 'dart:html_common'
358 || libraryName == 'dart:isolate' 359 || libraryName == 'dart:isolate'
359 || libraryName == 'dart:html' 360 || libraryName == 'dart:html'
360 || libraryName == 'dart:svg' 361 || libraryName == 'dart:svg'
361 || libraryName == 'dart:web_audio') { 362 || libraryName == 'dart:web_audio') {
362 library.canUseNative = true; 363 library.canUseNative = true;
363 } 364 }
364 } 365 }
365 366
366 /** 367 /**
367 * A summary of the behavior of a native element. 368 * A summary of the behavior of a native element.
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 builder.add(new HForeign( 803 builder.add(new HForeign(
803 new DartString.literal('${parameter.name.slowToString()} = #'), 804 new DartString.literal('${parameter.name.slowToString()} = #'),
804 const LiteralDartString('void'), 805 const LiteralDartString('void'),
805 <HInstruction>[jsClosure])); 806 <HInstruction>[jsClosure]));
806 } 807 }
807 }); 808 });
808 LiteralString jsCode = nativeBody.asLiteralString(); 809 LiteralString jsCode = nativeBody.asLiteralString();
809 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); 810 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[]));
810 } 811 }
811 } 812 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/compiler.dart ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698