| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.semantics_visitor_test; | 5 library dart2js.semantics_visitor_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import 'package:compiler/src/constants/expressions.dart'; | 10 import 'package:compiler/src/constants/expressions.dart'; |
| (...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 const [ | 2345 const [ |
| 2346 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 2346 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, |
| 2347 element: 'function(m)', | 2347 element: 'function(m)', |
| 2348 parameters: '(a,[b])', | 2348 parameters: '(a,[b])', |
| 2349 body: '{}'), | 2349 body: '{}'), |
| 2350 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 2350 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, |
| 2351 element: 'parameter(m#a)', | 2351 element: 'parameter(m#a)', |
| 2352 index: 0), | 2352 index: 0), |
| 2353 const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, | 2353 const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL, |
| 2354 element: 'parameter(m#b)', | 2354 element: 'parameter(m#b)', |
| 2355 index: 1), | 2355 index: 1, |
| 2356 constant: 'null'), |
| 2356 ]), | 2357 ]), |
| 2357 const Test( | 2358 const Test( |
| 2358 ''' | 2359 ''' |
| 2359 m(a, [b = null]) {} | 2360 m(a, [b = null]) {} |
| 2360 ''', | 2361 ''', |
| 2361 const [ | 2362 const [ |
| 2362 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 2363 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, |
| 2363 element: 'function(m)', | 2364 element: 'function(m)', |
| 2364 parameters: '(a,[b=null])', | 2365 parameters: '(a,[b=null])', |
| 2365 body: '{}'), | 2366 body: '{}'), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2394 ''', | 2395 ''', |
| 2395 const [ | 2396 const [ |
| 2396 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 2397 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, |
| 2397 element: 'function(m)', | 2398 element: 'function(m)', |
| 2398 parameters: '(a,{b})', | 2399 parameters: '(a,{b})', |
| 2399 body: '{}'), | 2400 body: '{}'), |
| 2400 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, | 2401 const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL, |
| 2401 element: 'parameter(m#a)', | 2402 element: 'parameter(m#a)', |
| 2402 index: 0), | 2403 index: 0), |
| 2403 const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, | 2404 const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL, |
| 2404 element: 'parameter(m#b)'), | 2405 element: 'parameter(m#b)', |
| 2406 constant: 'null'), |
| 2405 ]), | 2407 ]), |
| 2406 const Test( | 2408 const Test( |
| 2407 ''' | 2409 ''' |
| 2408 m(a, {b: null}) {} | 2410 m(a, {b: null}) {} |
| 2409 ''', | 2411 ''', |
| 2410 const [ | 2412 const [ |
| 2411 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, | 2413 const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL, |
| 2412 element: 'function(m)', | 2414 element: 'function(m)', |
| 2413 parameters: '(a,{b: null})', | 2415 parameters: '(a,{b: null})', |
| 2414 body: '{}'), | 2416 body: '{}'), |
| (...skipping 3788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6203 VISIT_OPTIONAL_PARAMETER_DECL, | 6205 VISIT_OPTIONAL_PARAMETER_DECL, |
| 6204 VISIT_NAMED_PARAMETER_DECL, | 6206 VISIT_NAMED_PARAMETER_DECL, |
| 6205 VISIT_REQUIRED_INITIALIZING_FORMAL_DECL, | 6207 VISIT_REQUIRED_INITIALIZING_FORMAL_DECL, |
| 6206 VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL, | 6208 VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL, |
| 6207 VISIT_NAMED_INITIALIZING_FORMAL_DECL, | 6209 VISIT_NAMED_INITIALIZING_FORMAL_DECL, |
| 6208 | 6210 |
| 6209 ERROR_UNRESOLVED_POSTFIX, | 6211 ERROR_UNRESOLVED_POSTFIX, |
| 6210 | 6212 |
| 6211 // TODO(johnniwinther): Add tests for more error cases. | 6213 // TODO(johnniwinther): Add tests for more error cases. |
| 6212 } | 6214 } |
| OLD | NEW |