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

Side by Side Diff: sdk/lib/js/dart2js/js_dart2js.dart

Issue 438503003: Fix js test for firefox now that null becomes 'null' and not 'undefined' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | no next file » | 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { 448 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
449 _checkRange(start, end, length); 449 _checkRange(start, end, length);
450 int length = end - start; 450 int length = end - start;
451 if (length == 0) return; 451 if (length == 0) return;
452 if (skipCount < 0) throw new ArgumentError(skipCount); 452 if (skipCount < 0) throw new ArgumentError(skipCount);
453 var args = [start, length]..addAll(iterable.skip(skipCount).take(length)); 453 var args = [start, length]..addAll(iterable.skip(skipCount).take(length));
454 callMethod('splice', args); 454 callMethod('splice', args);
455 } 455 }
456 456
457 void sort([int compare(E a, E b)]) { 457 void sort([int compare(E a, E b)]) {
458 callMethod('sort', [compare]); 458 // Note: arr.sort(null) is a type error in FF
459 callMethod('sort', compare == null ? [] : [compare]);
459 } 460 }
460 } 461 }
461 462
462 // property added to a Dart object referencing its JS-side DartObject proxy 463 // property added to a Dart object referencing its JS-side DartObject proxy
463 final String _DART_OBJECT_PROPERTY_NAME = 464 final String _DART_OBJECT_PROPERTY_NAME =
464 getIsolateAffinityTag(r'_$dart_dartObject'); 465 getIsolateAffinityTag(r'_$dart_dartObject');
465 final String _DART_CLOSURE_PROPERTY_NAME = 466 final String _DART_CLOSURE_PROPERTY_NAME =
466 getIsolateAffinityTag(r'_$dart_dartClosure'); 467 getIsolateAffinityTag(r'_$dart_dartClosure');
467 468
468 // property added to a JS object referencing its Dart-side JsObject proxy 469 // property added to a JS object referencing its Dart-side JsObject proxy
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 // Dart in that context. The JS object will have a cached proxy 575 // Dart in that context. The JS object will have a cached proxy
575 // but it won't be a valid Dart object in this context. 576 // but it won't be a valid Dart object in this context.
576 // For now we throw away the cached proxy, but we should be able 577 // For now we throw away the cached proxy, but we should be able
577 // to cache proxies from multiple JS contexts and Dart isolates. 578 // to cache proxies from multiple JS contexts and Dart isolates.
578 if (dartProxy == null || !_isLocalObject(o)) { 579 if (dartProxy == null || !_isLocalObject(o)) {
579 dartProxy = createProxy(o); 580 dartProxy = createProxy(o);
580 _defineProperty(o, propertyName, dartProxy); 581 _defineProperty(o, propertyName, dartProxy);
581 } 582 }
582 return dartProxy; 583 return dartProxy;
583 } 584 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698