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

Side by Side Diff: tests/compiler/dart2js/drop_trailing_null_arguments_test.dart

Issue 702423002: Revert "Drop trailing null arguments in generated JS." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | 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
(Empty)
1 // Copyright (c) 2014, 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 // Test that parameters keep their names in the output.
5
6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart';
8 import 'compiler_helper.dart';
9
10 main() {
11 // If a function call has trailing 'null' arguments, we can safely skip
12 // them as JavaScript will fill missing arguments with 'undefined'.
13 asyncTest(() => compile(r"""
14 class It<A, B> {
15 It([a, b, c]) : super;
16 }
17
18 foo(a,b,c) => a;
19 test() {
20 foo(1, null, null);
21 foo(2, 3, null);
22 new It();
23 new It(null, 1);
24 }
25 """,
26 entry: 'test', minify: false).then((String generated) {
27 Expect.isTrue(generated.contains(r"foo(1)"));
28 Expect.isTrue(generated.contains(r"foo(2, 3)"));
29 Expect.isTrue(generated.contains(r"It$()"));
30 Expect.isTrue(generated.contains(r"It$(null, 1)"));
31 }));
32 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698