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

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: fix comments on patch 9 Created 7 years, 5 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 | « pkg/browser/lib/interop.js ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 void maybeEnableNative(Compiler compiler, 488 void maybeEnableNative(Compiler compiler,
489 LibraryElement library) { 489 LibraryElement library) {
490 String libraryName = library.canonicalUri.toString(); 490 String libraryName = library.canonicalUri.toString();
491 if (library.entryCompilationUnit.script.name.contains( 491 if (library.entryCompilationUnit.script.name.contains(
492 'dart/tests/compiler/dart2js_native') 492 'dart/tests/compiler/dart2js_native')
493 || libraryName == 'dart:async' 493 || libraryName == 'dart:async'
494 || libraryName == 'dart:html' 494 || libraryName == 'dart:html'
495 || libraryName == 'dart:html_common' 495 || libraryName == 'dart:html_common'
496 || libraryName == 'dart:indexed_db' 496 || libraryName == 'dart:indexed_db'
497 || libraryName == 'dart:js'
497 || libraryName == 'dart:svg' 498 || libraryName == 'dart:svg'
498 || libraryName == 'dart:typed_data' 499 || libraryName == 'dart:typed_data'
499 || libraryName == 'dart:web_audio' 500 || libraryName == 'dart:web_audio'
500 || libraryName == 'dart:web_gl' 501 || libraryName == 'dart:web_gl'
501 || libraryName == 'dart:web_sql') { 502 || libraryName == 'dart:web_sql') {
502 library.canUseNative = true; 503 library.canUseNative = true;
503 } 504 }
504 } 505 }
505 506
506 class SideEffectsVisitor extends js.BaseVisitor { 507 class SideEffectsVisitor extends js.BaseVisitor {
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 'native "..." syntax is restricted to functions with zero parameters', 1016 'native "..." syntax is restricted to functions with zero parameters',
1016 node: nativeBody); 1017 node: nativeBody);
1017 } 1018 }
1018 LiteralString jsCode = nativeBody.asLiteralString(); 1019 LiteralString jsCode = nativeBody.asLiteralString();
1019 builder.push(new HForeign.statement( 1020 builder.push(new HForeign.statement(
1020 new js.LiteralStatement(jsCode.dartString.slowToString()), 1021 new js.LiteralStatement(jsCode.dartString.slowToString()),
1021 <HInstruction>[], 1022 <HInstruction>[],
1022 new SideEffects())); 1023 new SideEffects()));
1023 } 1024 }
1024 } 1025 }
OLDNEW
« no previous file with comments | « pkg/browser/lib/interop.js ('k') | sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698