| OLD | NEW |
| 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 // Test that native methods with unnamed optional arguments are called with the | 5 // Test that native methods with unnamed optional arguments are called with the |
| 6 // number of arguments in the call site AND the call site is inlined. | 6 // number of arguments in the call site AND the call site is inlined. |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
| 9 | 9 |
| 10 typedef int Int2Int(int x); | 10 typedef int Int2Int(int x); |
| 11 | 11 |
| 12 class A native "*A" { | 12 class A native "A" { |
| 13 int foo([x, y, z]) native; | 13 int foo([x, y, z]) native; |
| 14 | 14 |
| 15 // Calls can be inlined provided they don't pass an argument. | 15 // Calls can be inlined provided they don't pass an argument. |
| 16 int callFun([Int2Int fn]) native; | 16 int callFun([Int2Int fn]) native; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class B { | 19 class B { |
| 20 static var g; | 20 static var g; |
| 21 method1(a) { | 21 method1(a) { |
| 22 g = '(Method1Tag)'; // Tag to identify compiled JavaScript method. | 22 g = '(Method1Tag)'; // Tag to identify compiled JavaScript method. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 var b = new B(); | 139 var b = new B(); |
| 140 Expect.equals(2, b.method2()); | 140 Expect.equals(2, b.method2()); |
| 141 Expect.equals(246, b.method3()); | 141 Expect.equals(246, b.method3()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 main() { | 144 main() { |
| 145 setup(); | 145 setup(); |
| 146 test1(); | 146 test1(); |
| 147 test2(); | 147 test2(); |
| 148 } | 148 } |
| OLD | NEW |