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

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

Issue 12929005: dart:typeddata for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert status change Created 7 years, 9 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/html/dartium/html_dartium.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 'dart:uri'; 8 import 'dart:uri';
9 import 'dart2jslib.dart' hide SourceString; 9 import 'dart2jslib.dart' hide SourceString;
10 import 'dart_types.dart'; 10 import 'dart_types.dart';
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void maybeEnableNative(Compiler compiler, 475 void maybeEnableNative(Compiler compiler,
476 LibraryElement library) { 476 LibraryElement library) {
477 String libraryName = library.canonicalUri.toString(); 477 String libraryName = library.canonicalUri.toString();
478 if (library.entryCompilationUnit.script.name.contains( 478 if (library.entryCompilationUnit.script.name.contains(
479 'dart/tests/compiler/dart2js_native') 479 'dart/tests/compiler/dart2js_native')
480 || libraryName == 'dart:async' 480 || libraryName == 'dart:async'
481 || libraryName == 'dart:html' 481 || libraryName == 'dart:html'
482 || libraryName == 'dart:html_common' 482 || libraryName == 'dart:html_common'
483 || libraryName == 'dart:indexed_db' 483 || libraryName == 'dart:indexed_db'
484 || libraryName == 'dart:svg' 484 || libraryName == 'dart:svg'
485 || libraryName == 'dart:typeddata'
485 || libraryName == 'dart:web_audio' 486 || libraryName == 'dart:web_audio'
486 || libraryName == 'dart:web_sql') { 487 || libraryName == 'dart:web_sql') {
487 library.canUseNative = true; 488 library.canUseNative = true;
488 } 489 }
489 } 490 }
490 491
491 /** 492 /**
492 * A summary of the behavior of a native element. 493 * A summary of the behavior of a native element.
493 * 494 *
494 * Native code can return values of one type and cause native subtypes of 495 * Native code can return values of one type and cause native subtypes of
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 } else { 900 } else {
900 if (parameters.parameterCount != 0) { 901 if (parameters.parameterCount != 0) {
901 compiler.cancel( 902 compiler.cancel(
902 'native "..." syntax is restricted to functions with zero parameters', 903 'native "..." syntax is restricted to functions with zero parameters',
903 node: nativeBody); 904 node: nativeBody);
904 } 905 }
905 LiteralString jsCode = nativeBody.asLiteralString(); 906 LiteralString jsCode = nativeBody.asLiteralString();
906 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[])); 907 builder.push(new HForeign.statement(jsCode.dartString, <HInstruction>[]));
907 } 908 }
908 } 909 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/libraries.dart » ('j') | sdk/lib/html/dartium/html_dartium.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698