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

Side by Side Diff: dart/tests/language/parameter_name_conflict_test.dart

Issue 10543050: Compute the swap temporary to not clash with parameter names. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 foo(t0) {
6 var a = t0, b = baz(), c = bar();
7 if (t0 == 'foo') {
8 // Force a SSA swapping problem where dart2js used to use 't0' as
9 // a temporary variable.
10 var tmp = c;
11 c = b;
12 b = tmp;
13 }
14
15 Expect.equals('foo', a);
16 Expect.equals('foo', t0);
17 Expect.equals('bar', b);
18 Expect.equals('baz', c);
19 }
20
21 bar() => 'bar';
22 baz() => 'baz';
23
24 main() {
25 foo('foo');
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698