| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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.js_emitter.interceptor_stub_generator; | 5 library dart2js.js_emitter.interceptor_stub_generator; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
| 8 | 8 |
| 9 import '../common_elements.dart'; | 9 import '../common_elements.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 typeCheck); | 371 typeCheck); |
| 372 } | 372 } |
| 373 } | 373 } |
| 374 return null; | 374 return null; |
| 375 } | 375 } |
| 376 | 376 |
| 377 jsAst.Expression generateOneShotInterceptor(jsAst.Name name) { | 377 jsAst.Expression generateOneShotInterceptor(jsAst.Name name) { |
| 378 Selector selector = | 378 Selector selector = |
| 379 _oneShotInterceptorData.getOneShotInterceptorSelector(name); | 379 _oneShotInterceptorData.getOneShotInterceptorSelector(name); |
| 380 Set<ClassEntity> classes = | 380 Set<ClassEntity> classes = |
| 381 _interceptorData.getInterceptedClassesOn(selector.name, _closedWorld); | 381 _interceptorData.getInterceptedClassesOn(selector.name); |
| 382 jsAst.Name getInterceptorName = _namer.nameForGetInterceptor(classes); | 382 jsAst.Name getInterceptorName = _namer.nameForGetInterceptor(classes); |
| 383 | 383 |
| 384 List<String> parameterNames = <String>[]; | 384 List<String> parameterNames = <String>[]; |
| 385 parameterNames.add('receiver'); | 385 parameterNames.add('receiver'); |
| 386 | 386 |
| 387 if (selector.isSetter) { | 387 if (selector.isSetter) { |
| 388 parameterNames.add('value'); | 388 parameterNames.add('value'); |
| 389 } else { | 389 } else { |
| 390 for (int i = 0; i < selector.argumentCount; i++) { | 390 for (int i = 0; i < selector.argumentCount; i++) { |
| 391 parameterNames.add('a$i'); | 391 parameterNames.add('a$i'); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 | 451 |
| 452 var map = new jsAst.ObjectInitializer(properties); | 452 var map = new jsAst.ObjectInitializer(properties); |
| 453 elements.add(map); | 453 elements.add(map); |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 | 456 |
| 457 return new jsAst.ArrayInitializer(elements); | 457 return new jsAst.ArrayInitializer(elements); |
| 458 } | 458 } |
| 459 } | 459 } |
| OLD | NEW |