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

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

Issue 15782009: RFC: introduce dart:js (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove Element handling + fix js_dartium for passing tests Created 7 years, 6 months 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
« no previous file with comments | « no previous file | sdk/lib/_internal/libraries.dart » ('j') | sdk/lib/js/dart2js/js_dart2js.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:collection' show Queue; 7 import 'dart:collection' show Queue;
8 import 'dart2jslib.dart' hide SourceString; 8 import 'dart2jslib.dart' hide SourceString;
9 import 'dart_types.dart'; 9 import 'dart_types.dart';
10 import 'elements/elements.dart'; 10 import 'elements/elements.dart';
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 488
489 void maybeEnableNative(Compiler compiler, 489 void maybeEnableNative(Compiler compiler,
490 LibraryElement library) { 490 LibraryElement library) {
491 String libraryName = library.canonicalUri.toString(); 491 String libraryName = library.canonicalUri.toString();
492 if (library.entryCompilationUnit.script.name.contains( 492 if (library.entryCompilationUnit.script.name.contains(
493 'dart/tests/compiler/dart2js_native') 493 'dart/tests/compiler/dart2js_native')
494 || libraryName == 'dart:async' 494 || libraryName == 'dart:async'
495 || libraryName == 'dart:html' 495 || libraryName == 'dart:html'
496 || libraryName == 'dart:html_common' 496 || libraryName == 'dart:html_common'
497 || libraryName == 'dart:indexed_db' 497 || libraryName == 'dart:indexed_db'
498 || libraryName == 'dart:js'
498 || libraryName == 'dart:svg' 499 || libraryName == 'dart:svg'
499 || libraryName == 'dart:typed_data' 500 || libraryName == 'dart:typed_data'
500 || libraryName == 'dart:web_audio' 501 || libraryName == 'dart:web_audio'
501 || libraryName == 'dart:web_gl' 502 || libraryName == 'dart:web_gl'
502 || libraryName == 'dart:web_sql') { 503 || libraryName == 'dart:web_sql') {
503 library.canUseNative = true; 504 library.canUseNative = true;
504 } 505 }
505 } 506 }
506 507
507 class SideEffectsVisitor extends js.BaseVisitor { 508 class SideEffectsVisitor extends js.BaseVisitor {
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 'native "..." syntax is restricted to functions with zero parameters', 1019 'native "..." syntax is restricted to functions with zero parameters',
1019 node: nativeBody); 1020 node: nativeBody);
1020 } 1021 }
1021 LiteralString jsCode = nativeBody.asLiteralString(); 1022 LiteralString jsCode = nativeBody.asLiteralString();
1022 builder.push(new HForeign.statement( 1023 builder.push(new HForeign.statement(
1023 new js.LiteralStatement(jsCode.dartString.slowToString()), 1024 new js.LiteralStatement(jsCode.dartString.slowToString()),
1024 <HInstruction>[], 1025 <HInstruction>[],
1025 new SideEffects())); 1026 new SideEffects()));
1026 } 1027 }
1027 } 1028 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/libraries.dart » ('j') | sdk/lib/js/dart2js/js_dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698