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

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

Issue 10389097: Move dart:dom to dart:dom_deprecated (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review Created 8 years, 7 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 | « lib/compiler/implementation/library_map.dart ('k') | lib/config/import_any.config » ('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 #import('dart:uri'); 6 #import('dart:uri');
7 #import('leg.dart'); 7 #import('leg.dart');
8 #import('elements/elements.dart'); 8 #import('elements/elements.dart');
9 #import('scanner/scannerlib.dart'); 9 #import('scanner/scannerlib.dart');
10 #import('ssa/ssa.dart'); 10 #import('ssa/ssa.dart');
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 compiler.registerStaticUse(compiler.findHelper( 68 compiler.registerStaticUse(compiler.findHelper(
69 const SourceString('toStringForNativeObject'))); 69 const SourceString('toStringForNativeObject')));
70 } 70 }
71 } 71 }
72 72
73 void maybeEnableNative(Compiler compiler, 73 void maybeEnableNative(Compiler compiler,
74 LibraryElement library, 74 LibraryElement library,
75 Uri uri) { 75 Uri uri) {
76 String libraryName = uri.toString(); 76 String libraryName = uri.toString();
77 if (library.script.name.contains('dart/frog/tests/frog_native') 77 if (library.script.name.contains('dart/frog/tests/frog_native')
78 || libraryName == 'dart:dom' 78 || libraryName == 'dart:dom_deprecated'
79 || libraryName == 'dart:isolate' 79 || libraryName == 'dart:isolate'
80 || libraryName == 'dart:html') { 80 || libraryName == 'dart:html') {
81 library.define(new ForeignElement( 81 library.define(new ForeignElement(
82 const SourceString('native'), library), compiler); 82 const SourceString('native'), library), compiler);
83 library.canUseNative = true; 83 library.canUseNative = true;
84 } 84 }
85 85
86 // Additionaly, if this is a test, we allow access to foreign functions. 86 // Additionaly, if this is a test, we allow access to foreign functions.
87 if (library.script.name.contains('dart/frog/tests/frog_native')) { 87 if (library.script.name.contains('dart/frog/tests/frog_native')) {
88 library.define(compiler.findHelper(const SourceString('JS')), compiler); 88 library.define(compiler.findHelper(const SourceString('JS')), compiler);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 String parameters) { 346 String parameters) {
347 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty"); 347 buffer.add(" if (Object.getPrototypeOf(this).hasOwnProperty");
348 buffer.add("('$methodName')) {\n"); 348 buffer.add("('$methodName')) {\n");
349 buffer.add(" $code"); 349 buffer.add(" $code");
350 buffer.add(" } else {\n"); 350 buffer.add(" } else {\n");
351 buffer.add(" return Object.prototype.$methodName.call(this"); 351 buffer.add(" return Object.prototype.$methodName.call(this");
352 buffer.add(parameters == '' ? '' : ', $parameters'); 352 buffer.add(parameters == '' ? '' : ', $parameters');
353 buffer.add(");\n"); 353 buffer.add(");\n");
354 buffer.add(" }\n"); 354 buffer.add(" }\n");
355 } 355 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/library_map.dart ('k') | lib/config/import_any.config » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698