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

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

Issue 2924423003: Complain about use before declaration. (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
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 return callMethod('pop'); 493 return callMethod('pop');
494 } 494 }
495 495
496 void removeRange(int start, int end) { 496 void removeRange(int start, int end) {
497 _checkRange(start, end, length); 497 _checkRange(start, end, length);
498 callMethod('splice', [start, end - start]); 498 callMethod('splice', [start, end - start]);
499 } 499 }
500 500
501 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { 501 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
502 _checkRange(start, end, length); 502 _checkRange(start, end, length);
503 int length = end - start; 503 length = end - start;
504 if (length == 0) return; 504 if (length == 0) return;
505 if (skipCount < 0) throw new ArgumentError(skipCount); 505 if (skipCount < 0) throw new ArgumentError(skipCount);
506 var args = [start, length]..addAll(iterable.skip(skipCount).take(length)); 506 var args = [start, length]..addAll(iterable.skip(skipCount).take(length));
507 callMethod('splice', args); 507 callMethod('splice', args);
508 } 508 }
509 509
510 void sort([int compare(E a, E b)]) { 510 void sort([int compare(E a, E b)]) {
511 // Note: arr.sort(null) is a type error in FF 511 // Note: arr.sort(null) is a type error in FF
512 callMethod('sort', compare == null ? [] : [compare]); 512 callMethod('sort', compare == null ? [] : [compare]);
513 } 513 }
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 Function allowInteropCaptureThis(Function f) { 719 Function allowInteropCaptureThis(Function f) {
720 if (JS('bool', 'typeof(#) == "function"', f)) { 720 if (JS('bool', 'typeof(#) == "function"', f)) {
721 // Behavior when the function is already a JS function is unspecified. 721 // Behavior when the function is already a JS function is unspecified.
722 throw new ArgumentError( 722 throw new ArgumentError(
723 "Function is already a JS function so cannot capture this."); 723 "Function is already a JS function so cannot capture this.");
724 return f; 724 return f;
725 } else { 725 } else {
726 return _convertDartFunctionFastCaptureThis(f); 726 return _convertDartFunctionFastCaptureThis(f);
727 } 727 }
728 } 728 }
OLDNEW
« no previous file with comments | « pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.expect ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698