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

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/model/testsource/FunctionTest.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Tests function statements and expressions. 5 // Tests function statements and expressions.
6 6
7 class Bug4089219 { 7 class Bug4089219 {
8 int x; 8 int x;
9 var f; 9 var f;
10 10
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 int result = f(1, 2, 3); 300 int result = f(1, 2, 3);
301 assert(5 == result, "expected 5 got ${result}"); 301 assert(5 == result, "expected 5 got ${result}");
302 } 302 }
303 303
304 void testFunctionDefaults1() { 304 void testFunctionDefaults1() {
305 // TODO(jimhug): This return null shouldn't be necessary. 305 // TODO(jimhug): This return null shouldn't be necessary.
306 function f() { return null; }; 306 function f() { return null; };
307 (function(a = 10) { assert(a == 10); })(); 307 (function(a = 10) { assert(a == 10); })();
308 (function(a, b = 10) { assert(b == 10); })(1); 308 (function(a, b = 10) { assert(b == 10); })(1);
309 (function(a = 10) { assert(a == null); })( f() ); 309 (function(a = 10) { assert(a == null); })( f() );
310 // FAILS: (function(a = 10) { assert(a === null); })( f() );
311 } 310 }
312 311
313 void testFunctionDefaults2() { 312 void testFunctionDefaults2() {
314 assert( helperFunctionDefaults2() == 10); 313 assert( helperFunctionDefaults2() == 10);
315 assert( helperFunctionDefaults2(1) == 1); 314 assert( helperFunctionDefaults2(1) == 1);
316 } 315 }
317 316
318 void helperFunctionDefaults2(a = 10) { 317 void helperFunctionDefaults2(a = 10) {
319 return (function(){return a;})(); 318 return (function(){return a;})();
320 } 319 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 foo = f; 360 foo = f;
362 fooIntString = f; 361 fooIntString = f;
363 362
364 foo = fooIntString; 363 foo = fooIntString;
365 fooIntString = foo; 364 fooIntString = foo;
366 365
367 uf = uf2; 366 uf = uf2;
368 uf2 = uf; 367 uf2 = uf;
369 } 368 }
370 } 369 }
OLDNEW
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/parser/StringBuffer.dart ('k') | pkg/logging/test/logging_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698