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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 class InterceptorStubGenerator { | 7 class InterceptorStubGenerator { |
8 final Compiler compiler; | 8 final Compiler compiler; |
9 final Namer namer; | 9 final Namer namer; |
10 final JavaScriptBackend backend; | 10 final JavaScriptBackend backend; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 ''', typeCheck); | 284 ''', typeCheck); |
285 } | 285 } |
286 } | 286 } |
287 return null; | 287 return null; |
288 } | 288 } |
289 | 289 |
290 jsAst.Expression generateOneShotInterceptor(String name) { | 290 jsAst.Expression generateOneShotInterceptor(String name) { |
291 Selector selector = backend.oneShotInterceptors[name]; | 291 Selector selector = backend.oneShotInterceptors[name]; |
292 Set<ClassElement> classes = | 292 Set<ClassElement> classes = |
293 backend.getInterceptedClassesOn(selector.name); | 293 backend.getInterceptedClassesOn(selector.name); |
294 String getInterceptorName = namer.nameForGetInterceptor(classes); | 294 String getInterceptorName = |
| 295 namer.getInterceptorName(backend.getInterceptorMethod, classes); |
295 | 296 |
296 List<String> parameterNames = <String>[]; | 297 List<String> parameterNames = <String>[]; |
297 parameterNames.add('receiver'); | 298 parameterNames.add('receiver'); |
298 | 299 |
299 if (selector.isSetter) { | 300 if (selector.isSetter) { |
300 parameterNames.add('value'); | 301 parameterNames.add('value'); |
301 } else { | 302 } else { |
302 for (int i = 0; i < selector.argumentCount; i++) { | 303 for (int i = 0; i < selector.argumentCount; i++) { |
303 parameterNames.add('a$i'); | 304 parameterNames.add('a$i'); |
304 } | 305 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 364 |
364 var map = new jsAst.ObjectInitializer(properties); | 365 var map = new jsAst.ObjectInitializer(properties); |
365 elements.add(map); | 366 elements.add(map); |
366 } | 367 } |
367 } | 368 } |
368 } | 369 } |
369 | 370 |
370 return new jsAst.ArrayInitializer(elements); | 371 return new jsAst.ArrayInitializer(elements); |
371 } | 372 } |
372 } | 373 } |
OLD | NEW |