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

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

Issue 11398002: Splitting SVG types out of dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minifying. Created 8 years, 1 month 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 } 76 }
77 77
78 void maybeEnableNative(Compiler compiler, 78 void maybeEnableNative(Compiler compiler,
79 LibraryElement library, 79 LibraryElement library,
80 Uri uri) { 80 Uri uri) {
81 String libraryName = uri.toString(); 81 String libraryName = uri.toString();
82 if (library.entryCompilationUnit.script.name.contains( 82 if (library.entryCompilationUnit.script.name.contains(
83 'dart/tests/compiler/dart2js_native') 83 'dart/tests/compiler/dart2js_native')
84 || libraryName == 'dart:isolate' 84 || libraryName == 'dart:isolate'
85 || libraryName == 'dart:html') { 85 || libraryName == 'dart:html'
86 || libraryName == 'dart:svg') {
86 library.canUseNative = true; 87 library.canUseNative = true;
87 } 88 }
88 } 89 }
89 90
90 void checkAllowedLibrary(ElementListener listener, Token token) { 91 void checkAllowedLibrary(ElementListener listener, Token token) {
91 LibraryElement currentLibrary = listener.compilationUnitElement.getLibrary(); 92 LibraryElement currentLibrary = listener.compilationUnitElement.getLibrary();
92 if (!currentLibrary.canUseNative) { 93 if (!currentLibrary.canUseNative) {
93 listener.recoverableError("Unexpected token", token: token); 94 listener.recoverableError("Unexpected token", token: token);
94 } 95 }
95 } 96 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 String parameters) { 332 String parameters) {
332 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 333 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
333 buffer.add("('$methodName')) {\n"); 334 buffer.add("('$methodName')) {\n");
334 buffer.add(" $code"); 335 buffer.add(" $code");
335 buffer.add(" } else {\n"); 336 buffer.add(" } else {\n");
336 buffer.add(" return Object.prototype.$methodName.call(this"); 337 buffer.add(" return Object.prototype.$methodName.call(this");
337 buffer.add(parameters == '' ? '' : ', $parameters'); 338 buffer.add(parameters == '' ? '' : ', $parameters');
338 buffer.add(");\n"); 339 buffer.add(");\n");
339 buffer.add(" }\n"); 340 buffer.add(" }\n");
340 } 341 }
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