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

Side by Side Diff: sdk/lib/js/dartium/js_dartium.dart

Issue 2957593002: Spelling fixes e to i. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « sdk/lib/io/stdio.dart ('k') | tests/benchmark_smoke/benchmark_base.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * Support for interoperating with JavaScript. 6 * Support for interoperating with JavaScript.
7 * 7 *
8 * This library provides access to JavaScript objects from Dart, allowing 8 * This library provides access to JavaScript objects from Dart, allowing
9 * Dart code to get and set properties, and call methods of JavaScript objects 9 * Dart code to get and set properties, and call methods of JavaScript objects
10 * and invoke JavaScript functions. The library takes care of converting 10 * and invoke JavaScript functions. The library takes care of converting
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 return false; 300 return false;
301 } 301 }
302 if (invocation.namedArguments.isNotEmpty) { 302 if (invocation.namedArguments.isNotEmpty) {
303 var startNamed; 303 var startNamed;
304 for (startNamed = parameters.length - 1; startNamed >= 0; startNamed--) { 304 for (startNamed = parameters.length - 1; startNamed >= 0; startNamed--) {
305 if (!parameters[startNamed].isNamed) break; 305 if (!parameters[startNamed].isNamed) break;
306 } 306 }
307 startNamed++; 307 startNamed++;
308 308
309 // TODO(jacobr): we are unnecessarily using an O(n^2) algorithm here. 309 // TODO(jacobr): we are unnecessarily using an O(n^2) algorithm here.
310 // If we have JS APIs with a lange number of named parameters we should 310 // If we have JS APIs with a large number of named parameters we should
311 // optimize this. Either use a HashSet or invert this, walking over 311 // optimize this. Either use a HashSet or invert this, walking over
312 // parameters, querying invocation, and making sure we match 312 // parameters, querying invocation, and making sure we match
313 //invocation.namedArguments.size keys. 313 //invocation.namedArguments.size keys.
314 for (var name in invocation.namedArguments.keys) { 314 for (var name in invocation.namedArguments.keys) {
315 bool match = false; 315 bool match = false;
316 for (var j = startNamed; j < parameters.length; j++) { 316 for (var j = startNamed; j < parameters.length; j++) {
317 var p = parameters[j]; 317 var p = parameters[j];
318 if (p.simpleName == name) { 318 if (p.simpleName == name) {
319 if (!_checkType( 319 if (!_checkType(
320 invocation.namedArguments[name], parameters[j].type)) 320 invocation.namedArguments[name], parameters[j].type))
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 var isFunction = typeMirror.isSubtypeOf(functionMirror); 835 var isFunction = typeMirror.isSubtypeOf(functionMirror);
836 var isJSObject = typeMirror.isSubtypeOf(jsObjectMirror); 836 var isJSObject = typeMirror.isSubtypeOf(jsObjectMirror);
837 var className = mirrors.MirrorSystem.getName(typeMirror.simpleName); 837 var className = mirrors.MirrorSystem.getName(typeMirror.simpleName);
838 var isPrivateUserDefinedClass = className.startsWith('_') && !dartLibrary; 838 var isPrivateUserDefinedClass = className.startsWith('_') && !dartLibrary;
839 if (isPrivateUserDefinedClass) 839 if (isPrivateUserDefinedClass)
840 className = '${escapePrivateClassPrefix}${className}'; 840 className = '${escapePrivateClassPrefix}${className}';
841 var fullName = '${prefixName}.${className}'; 841 var fullName = '${prefixName}.${className}';
842 (isArray ? implementsArray : implements).add(fullName); 842 (isArray ? implementsArray : implements).add(fullName);
843 if (!isArray && !isFunction && !isJSObject) { 843 if (!isArray && !isFunction && !isJSObject) {
844 // For DOM classes we need to be a bit more conservative at tagging them 844 // For DOM classes we need to be a bit more conservative at tagging them
845 // as implementing JS inteorp classes risks strange unintended 845 // as implementing JS interop classes risks strange unintended
846 // consequences as unrleated code may have instanceof checks. Checking 846 // consequences as unrleated code may have instanceof checks. Checking
847 // for isJSObject ensures we do not accidentally pull in existing 847 // for isJSObject ensures we do not accidentally pull in existing
848 // dart:html classes as they all have JSObject as a base class. 848 // dart:html classes as they all have JSObject as a base class.
849 // Note that methods from these classes can still be called on a 849 // Note that methods from these classes can still be called on a
850 // dart:html instance but checked mode type checks will fail. This is 850 // dart:html instance but checked mode type checks will fail. This is
851 // not ideal but is better than causing strange breaks in existing 851 // not ideal but is better than causing strange breaks in existing
852 // code that uses dart:html. 852 // code that uses dart:html.
853 // TODO(jacobr): consider throwing compile time errors if @JS classes 853 // TODO(jacobr): consider throwing compile time errors if @JS classes
854 // extend JSObject as that case cannot be safely handled in Dartium. 854 // extend JSObject as that case cannot be safely handled in Dartium.
855 implementsDom.add(fullName); 855 implementsDom.add(fullName);
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 } else { 1694 } else {
1695 var ret = _interopCaptureThisExpando[f]; 1695 var ret = _interopCaptureThisExpando[f];
1696 if (ret == null) { 1696 if (ret == null) {
1697 // TODO(jacobr): we could optimize this. 1697 // TODO(jacobr): we could optimize this.
1698 ret = JSFunction._createWithThis(f); 1698 ret = JSFunction._createWithThis(f);
1699 _interopCaptureThisExpando[f] = ret; 1699 _interopCaptureThisExpando[f] = ret;
1700 } 1700 }
1701 return ret; 1701 return ret;
1702 } 1702 }
1703 } 1703 }
OLDNEW
« no previous file with comments | « sdk/lib/io/stdio.dart ('k') | tests/benchmark_smoke/benchmark_base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698